core icon indicating copy to clipboard operation
core copied to clipboard

boost::core::string_view does not compile/gives wrong result with std::print

Open libbooze opened this issue 10 months ago • 0 comments

It is quite possible this is just bug in std::print implementations, but if you can make something to make it work it would be nice.

For gcc14.2 simple use of std::print does not compile, for clang 19.1(with libc++) things are even worse, code compiles, but string_view is not printed as string, but as a container, i.e. this code

int main() {
    boost::core::string_view bsv{"abc"};
    std::string_view ssv{"abc"};
    std::println("{}", bsv);
    std::println("{}", ssv);
}

outputs

['a', 'b', 'c']
abc

https://godbolt.org/z/e7fva7Y7c

libbooze avatar Mar 05 '25 15:03 libbooze