This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
N3644 Comparing value-initialized iterators
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: "libstdc++" <libstdc++ at gcc dot gnu dot org>, François Dumont <frs dot dumont at gmail dot com>
- Date: Fri, 15 Nov 2013 18:26:16 +0000
- Subject: N3644 Comparing value-initialized iterators
- Authentication-results: sourceware.org; auth=none
http://www.open-std.org/JTC1/sc22/WG21/docs/papers/2013/n3644.pdf
makes it OK to compare two value-initialized iterators, and is one of
the few C++14 library features not implemented on trunk.
I haven't checked, but my assumption is that the only change needed to
the library is to allow examples like this in Debug Mode:
std::vector<int>::iterator i{}; // value init
i == i;
Currently this fails because the iterator is singular, but we need to
allow it, *without* allowing this:
std::vector<int>::iterator i; // default init
i == i;
I'm not sure how to do this. I thought about trying to play games with
uninitialized members that would be zero-init'd by value-init and left
uninit'd by default-init, but I gave up.