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++/55043] [4.7/4.8 Regression] issue with nesting unordered_map containing unique_ptr into vector


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

--- Comment #10 from Daniel KrÃgler <daniel.kruegler at googlemail dot com> 2012-10-24 06:37:05 UTC ---
(In reply to comment #9)
> (In reply to comment #8)
> > is this a bug in is_constructible?
> 
> I don't think so. The implementation of the copy constructor is irrelevant,
> only the prototype matters to determine copy-constructibility.

I agree with Marc, the trait can only test what the compile-time interface
says. This *could* be an LWG issue and one possible solution would be to
require that implementations ensure that for a non-copyable element type a
container's copy constructor is deleted. This is technically possible, but also
has the unfortunate side-effect that existing container implementations for
std::vector, std::list, etc. could after this change *never* be used in
situations where the element type is still incomplete (albeit not granted by
the standard, many implementations allow this), like

#include <list>
#include <vector>

struct S {
  std::list<S> li;
  std::vector<S> v;
} s1, s2 = s1;


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