sylveon / member_thunk

Dynamically creates executable code to allow C callbacks to call C++ member functions without the need for a user data parameter
MIT License
13 stars 2 forks source link

Support noexcept function pointers #23

Closed sylveon closed 4 years ago

sylveon commented 4 years ago

Currently, while noexcept member functions are supported, noexcept function pointers aren't.

struct Foo
{
    void bar() noexcept {}
};

Foo foo;
auto thunk = member_thunk::make<void(*)(std::size_t)>(&foo, &Foo::bar); // ok
auto thunk = member_thunk::make<void(*)(std::size_t) noexcept>(&foo, &Foo::bar); // associated constraints are not satisfied

Obviously, this should only enable when the called member function is noexcept too.