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
{{ message }}
Repository navigation
Suggestion: Allow users of function2 to know easily whether their lambdas are stored inplace #36
This could also be useful as a configuration option to disallow function objects that are too large for SFO.
using MyFunction = fu2::function_base<...>;
auto cb1 = [foo, bar] {};
auto cb2 = [foo, bar, baz] {};
MyFunction f1{cb1}; // allowed//MyFunction f2{cb2}; // too big for SFO, compile error
I came here looking for an in-place move-only function, and I very much vote for both proposals. In some places I want my functions to be in-place only, with a possibility to increase the storage size as needed.
Activity
Naios commentedon Apr 19, 2020
This could be really useful indeed.
Probably it will be implemented in the future.
Ahajha commentedon Aug 28, 2022
This could also be useful as a configuration option to disallow function objects that are too large for SFO.
Naios commentedon Aug 28, 2022
Yes, that's right. Something like
fu2::inplace_function(which itself could be a specialization offu2::function_base) could be quite useful.VioletGiraffe commentedon Jan 23, 2023
I came here looking for an in-place move-only function, and I very much vote for both proposals. In some places I want my functions to be in-place only, with a possibility to increase the storage size as needed.