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

Any docs about the custom allocator? #60

Closed renzibei closed 6 months ago

renzibei commented 6 months ago

Hi! I saw in the readme that custom Allocator is already supported. However, the usage of this in the source code is quite complex. Is there a more intuitive example of how to use it? Additionally, as hardware updates quickly, are there any new benchmark data available?

Thank you!

feverzsj commented 6 months ago

Seems you have to pass the allocator each time you construct or assign a function object.

Naios commented 6 months ago

Yes, the allocator can be passed to each method that accepts a callable for type-erasure, this should be self-explaining by any code-completion. This repository does not maintain benchmarks directly, but benchmarks are available here: https://github.com/jamboree/CxxFunctionBenchmark. In this case you need to create a separate issue at the linked repository and request to update the benchmarks.