Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
constructor-is-not-called-in-this-aggregation-class
#include <iostream> #include <memory> using namespace std; class A { public: A() { cout << "A()" << endl; } }; class B { public: A a; B(const A& a1) : a(a1) { cout << "B(const A&)" << endl; } /* B(const A& a1) { a = a1; cout << "B(const A&)" << endl; } */ }; int main() { B b(A()); /* no ouput */ }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
HTML Timetable generator.cpp
Pure virtual function called!
10226
Forgetting to check end
INHERIT_CTORS default constructor
back_inserter example
boost tokenizer
std::reference_wrapper
1337
001
stackse - search stackoverflow differently
Please log in to post a comment.