#include <string_view>
class str_ref : public std::string_view
{
public:
using std::string_view::string_view;
};
int main()
{
std::string_view sv;
str_ref sr("", 0);
str_ref sr2(sv); // error C2664: 'str_ref::str_ref(const str_ref &)': cannot convert argument 1 from 'std::string_view' to 'const char *const '
}
Why is the constructor for (string_view) not being found here? Shouldn't this constructor be imported with the using statement? The (const char*, size_t) constructor is being found. I'm using VS2017.