Open OlafvdSpek opened 7 years ago
I think it would be much nicer if everyone would use string_view
and we could get rid of string_ref
. (which is the long-term plan)
boost::string_view
or std::string_view
? ;)
That'd sure be nice but neither of them is available everywhere yet.
I was speaking in the context of boost, so boost::string_view
.
I would like to remove boost::string_ref
and have everyone who is currently using that to use boost::string_view
What about interoperability between boost::string_view and std::string_view?
#include <boost/utility/string_view.hpp>
#include <string_view>
void f0(boost::string_view);
void f1(std::string_view);
int main(int argc, char* argv[])
{
boost::string_view a;
std::string_view b;
f0(a);
f0(b); // error
f1(a); // error
f1(b);
}
// MSVC 2017
@mclow ?
My general feeling is that if you have std::string_view
you should use that.
boost::string_view
is for situations (pre-C++17, etc) where you don't have std::string_view
.
OK, so no plans for interoperability?
Fortunately std::string_view
has better availability now so it's less of a problem.
It'd be nice if string_ref and string_view could interoperate..