I'd like to copy variables into the lambda expression, but is there any good way to put variables into the lambda expression in the case of classes that create or copy instances with functions?
Ta(T::create_instance());// instance creation
Tb(T::create_instance());
b. copy(a); // a to b. copy
// lambda system
Auto func=[b]<-------b does not have a copy constructor and results in an error.
{
// processing
};
intret = func();
Resolved with initialization capture that you answered in the comments section.
Thank you.
© 2024 OneMinuteCode. All rights reserved.