
17 Nov
2012
17 Nov
'12
9:29 p.m.
On 16/11/12 15:50, Maxim Yanchenko wrote:
Mathias Gaunard <mathias.gaunard <at> ens-lyon.org> writes:
If this is all you need, just use plain references.
void f(std::string const&); f("Olaf");
does make a useless copy.
OK. I thought you were talking about Olaf's desire to have implicit conversion from std::string. For this we use just f(char_range::literal("Olaf"));
basic_string_ref<T> is meant to when being implicitly constructed from a T(&)[N] or T const* that it is null-terminated. I don't even understand why people are still discussing this and making ridiculous proposals. If you want the above use boost::iterator_range<char*>.