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

Possible typo in property template #20

Closed maximilianriemensberger closed 5 years ago

maximilianriemensberger commented 5 years ago

While looking for a unique_function implementation I cam across this lib. I was wondering about the following line: https://github.com/Naios/function2/blob/d2acdb6c3c7612a6133cd03464ef941161258f4e/include/function2/function2.hpp#L118

That looks suspiciously like a typo. Shouldn't it be instead:

  static constexpr auto const is_strong_exception_guaranteed = HasStrongExceptGuarantee;
Naios commented 5 years ago

Thanks for pointing this out, and you were right that's a typo indeed! It turns out that this typo only affects the internal signature of the type erasure which is not exposed to the public. For the public interface the property is unwrapped directly such that the correct HasStrongExceptGuarantee bool was used and the issue is not as severe as it seems.

In 8b481ad7bd4b9 I fixed the issue and added a corresponding regression test.