Boost logo

Boost :

From: Oliver.Kowalke_at_[hidden]
Date: 2006-03-10 02:27:14


Hello,
I get another error if I use templated states (gcc-3.4.6).
'simple_state.hpp:403: error: no type named inner_context_type in struct
proto<int>'
Instantiation of state_machine:: initiate() causes the error.

with regards,
Oliver

#include <iostream>
#include <stdexcept>

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

namespace sc = boost::statechart;

template< typename S >
struct proto;

template< typename S >
struct sm
: public sc::state_machine<
        sm< S >,
        proto< S >
>
{};

template< typename S > struct inactive;

template< typename S >
struct proto
: public sc::simple_state<
        proto< S >,
        sm< S >,
        inactive< S >
>
{};

template< typename S >
struct inactive
: public sc::simple_state<
        inactive< S >,
        proto< S >
>
{};

int main()
{
        try
        {
                sm< int > fsm;
                fsm.initiate(); // <<== causes compiler error
                
                return 0;
        }
        catch ( std::runtime_error const& e)
        { std::cerr << e.what() << std::endl; }
        catch (...)
        { std::cerr << "unhandled exception" << std::endl; }
        
        return -1;
}


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk