xo-flatstring: undercap flastring_concat instead of char arrays

This commit is contained in:
Roland Conybeare 2024-04-18 13:27:06 -04:00
commit 0a03aa949b
3 changed files with 34 additions and 4 deletions

View file

@ -136,12 +136,12 @@ main() {
static_assert(sizeof(s14) == 7);
constexpr flatstring s15 = flatstring_concat(flatstring("hello"),
", ",
flatstring("world"));
flatstring(", "),
flatstring("world"));
static_assert(s15.fixed_capacity == 13);
static_assert(sizeof(s15) == 13);
constexpr auto s16 = xo::flatstring_concat("foo", "bar");
constexpr auto s16 = xo::flatstring_concat(flatstring("foo"), flatstring("bar"));
static_assert(s16.fixed_capacity == 7);