1233 {
1234 if (this == &other) return;
1235
1237 bool otherInline = other.isInline();
1238
1239 if (!thisInline && !otherInline) {
1240
1243 } else if (thisInline && otherInline) {
1244
1246 bool otherFits =
mLength + 1 <= other.mInlineCapacity;
1247 if (thisFits && otherFits) {
1248
1250 for (fl::size i = 0; i <= maxLen; ++i) {
1253 other.inlineBufferPtr()[i] = tmp;
1254 }
1256 } else {
1257
1263 fl::size otherLen = other.mLength;
1264 if (thisFits) {
1267 } else {
1269 }
1271 if (otherFits) {
1272 other.mStorage.reset();
1273 fl::memcpy(other.inlineBufferPtr(), thisData->data(), thisLen + 1);
1274 } else {
1275 other.mStorage = thisData;
1276 }
1277 other.mLength = thisLen;
1278 }
1279 } else if (thisInline) {
1280
1282
1285
1286 other.mStorage.reset();
1287 if (thisLen + 1 <= other.mInlineCapacity) {
1289 } else {
1292 }
1293 other.mLength = thisLen;
1294 } else {
1295
1296 other.swapWith(*this);
1297 }
1298}
bool isInline() const FL_NOEXCEPT
fl::variant< NotNullStringHolderPtr, ConstLiteral, ConstView > mStorage
char * inlineBufferPtr() FL_NOEXCEPT
constexpr remove_reference< T >::type && move(T &&t) FL_NOEXCEPT
void swap(T &a, T &b) FL_NOEXCEPT
void * memcpy(void *dest, const void *src, size_t n) FL_NOEXCEPT
constexpr common_type_t< T, U > max(T a, U b) FL_NOEXCEPT
fl::not_null< StringHolderPtr > NotNullStringHolderPtr
shared_ptr< T > make_shared(Args &&... args) FL_NOEXCEPT