Boost logo

Boost :

From: David Greene (greened_at_[hidden])
Date: 2006-02-28 13:08:10

Since both I and Andreas are baffled by this problem, I thought I'd
forward this on to the larger Boost community. Anyone have any
ideas about it? It seems like it should be a simple thing but
something about the way lookup works in C++ is causing the
inner_context_type member of simple_state to be missed. The
problem persists even if

typedef typename sc::simple_state< NormalMode< Type >, Switch,
                                   Off<Type> >::inner_context_type

is added to the NormalMode class template.


attached mail follows:

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;
  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

Boost list run by bdawes at, gregod at, cpdaniel at, john at