stephenberry/glaze

Support of custom string

sjanel opened this issue · 3 comments

I would like to use this library with a custom string implementation as drop-down replacement of std::string. Is it possible to do that currently ?

If not, would it be possible to define a "writable buffer of char" as returned by value type custom mapping to make it work ? It could be a span<char>, or something else maybe.

Glaze uses C++20 concepts to handle different types. If your string class has a similar API to a std::string then it should still work. It should work as long as it has size(), resize(), and data() (to get the underlying buffer).

If you run into any issues, let me know.

Thanks a lot! Indeed it seems to work out of the box. What about explaining it in the documentation?

Nice. And thanks for the suggestion. I'll add some documentation notes about this.