This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/55963] std::vector<const T> fails
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 13 Jan 2013 19:04:43 +0000
- Subject: [Bug libstdc++/55963] std::vector<const T> fails
- Auto-submitted: auto-generated
- References: <bug-55963-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55963
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-01-13 19:04:43 UTC ---
I disagree with the claim it's required to work. It's true that container
requirements have been relaxed so requirements on types are more fine-grained
and only apply to specific operations, but std::vector<const int> instantiates
std::allocator<const int> and that creates ambiguous overloads of
std::allocator<const int>::address(reference) and std::allocator<const
int>::address(const_reference) because reference and const_reference are the
same type.
I would argue it's required not to work, based on the explicit definition of
std::allocator given in the C++11 standard.
I've been thinking about altering std::allocator so it works though, so I'll
confirm this as an extension.