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

Method moveFrom

src/fl/stl/basic_string.cpp.hpp:1204–1216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1202// ======= PROTECTED: MOVE / SWAP / FACTORY HELPERS =======
1203
1204void basic_string::moveFrom(basic_string&& other) FL_NOEXCEPT {
1205 if (other.isInline()) {
1206 mLength = other.mLength;
1207 fl::memcpy(inlineBufferPtr(), other.inlineBufferPtr(), other.mLength + 1);
1208 // mStorage is already empty (inline mode) from constructor
1209 } else {
1210 mLength = other.mLength;
1211 mStorage = fl::move(other.mStorage);
1212 }
1213 other.mLength = 0;
1214 other.mStorage.reset();
1215 other.inlineBufferPtr()[0] = '\0';
1216}
1217
1218void basic_string::moveAssign(basic_string&& other) FL_NOEXCEPT {
1219 if (this == &other) return;

Callers

nothing calls this directly

Calls 4

memcpyFunction · 0.50
isInlineMethod · 0.45
inlineBufferPtrMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected