This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[RFC] libstdc++/9626 and std::vector constructors
- From: Paolo Carlini <pcarlini at unitus dot it>
- To: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>
- Cc: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- Date: Sat, 08 Feb 2003 13:34:08 +0100
- Subject: [RFC] libstdc++/9626 and std::vector constructors
Hi everyone,
I'm looking a bit into this report and need your help. Is all
about the constructors we currently have in v3:
explicit
vector(const allocator_type& __a = allocator_type());
vector(size_type __n, const value_type& __value,
const allocator_type& __a = allocator_type());
explicit
vector(size_type __n);
In my reading of the standard (23.2.4.1), seems "obvious" that
they should be changed to:
explicit
vector(const allocator_type& __a = allocator_type());
explicit
vector(size_type __n, const value_type& __value,
const allocator_type& __a = allocator_type());
Indeed, with this change submitter's testcase
std::vector<std::vector<int> > v(2, 4);
is rejected according to his expectations.
*However*, if I really do this *naive* change std::vector
breaks apart horribly and v3 is *not* functional anymore
(dozens of tests fail)
Could you please help me a bit through the mysteries of the
'explicit' keyword and all that?
Thanks in advance,
Paolo.