On 9/21/2010 3:15 AM, Roland Bock wrote:
That did not make a difference:
// ----------------------------------------------------------------- #include<complex> #include<boost/proto/proto.hpp>
using namespace boost;
struct addition : proto::or_ < proto::terminal<proto::_> , proto::plus<addition,addition>
{};
struct equation: proto::or_ < proto::equal_to<addition, addition>
{};
template<class Expr> struct extension;
struct my_domain : proto::domain< proto::pod_generator< extension> , equation > {};
template<class Expr> struct extension { BOOST_PROTO_EXTENDS( Expr , extension<Expr> , my_domain ) };
int main() { extension<proto::terminal<int>::type> i;
Trouble here. The "equation" grammar only matches things of the form "x == y". The terminal "i" *by itself* is not of that form. You won't be able to use this terminal at all.
i == i; // ERROR
As expected. You need to change your grammar to allow lone terminals. -- Eric Niebler BoostPro Computing http://www.boostpro.com