vector<float[3]> macht Probleme



  • Also ich habe einen Typ

    typedef tVector3d float[3];
    

    und einen Vektor

    vector<tVector3d> data;
    

    wenn ich jetzt etwas in der Richtung tue

    tVector3d t;
      ...
      data.push_back(t);
    

    Bekomme ich vom Compiler diese Meldung:

    C:/Dev-Cpp/include/c++/3.4.2/bits/stl_construct.h: In function `void std::_Construct(_T1*, const _T2&) [with _T1 = float[3], _T2 = float[3]]':

    C:/Dev-Cpp/include/c++/3.4.2/bits/stl_vector.h:560: instantiated from `void std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = float[3], _Alloc = std::allocator<float[3]>]'
    cmyobj.cpp:25: instantiated from here
    C:/Dev-Cpp/include/c++/3.4.2/bits/stl_construct.h:81: error: ISO C++ forbids initialization in array new

    kann mir jemand erklären, warum und wie ich dann trotzdem zu meinem Array komme?



  • Ne das ist kein Typ!



  • hmm..
    Wenn du das sagst. ist natürlich einleuchtend..



  • struct...


Anmelden zum Antworten