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 c++/39463] New: The type a std::vector cannot work with classes with the protected copy-constructors


The type a std::vector cannot work with classes with the protected
copy-constructors.

class A{
public:
 explicit A(const A&){};
};
std::vector<A> v;
A a;
v.push_back(a); // an error

Copy protection deleting solves a question.

class B{
public:
 B(const B&){};
};
std::vector<B> w;
B b;
w.push_back(b); // good

What is the matter?


-- 
           Summary: The type a std::vector cannot work with classes with the
                    protected copy-constructors
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: lisp2d at lisp2d dot net


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


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