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
545 stars 46 forks source link

Wrong static_assert for function that should be a unique_function. #25

Open atomgalaxy opened 5 years ago

atomgalaxy commented 5 years ago

@Naios


Commit Hash

e3695b4b4fa3c672e25c6462d7900f8d2417a417

Expected Behavior

When trying to make a fu2::function with a move-only object, you get an assert_error with the message "Can't wrap a non copyable object into a fu2::function, try using fu2::unique_function instead."

Actual Behavior

You get an error with "Can't wrap a non copyable object into a unique function!", which is super confusing.

Code at https://github.com/Naios/function2/blob/master/include/function2/function2.hpp#L1262

Naios commented 5 years ago

Yes, you are right, the assertion message is misleading indeed. Could you open a pull request with a message which would fit best in your opinion?