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
545 stars 46 forks source link

supports uses-allocator construction #61

Closed feverzsj closed 8 months ago

feverzsj commented 8 months ago

@Naios

uses-allocator construction

Seems all it needed is specializing std::uses_allocator<T, Alloc>.

Naios commented 8 months ago

Hi, yes seems like it. Could you provide the specialization through a PR?

A specialization for the class function in fu2::detail should be sufficient:

template <typename Config, bool IsThrowing, bool HasStrongExceptGuarantee,
          typename... Args>
class function<Config, property<IsThrowing, HasStrongExceptGuarantee, Args...>>
Naios commented 8 months ago

Fixed in https://github.com/Naios/function2/pull/62