#if defined(TETL_ENABLE_CXX_MODULES)
import etl;
#else
#endif
struct Person {
constexpr Person(int a, int e) noexcept
: age{a}
, experience{e}
{
}
friend constexpr auto operator==(Person lhs, Person rhs) noexcept -> bool = default;
int age{};
int experience{};
};
auto main() -> int
{
assert(people.capacity() == 32);
people.push_back(Person{20, 0});
assert(people.back().age == 20);
people.emplace_back(90, 100);
assert(people.back().age == 90);
auto const copy = people;
auto levelUp = [](auto p) {
p.experience += 1;
return p;
};
assert(people[0].experience == 1);
assert(people[1].experience == 101);
return 0;
}
#define assert(...)
Definition cassert.hpp:20
constexpr auto transform(InputIt first, InputIt last, OutputIt dest, UnaryOp op) -> OutputIt
Definition transform.hpp:25
constexpr auto copy(InputIt first, InputIt last, OutputIt destination) -> OutputIt
Copies the elements in the range, defined by [first, last), to another range beginning at destination...
Definition copy.hpp:19
constexpr auto end
Definition end.hpp:57
constexpr auto begin
Definition begin.hpp:62
The class template bitset represents a fixed-size sequence of Bits bits. Bitsets can be manipulated b...
Definition bitset.hpp:23