On 8/18/2010 11:54 AM, Thomas Heller wrote:
> Hi all,
> 
> I just noticed that Eric wrote BOOST_MPL_ASSERT(proto::matches<Expr, 
> Grammar>) in one of his latest posts here on the list (see thread about 
> boost::parameters).
> 
> So I wonder, where is the fundamental difference between 
> BOOST_PROTO_ASSERT_MATCHES and the BOOS_MPL_ASSERT expression.

Well, you know, you *could* check the docs:

http://www.boost.org/doc/libs/1_44_0/doc/html/BOOST_PROTO_ASSERT_MATCHES.html

;-)

The difference is that BOOST_PROTO_ASSERT_MATCHES takes a runtime
expression and a grammar type, and checks that the expression matches
the grammar. It's handy for quickie one-offs like the example in the docs:

typedef
  proto::plus< proto::terminal< int >, proto::terminal< int > >
PlusInts;

BOOST_PROTO_ASSERT_MATCHES( proto::lit(1) + 42, PlusInts );

But really, that's the only difference. It's implemented in terms of
BOOST_MPL_ASSERT.

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com
_______________________________________________
proto mailing list
[email protected]
http://lists.boost.org/mailman/listinfo.cgi/proto

Reply via email to