function2
function2 copied to clipboard
Improved and configurable drop-in replacement to std::function that supports move only types, multiple overloads and more
@Naios ----- ### Commit Hash 2d3a878ef19dd5d2fb188898513610fac0a48621 ### Expected Behavior `make -k test` should be successful ### Actual Behavior The test size_match_layout fails on i586/i686: ``` [ RUN ] regression_tests.size_match_layout /tmp/function2/test/regressions.cpp:62:...
@Naios When trying to initialize `fu2::function_view` with an object of type `fu2::function`, clang 14 spews out an incomprehensible error message without a proper "instantiation stack". It is possible to infer...
@Naios It would be nice if `function_base` supported deduction guides similar to std::function so that lambdas can have sensible type erased deductions. https://en.cppreference.com/w/cpp/utility/functional/function/deduction_guides ----- ### Commit Hash 2d3a878ef19dd5d2fb188898513610fac0a48621 ### Expected...
@Naios ----- ### What was a problem? See #32 ### How this PR fixes the problem? This PR disables `use_bool_op` when Objective C is detected. I would appreciate some help...
cppreference: [https://en.cppreference.com/w/cpp/types/aligned_storage](https://en.cppreference.com/w/cpp/types/aligned_storage) It's being used here: ```cpp /// A union which makes the pointer to the heap object share the /// same space with the internal capacity. /// The storage...
@Naios This is a real quick deduction guide implementation that worked for me but is really raw. I am open to collaboration as I'm not at all familiar with the...
@Naios ----- ### What was a problem? See #32 ### How this PR fixes the problem? This PR disables `use_bool_op` when Objective C is detected. I would appreciate some help...
Compiling this example in MSVC v19.43 VS17.13 [godbolt link](https://godbolt.org/z/oe1jW88a5) gives an error: `more than one partial specialization matches the template argument list` Example code: ``` #include "function2/function2.hpp" #include struct Foo...
@Naios Hi, I noticed constructing function involves at least three moves of my callable. In my use-case an extra move costs 150ns+. One of the extra moves is easy to...
In include/function2/function2.hpp, the following assignment operator overload appears to have an issue: C++ template constexpr erasure& operator=(erasure right) noexcept { invoke_table_ = right.invoke_table_; view_ = right.view_; return *this; } Problem:...