Commit 2d965d43 by Jason Rhinelander

Add MSVC 2017 cpp_function ICE workaround

The `decltype(...)` in the template parameter that gives us SFINAE
matching for a lambda makes MSVC 2017 ICE; this works around if by
changing the test to an explicit not-a-function-or-pointer test, which
seems to work everywhere.
parent b7017c3d
...@@ -51,9 +51,14 @@ public: ...@@ -51,9 +51,14 @@ public:
} }
/// Construct a cpp_function from a lambda function (possibly with internal state) /// Construct a cpp_function from a lambda function (possibly with internal state)
template <typename Func, typename... Extra, template <typename Func, typename... Extra, typename = detail::enable_if_t<
typename FuncType = typename detail::remove_class<decltype(&std::remove_reference<Func>::type::operator())>::type> detail::satisfies_none_of<
typename std::remove_reference<Func>::type,
std::is_function, std::is_pointer, std::is_member_pointer
>::value>
>
cpp_function(Func &&f, const Extra&... extra) { cpp_function(Func &&f, const Extra&... extra) {
using FuncType = typename detail::remove_class<decltype(&std::remove_reference<Func>::type::operator())>::type;
initialize(std::forward<Func>(f), initialize(std::forward<Func>(f),
(FuncType *) nullptr, extra...); (FuncType *) nullptr, extra...);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment