Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
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
Program_3
Linker error while passing constexpr variable as const &
Range List for C++
virtual members
even number
problem_name_1
std::99 bottles of beer!
Rounding float to nearest 1000 (fixed)
Array-Based Heap Example Solution
Magic, why 1 2?