Given the syntax for a lambda capture here, I surmise that the syntax for a capture by-copy with initializer is as follows
[identifier initializer] () {}
This means that it can take these forms:
string s = "The quick brown fox jumped over the lazy dog. This is a loooooooooooooong string"
[ x=val ] ( ) { } // (1)
[ x{val} ] ( ) { } // (2)
Both forms work for a lambda.
I do understand that the common form is with the use of the assignment operator.
In terms of performance, which of the 2 forms is better?
New contributor
Sephiroth is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.