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

C++17 noexcept support #17

Closed bebuch closed 5 years ago

bebuch commented 5 years ago

With C++17 the noexcept-specification became part of the function type. Do you have any support for it? The documentation doesn't mention it, but I found the specifier in your source.

It would be great if function2 would support noexcept for function types. Besides move-only callables this is the second big leak of std::function. (https://wg21.link/p0045 tries to fix this.)

If your current implementation already supports noexcept, it would be nice if you could add in the documentation in which way. Otherwise it would be nice if you would add this to the todos for the next version.

Thanks for the great library by the way! 😊

Naios commented 5 years ago

The support for the C++17 noexcept qualifier was added in version 3.1.0 already, see #15. The qualifier should work automatically out of the box if C++17 is enabled, see the corresponding unit tests for a usage example. But you are right, this feature isn't documented in the readme yet, I'll fix this soon.