Naios / function2

Improved and configurable drop-in replacement to std::function that supports move only types, multiple overloads and more
http://naios.github.io/function2
Boost Software License 1.0
539 stars 47 forks source link

supports uses-allocator construction #62

Closed feverzsj closed 6 months ago

feverzsj commented 6 months ago

@Naios

uses-allocator construction enables propagating to nested object:

std::vector<fu2::function<void()>, std::scoped_allocator_adaptor<Alloc>> vec;
vec.emplace_back([](){}); // calls fu2::function([](){}, Alloc());

https://godbolt.org/z/x3TaE5cEM

Naios commented 6 months ago

Merged, thank you for your PR.