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

Supports constexpr in c++11 #40

Closed hikarin522 closed 4 years ago

hikarin522 commented 4 years ago

@Naios


What was a problem?

A compile error will occur in c++11.

How this PR fixes the problem?

Add FU2_CXX14_CONSTEXPR which has the same function as BOOST_CXX14_CONSTEXPR.

Naios commented 4 years ago

Could you describe the issues that this PR is targeting? function2 is a C++14 library mainly due to the usage of auto return types and _t traits and should not compile in-std=c++11 mode anyway, and the uses of constexpr here are valid in C++14.

Naios commented 4 years ago

Did you check whether this works with MSVC as well? I would merge this PR if you remove the boost header inclusion and entirely rely on a custom check for MSVC, Clang and GCC.