
16 Nov
2012
16 Nov
'12
9:24 a.m.
On Fri, Nov 16, 2012 at 9:52 AM, Antony Polukhin <antoshkka@gmail.com> wrote:
2012/11/16 Andrey Semashev <andrey.semashev@gmail.com>:
+1 for having corresponding explicit converting ctors/operators.
Shouldn't they be implicit?
void f(str_ref);
string s = "Olaf"; f(s);
Looks nice. And what about constructors from std::array?
It should be implicitly constructable from any contiguous (char) range.
BTW, I'd like to see a std::basic_string to_string()/str() and std::array to_array()/array() member functions.
Why member functions? Array is fixed size, str_ref isn't. How would you handle a size mismatch? -- Olaf