re::function is an attempt to implement std::function
on its own.
It's a very slow implementation. It can be unstable, so use at your own risk.
Just for fun. An exercise to rewrite a small part of the standard library. I tried to follow a bunch of methods from C++20, while using C++17.
Clone the library or add it via git modules(recommended).
# In your repo directory
$ git submodule add https://github.com/xDiaym/refunction
Add in your CMakeLists.txt
this line:
target_link_libraries(${PROJECT_NAME} PRIVATE refunction)
It should be enough.
Additional you can disable RTTI support and lose re::function::target
and
re::function::target_type
methods. For that use option NO_RTTI
.
Also, you can enable test build. Just add BUILD_TESTS
option.
$ ./bin/test.py
# Or in build directory
$ ctest
Licensed under MIT