
On 29 December 2012 18:37, Marshall Clow <mclow.lists@gmail.com> wrote:
On Dec 29, 2012, at 9:33 AM, Daniel James <dnljms@gmail.com> wrote:
On 29 December 2012 16:56, Marshall Clow <mclow.lists@gmail.com> wrote:
but how would a string_ref constructor know that?
How does your existing constructor know that the length doesn't overflow?
I think we're talking about different things here. I'm talking about how a string_ref constructor would know that the range defined by two iterators is contiguous
The answer to both questions is, "It doesn't. It's the programmers responsibility". If you use a pair of string iterators that aren't contiguous anywhere you will have problems. I don't see why this is a special case.
How important is the notational convenience of being able to write:
if ( sr1 == str1 ) and if ( str1 == sr1 )
Just wondering.
The code in question is: boost::find(id_attributes, name) Where id_attributes is a string of vectors, name is a string_ref, boost::find is the range version of std::find.