In a pre-C++17 compiler, this is known as copy elision (test it with C++17 on compiler explorer or wandbox with -std=c++17 vs. -std=c++14 flags).
As of C++17, the compiler must delete numerous instances of copy and move constructors and create objects directly without the need of intermediary objects.
Unlike
A a { 10 };
the line
A a ...READ MORE
Jun 27, 2022
in C++
by
Damon
• 4,960 points
•
1,350 views