MCPcopy Create free account
hub / github.com/FastLED/FastLED / MoveOnly

Class MoveOnly

tests/fl/stl/iterator.cpp:120–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118
119FL_TEST_CASE("back_inserter with move semantics") {
120 struct MoveOnly {
121 int value;
122
123 MoveOnly(int v) : value(v) {}
124
125 // Delete copy constructor and copy assignment
126 MoveOnly(const MoveOnly&) = delete;
127 MoveOnly& operator=(const MoveOnly&) = delete;
128
129 // Move constructor and move assignment
130 MoveOnly(MoveOnly&& other) : value(other.value) {
131 other.value = -1;
132 }
133
134 MoveOnly& operator=(MoveOnly&& other) {
135 value = other.value;
136 other.value = -1;
137 return *this;
138 }
139 };
140
141 fl::vector<MoveOnly> vec;
142

Callers 1

FL_TEST_FILEFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected