8 Apr 02:40
Proto v4
From: Eric Niebler <eric <at> boost-consulting.com>
Subject: Proto v4
Newsgroups: gmane.comp.parsers.spirit.devel
Date: 2008-04-08 00:43:33 GMT
Subject: Proto v4
Newsgroups: gmane.comp.parsers.spirit.devel
Date: 2008-04-08 00:43:33 GMT
No library ever made it through a review unscathed and proto is no
exception. There's a new version of proto in branches/proto/v4, and
Spirit-2 will need some changes to work with it. This is the version
that will be merged into trunk, eventually.
First the simple things:
* Proto lives at boost/proto/, not boost/xpressive/proto
* boost/proto/proto.hpp now includes all of proto with the
exception of the typeof registrations. That includes the
contexts, the transforms and the debugging utilities. If
you just want the core of proto without the other stuff,
there is boost/proto/core.hpp
* s/posit/unary_plus/
* s/arg/child, s/arg_c/child_c/, s/_argN/_childN
* s/bind/lazy/
* s/_visitor/_data/
* The proto::transform namespace is no more.
Some bigger changes:
The protocol for defining a primitive transform has changed. Previously,
primitive transforms were just ternary function objects like this:
struct MyTransform : proto::callable
{
template<class Sig>
struct result;
template<class This, class Expr, class State, class Data>
(Continue reading)
> #include <boost/proto/proto.hpp>
> struct A
> {};
> struct B
> {};
> using namespace boost::proto;
> int main(void)
> {
> terminal<A>::type ta;
> terminal<B>::type tb
> #if 0
> (ta)//fails to compile.
Correct, because they're different types.
> #endif
> ;
RSS Feed