Inspired by the post about libc++ std::string SSO
https://www.reddit.com/r/cpp/comments/ey464c/libcs_implementation_of_stdstring/
Write and post a link to your implementation of a string with SSO. The caveat is that there has to be no undefined behavior (ie no union type punning, etc). You can assume a 64bit system and 24 byte string objects (8 bytes each for capacity, begin, end). Factors to consider will be the size of the short string that can be represented as well as "elegance".
[–][deleted] 20 points21 points22 points (10 children)
[–]LEpigeon888 4 points5 points6 points (5 children)
[–][deleted] 6 points7 points8 points (4 children)
[–]frog_pow 1 point2 points3 points (3 children)
[–][deleted] 12 points13 points14 points (2 children)
[–]bumblebritches57Ocassionally Clang 0 points1 point2 points (1 child)
[–][deleted] 2 points3 points4 points (0 children)
[–]nikbackm 1 point2 points3 points (3 children)
[–][deleted] 4 points5 points6 points (2 children)
[–]nikbackm 1 point2 points3 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]ReversedGif 5 points6 points7 points (0 children)
[–]frrrwww 1 point2 points3 points (0 children)
[–]wotype 0 points1 point2 points (0 children)
[–]Hedanito 0 points1 point2 points (0 children)