You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There the constructor of __lambda_5_12 takes the arguments by copy. However, the Standard requires direct-initialization.
This is an area where the compiler is mightier than what developers can express in C++. The best option is to taken the parameters by reference or const reference. Some cases where variables are moved into captures still create an additional move.
Andreas
The text was updated successfully, but these errors were encountered:
I was made aware of the following example by @fenbf:
C++ Insights currently shows this transformation:
There the constructor of
__lambda_5_12
takes the arguments by copy. However, the Standard requires direct-initialization.This is an area where the compiler is mightier than what developers can express in C++. The best option is to taken the parameters by reference or
const
reference. Some cases where variables are moved into captures still create an additional move.Andreas
The text was updated successfully, but these errors were encountered: