
On Mon, 2009-12-14 at 13:31 +0100, Christophe Henry wrote:
Are all those parentheses used for optional arguments, or could we consider eliminating them?
I'd love to eliminate them but don't see how. They actually are constructors. The complete expression would be something like:
typedef BOOST_TYPEOF(build_stt(( DestState() = CurrentState() + cool_event()[guard()]/action(), DestState2() = CurrentState() + cool_event()[guard2()]/action2() ) ) ) transition_table;
So I'm really just pretending to pass on-the-fly instances of arguments from types DestState, CurrentState, etc. to evaluate the result with typeof after proto is done.
Yes it is an interesting "hack".How "pretend" have you been able to make this? I was actually thinking about exactly this today (long drive - actually - correction - I was thinking about it yesterday - it's now early morning here) and wondering what the consequences were. Does it result in actually default constructing all these (temporary) objects? Won't that be expensive and/or have undesirable side effects?