constructor from any const char* and std::string
You can't construct a fixed string from anything other than fixed strings or char[N] where N is the same size as the fixed string's size.
It would be great to have convenience constructors that take any string and just truncate them.
There are 2 cases for such a constructor:
- The source string is larger than the destination one
- The source string is smaller than the destination one
In the first situation we can truncate the string.
But I do not understand what we should do in the second one with the rest of the destination string. Fill with '\0'? This is kinda weird.
std::string has separate size and capacity. I would expect fixed string to be a string of fixed capacity.
std::stringhas separate size and capacity. I would expect fixed string to be a string of fixed capacity.
As it stated in the documentation, fixstr::fixed_string has the std::array's semantics of fixed size, not capacity.