【发布时间】:2011-03-07 01:29:37
【问题描述】:
为什么会出现这个错误:
#include <vector>
typedef double point[2];
int main()
{
std::vector<point> x;
}
/usr/include/c++/4.3/bits/stl_construct.h:在函数“void std::_Destroy(_Tp*) [with _Tp = double [2]]”中:
/usr/include/c++/4.3/bits/stl_construct.h:103:从'void std::_Destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = double (*)[2]]'实例化
/usr/include/c++/4.3/bits/stl_construct.h:128: 从 'void std::_Destroy(_ForwardIterator, _ForwardIterator, std::allocator&) [with _ForwardIterator = double (*)[2], _Tp = double [2]]'
/usr/include/c++/4.3/bits/stl_vector.h:300:从“std::vector::~vector() [with _Tp = double [2], _Alloc = std::allocator]”实例化
prova.cpp:8:从这里实例化
/usr/include/c++/4.3/bits/stl_construct.h:88: 错误:在‘* __pointer’中请求成员‘~double [2]’,它是非类类型‘double [2]’
如何解决?
【问题讨论】: