From: Christopher Dykes Date: Mon, 21 Nov 2016 23:40:54 +0000 (-0800) Subject: Work around an MSVC expression SFINAE bug in DynamicParser X-Git-Tag: v2016.11.28.00~13 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=cc97c6eaa0fa39a5107f5a4da7782692347d6d79;p=folly.git 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 --- diff --git a/folly/experimental/DynamicParser-inl.h b/folly/experimental/DynamicParser-inl.h index f3dc0c35..df390b74 100644 --- a/folly/experimental/DynamicParser-inl.h +++ b/folly/experimental/DynamicParser-inl.h @@ -77,22 +77,18 @@ using ArgumentTypes = // extended. The comparison deliberately strips cv-qualifieers and // reference, leaving that choice up to the caller. template -constexpr bool hasArgumentTypes() { - using HasArgumentTypes = typename boost::mpl::template equal< - typename boost::mpl::template transform< - typename boost::mpl::template transform< - ArgumentTypes, - typename std::template remove_reference - >::type, - typename std::template remove_cv - >::type, - boost::mpl::vector - >::type; - return HasArgumentTypes::value; -} +struct HasArgumentTypes + : boost::mpl::template equal< + typename boost::mpl::template transform< + typename boost::mpl::template transform< + ArgumentTypes, + typename std::template remove_reference>:: + type, + typename std::template remove_cv>::type, + boost::mpl::vector>::type {}; template using EnableForArgTypes = - typename std::enable_if(), void>::type; + typename std::enable_if::value, void>::type; // No arguments template EnableForArgTypes