This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/48101] obscure error message with std::set<const int>


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48101

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-03-13 12:24:13 UTC ---
Do you have a suggestion for a better error?  We could use a static_assert in
std::allocator to reject const T

As far as I can see, the reason the code is invalid is exactly the reason
given: std::allocator can't be instantiated with const T.   I don't think it's
invalid to default construct a set::set with a const value_type, as long as
don't use std::allocator.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]