Implement N3762 string_view: a non-owning reference to a string.
Mon Nov 18 17:33:00 GMT 2013
2013/11/18 David Kastrup <firstname.lastname@example.org>:
> Daniel Krügler <email@example.com> writes:
>> 2013/11/15 Ed Smith-Rowland <firstname.lastname@example.org>:
>>> As the title says. It's a pretty simple class" a non-mutating read-only
>>> view into a const CharT* or a basic_string.
>>> Built and tested on x86_64-linux.
>> Sorry, if this is documented somewhere, but is this intended to implement
>> ? I don't think that your implementation is valid, because it maps an
>> empty string view into a NULL data pointer. But according to the
>> specification of data() the return type, this isn't feasible:
>> constexpr const charT* data() const noexcept;
>> Returns: A non-null pointer p such that p + i == &operator(i) for
>> each i in [0,size()).
> Well, the "for each" qualifier is empty. So the "such that" clause is
> trivially true.
Sure, but this is not relevant here.
> That does not help with "non-null pointer" probably.
> But note that it would be fine to use a different pointer to unmapped
I understand that.
More information about the Libstdc++