Subject: Re: [Boost-users] [statechart] Template States, Compile Error
From: "Andreas Huber" <[email-masked]>
To: [email-masked]
Date: Tue, 28 Feb 2006 00:43:47 +0100
List-Id: Boost Users mailing list <boost-users.lists.boost.org>

It is getting late here in Switzerland. I've tried several things, 
nothing worked and I don't have much of a clue at the moment. The fact 
that two independent compilers choke on this pretty much rules out a 
compiler bug. I think a library bug isn't likely either as everything 
works when you make the innermost state non-templated. Moreover, the 
newest version of TransitionTest.cpp (checked in yesterday) seems to 
work perfectly on a number of platforms. That test does something very 
similar to what you try to do. I can't currently see any other 
explanation than that we must both be missing something. The attached 
program is what I got after throwing out all the unnecessary stuff. It 
compiles on MSVC, but as soon as you uncomment the commented parts it 
complains with "'inner_context_type' : is not a member of 
'NormalMode<Type>'". Tomorrow I'll try to reduce it to something that 
hasn't anything to do with Boost.Statechart...

#include <boost/statechart/state_machine.hpp>
#include <boost/statechart/simple_state.hpp>

namespace sc = boost::statechart;
namespace mpl = boost::mpl;

template< typename Type > struct NormalMode;
struct Switch : sc::state_machine< Switch, NormalMode< int > > {};

/*template< typename Type >*/ struct Off;
template< typename Type >
struct NormalMode : sc::simple_state< NormalMode< Type >, Switch, Off/*< 
Type >*/ >
{
};

//template< typename Type >
struct Off : sc::simple_state< Off/*< Type >*/, NormalMode< int > >
{
};

int main()
{
  Switch machine;
  machine.initiate();
  return 0;
}

-- 
Andreas Huber

When replying by private email, please remove the words spam and trap
from the address shown in the header. 

_______________________________________________
Boost-users mailing list
[email-masked]
http://lists.boost.org/mailman/listinfo.cgi/boost-users