#include #include #include #include #include using std::string; using std::vector; using std::pair; namespace x3 = boost::spirit::x3; namespace ast { struct Identifier {}; } typedef vector::const_iterator iterator_type; struct XXX : x3::annotate_on_success {}; template struct disable_if_substitution_failure { typedef T type; }; template struct my_has_on_success : boost::mpl::false_ {}; template struct my_has_on_success().on_success( std::declval() , std::declval() , std::declval() , std::declval() ) )>::type > : boost::mpl::true_ {}; template struct x3_has_on_success : boost::mpl::false_ {}; template struct x3_has_on_success().on_success( std::declval() , std::declval() , std::declval() , std::declval() ) )>::type > : boost::mpl::true_ {}; int main() { auto a1 = my_has_on_success(); auto a2 = x3_has_on_success(); auto a3 = x3::detail::has_on_success(); typedef decltype(XXX().on_success(std::declval(), std::declval(), std::declval(), x3::unused)) type; bool b1 = a1; bool b2 = a2; bool b3 = a3; std::cout << "me: " << b1 << std::endl; std::cout << "x3: " << b2 << std::endl; std::cout << "real: " << b3 << std::endl; return 0; }