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

Support and propagate noexcept-qualified function types #15

Closed RedBeard0531 closed 6 years ago

RedBeard0531 commented 6 years ago

@Naios

Basically, I want this to work

// This works today
using yesexcept_func = fu2::function<void()>;
static_assert(!noexcept(std::declval<yesexcept_func>()()));

// This fails to compile
using noexcept_func = fu2::function<void() noexcept>;
static_assert(noexcept(std::declval<noexcept_func>()()));

https://godbolt.org/g/zxVvKT Propagation may require c++17.

(Removed most of the issue template boilerplate since it doesn't seem to apply to feature requests)

Naios commented 6 years ago

Hey @RedBeard0531, thank you for your feature request. I also thought about this, and probably this will be implement in the future. Yes you are right, it requires C++17, if you would like to open a PR, I could provide you the necessary help.

Naios commented 6 years ago

Thanks for your feature request. It was implemented by c0b8792f10 and is available now in v3.1.0.