Ärger mit typedef



  • Hallo!

    Hier ein Beispiel aus dem Boost-Tutorial, das funktioniert:

    // Create a 3D array that is 3 x 4 x 2
      typedef boost::multi_array<double, 3> array_type;
      typedef array_type::index index;
    

    ...

    Und hier, wie ich es gerne hätte:

    template<class T_STATE,class T_EVENT>
    class FSM
    {
        typedef T_EVENT (*pFunc)();
        typedef boost::multi_array<pFunc ,2> array_type;
        typedef array_type::index index;
    

    Die letzte Zeile macht beim Compilieren aber Ärger:

    FSM.h:10: error: type ‘boost::multi_array<T_EVENT (*)(), 2u, std::allocator<T_EVENT (*)()> >’ is not derived from type ‘FSM<T_STATE, T_EVENT>’
    FSM.h:10: error: expected ‘;’ before ‘index’
    

    Ideen, was ich falsch mache?

    Danke, lg
    bts





  • krümelkacker schrieb:

    typename

    Was gelernt, danke!

    lg


Anmelden zum Antworten