
16 May
2016
16 May
'16
4:44 p.m.
Hi, Why the following grammar doesn't match dereference, and what's the correct way to do this? Thanks! ////////////////// #include <iostream> #include <boost/proto/proto.hpp> namespace proto = boost::proto; using proto::_; struct has_deref : proto::or_< proto::dereference<_>, proto::nary_expr<_, proto::vararg<has_deref>> > {}; template<class Expr> void test_expr(const Expr &e) { proto::display_expr(e); std::cout << "matches? " << std::boolalpha << proto::matches<Expr, has_deref>::value << std::endl; } int main() { test_expr(proto::lit(1) + *proto::lit(2)); }
3309
Age (days ago)
3309
Last active (days ago)
0 comments
1 participants
participants (1)
-
Igor R