mercredi 27 mai 2015

std::vector of std::tuples leads to unknown size

I want to store three arbitrary ints inside a std::vector without defining a struct/class. So I went for std::tuple<>:

std::vector<std::tuple<unsigned int, unsigned int, unsigned int> 

Using MS VS 2013, it leads to the following error:

>c:\program files (x86)\microsoft visual studio 12.0\vc\include\vector(1628): error C2036: 'std::tuple<unsigned int,unsigned int,unsigned int> *' : unknown size
1>          c:\program files (x86)\microsoft visual studio 12.0\vc\include\vector(1622) : while compiling class template member function 'void std::vector<std::tuple<unsigned int,unsigned int,unsigned int>,std::allocator<_Ty>>::_Tidy(void)'
1>          with
1>          [
1>              _Ty=std::tuple<unsigned int,unsigned int,unsigned int>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 12.0\vc\include\vector(945) : see reference to function template instantiation 'void std::vector<std::tuple<unsigned int,unsigned int,unsigned int>,std::allocator<_Ty>>::_Tidy(void)' being compiled
1>          with
1>          [
1>              _Ty=std::tuple<unsigned int,unsigned int,unsigned int>
1>          ]
1>          d:\projects\gl33\src\nvf.cpp(39) : see reference to class template instantiation 'std::vector<std::tuple<unsigned int,unsigned int,unsigned int>,std::allocator<_Ty>>' being compiled
1>          with
1>          [
1>              _Ty=std::tuple<unsigned int,unsigned int,unsigned int>
1>          ]
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped =======

Is this due to limitations in the MSVS2013 compiler? Or am I doing something wrong?

Aucun commentaire:

Enregistrer un commentaire