|
Boost Users : |
Subject: Re: [Boost-users] [Proto] fatal error C1001: An internal error has occurred in the compiler.
From: christophe henry (henry_christophe_at_[hidden])
Date: 2009-06-24 17:44:41
Thanks to Eric and Joel, it now works. Just for info, the solution:
// grammar forbidding address of for terminals
struct state_grammar : proto::not_<proto::address_of<proto::_> >
{};
// Forward-declare an expression wrapper
template<typename Expr>
struct make_state;
struct sm_domain
: proto::domain< proto::generator<make_state>, state_grammar >
{};
template<typename Expr>
struct make_state
: proto::extends<Expr, make_state<Expr>, sm_domain>
{
typedef
proto::extends<Expr, make_state<Expr>, sm_domain>
base_type;
// Needs a constructor
make_state(Expr const &e = Expr())
: base_type(e)
{}
// Unhide Proto's overloaded assignment operator
using base_type::operator=;
};
Then, to define a terminal:
struct s1: make_state<proto::terminal<state_tag>::type>{};
Thanks a lot!
Regards,
Christophe
_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net