Boost logo

Boost :

From: Oliver.Kowalke_at_[hidden]
Date: 2006-12-04 04:14:57


Hello,
If I try to compile my application with gcc-4.1.2 I get following
errors:

/home/kowalke/Projects/test_statechart/src/test_statechart.cpp:25:
instantiated from here
/opt/boost/include/boost-1_33_1/boost/detail/allocator_utilities.hpp:141
: error: no class template named 'rebind' in 'struct M'

The same code works with gcc-3.4.

Regards,
Oliver

#include <iostream>
#include <cstdlib>
#include <stdexcept>

#include <boost/mpl/list.hpp>
#include <boost/statechart/custom_reaction.hpp>
#include <boost/statechart/event.hpp>
#include <boost/statechart/state.hpp>
#include <boost/statechart/state_machine.hpp>
#include <boost/statechart/transition.hpp>

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

struct A;

struct M : public sc::state_machine< M, A >
{
        void unconsumed_event( sc::event_base const& ev)
        {
                state_iterator i = state_begin();
                state_iterator e = state_end();

                if ( i != e)
                        throw
std::runtime_error(ev.custom_dynamic_type_ptr< char >() + " passed to "
+ i->custom_dynamic_type_ptr< char >());
// terminate();
        }
};

struct A : public sc::simple_state< A, M >
{};

int main( int argc, char *argv[])
{
        try
        {
                M m;
                m.initiate();
                return EXIT_SUCCESS;
        }
        catch ( std::exception const& e)
        { std::cerr << e.what() << std::endl; }
        catch ( ... )
        { std::cerr << "unhandled exception" << std::endl; }

        return EXIT_FAILURE;
}


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