Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
cref
//g++ 5.4.0 #include <iostream> struct a { a() { std::cout << "a\n"; }; ~a() { std::cout << "~a\n"; }; }; struct b { b(const a& mya) : x(mya) { std::cout << "b\n"; } ~b() { std::cout << "~b\n"; } const a& x; }; int main() { b x{a{}}; std::cout << "reference to a in b is now invalid\n"; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Permute
shell sort
adjacent_difference-30-Seconds-Of-CPP
Bitwise - Check power of 2 or not
3SUM problem
Using copy_n
Count squares
SayHi
Destroy It!
MoaJhalMury
Please log in to post a comment.