1 Nov
2013
1 Nov
'13
11:42 p.m.
I noticed string_ref doesn't have a constructor for a string literal. Wouldn't this save a call to strlen for a common case? Ex. template< std::size_t N > basic_string_ref( const charT( &str )[N] ) : basic_string_ref( str, N-1 ) { static_assert(N >= 1, "not a string literal"); } string_ref test( "test" ); I see that adding this directly doesn't work as the compiler is always choosing to decay and pick the const char* overload. Is there no way to make this work?