A data type without a default constructor.
| 45 | |
| 46 | // A data type without a default constructor. |
| 47 | struct Foo { |
| 48 | int bar; |
| 49 | std::string baz; |
| 50 | |
| 51 | explicit Foo(int value) : bar(value), baz(kStringElement) {} |
| 52 | |
| 53 | bool operator==(const Foo& other) const { |
| 54 | return (bar == other.bar) && (baz == other.baz); |
| 55 | } |
| 56 | }; |
| 57 | |
| 58 | // A data type with only copy constructors. |
| 59 | struct CopyOnlyDataType { |