Commit cc97c6ea authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot

Work around an MSVC expression SFINAE bug in DynamicParser

Summary: The good news is that it's cleaner than it was to start with.

Reviewed By: yfeldblum

Differential Revision: D4215323

fbshipit-source-id: 6758092f1e76f60b360753026bb7716737a51304
parent 45c9e441
...@@ -77,22 +77,18 @@ using ArgumentTypes = ...@@ -77,22 +77,18 @@ using ArgumentTypes =
// extended. The comparison deliberately strips cv-qualifieers and // extended. The comparison deliberately strips cv-qualifieers and
// reference, leaving that choice up to the caller. // reference, leaving that choice up to the caller.
template <typename Fn, typename... Args> template <typename Fn, typename... Args>
constexpr bool hasArgumentTypes() { struct HasArgumentTypes
using HasArgumentTypes = typename boost::mpl::template equal< : boost::mpl::template equal<
typename boost::mpl::template transform< typename boost::mpl::template transform<
typename boost::mpl::template transform< typename boost::mpl::template transform<
ArgumentTypes<Fn>, ArgumentTypes<Fn>,
typename std::template remove_reference<boost::mpl::_1> typename std::template remove_reference<boost::mpl::_1>>::
>::type, type,
typename std::template remove_cv<boost::mpl::_1> typename std::template remove_cv<boost::mpl::_1>>::type,
>::type, boost::mpl::vector<Args...>>::type {};
boost::mpl::vector<Args...>
>::type;
return HasArgumentTypes::value;
}
template <typename... Args> template <typename... Args>
using EnableForArgTypes = using EnableForArgTypes =
typename std::enable_if<hasArgumentTypes<Args...>(), void>::type; typename std::enable_if<HasArgumentTypes<Args...>::value, void>::type;
// No arguments // No arguments
template <typename Fn> EnableForArgTypes<Fn> template <typename Fn> EnableForArgTypes<Fn>
......
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