
13 Dec
2012
13 Dec
'12
5:36 p.m.
On Thu, Dec 13, 2012 at 6:18 PM, Yakov Galka <ybungalobill@gmail.com> wrote:
[...] For string_ref, it could mean the difference between these 2 string_refs, assuming a ptr+size implementation:
{ ptr != 0, size == 0 } and { ptr == 0, size == hopefully_zero }
Right. And I want to note that it does matter. At least for std::string, whose constructor
True. In general containers / ranges have an empty state but not a null state and operator bool() should return !empty() IMO.
basic_string(const charT* s, size_type n, const Allocator& a = Allocator());
explicitly requires that `s` is be a non-null pointer (even if n == 0).
Sounds like a bug / defect. -- Olaf