fatal error C1063: compiler limit : compiler stack overflow
下面这段函数在VC6.0下编译没问题,但是在VS2010下却在红色部分处断开,各位大侠请指教一下!
#ifndef cvec_hpp
#define cvec_hpp
#include <vector>
//using namespace std; // so "vector" below is actually "std::vector", etc.
template<class T> class cvec : public std::vector<T>
{
public: // type names like iterator are also inherited
typedef typename cvec::size_type size_type;
typedef typename cvec::iterator iterator;
typedef typename cvec::difference_type difference_type;
typedef typename cvec::reference reference;
typedef typename cvec::const_reference const_reference;
cvec() {}
cvec(size_type n, const T& value = T()){ std::vector<T>(n, value); }
cvec(iterator i, iterator j){ std::vector<T>(i, j); }
reference operator[](difference_type i)
{
DASSERT(i >=0 && i < static_cast<difference_type>(this->size()));
return vector<T>::operator[](i);
}
const_reference operator[](difference_type i) const
{
DASSERT(i >=0 && i < static_cast<difference_type>(this->size()));
return vector<T>::operator[](i);
}
};
#endif // cvec_hpppp