As reported by Sören, when compiled with a C++17 compiler, gul14::variant causes a compilation error related to invoke_result_t. This error does not occur when compiled under C++14.
The bug seems to be subtle. Instead of fixing it directly, we can take advantage of the fact that the various invoke functions and types
are already available in namespace std on a C++17 compiler. Hence, we add a conditional compilation section that simply uses the following declarations on C++17 instead of the home-brew ones:
using std::invoke;
using std::invoke_result;
using std::invoke_result_t;
using std::is_invocable;
using std::is_invocable_r;
As reported by Sören, when compiled with a C++17 compiler,
gul14::variant
causes a compilation error related toinvoke_result_t
. This error does not occur when compiled under C++14.The bug seems to be subtle. Instead of fixing it directly, we can take advantage of the fact that the various invoke functions and types
are already available in namespace std on a C++17 compiler. Hence, we add a conditional compilation section that simply uses the following declarations on C++17 instead of the home-brew ones: