31 Oct
2021
31 Oct
'21
1:05 p.m.
Olaf van der Spek wrote:
Hi,
Why does the overload for boost::string_view not work? The std one works. Could it be made to work?
#include
#include #include #include <iostream> #include int main() { boost::trim_copy(boost::string_view()); // error boost::trim_copy(std::string_view()); }
std::string_view doesn't work either in C++17; it requires constructor (5) in https://en.cppreference.com/w/cpp/string/basic_string_view/basic_string_view that was added in C++20. boost::string_view can be made to work by the addition of a constructor that takes two pointers to char, like this https://github.com/boostorg/core/blob/12f5f51427fbc9d27f56e5de002b0008fea420...