What I'm trying to do is have my class accept a string during construction. I read that string_view was a replacement for const string& so naturally I wrote a constructor like this. This allows me to accept c++ and c strings.
Url::Url(boost::string_view raw_url)
: url_(static_cast<std::string>(raw_url)) {
The problem which might be here is that when an rvalue is passed, there is a unnecessary copy instead of a move. Is the solution to make another constructor which takes string&&? What is the best practice here?