this should fix the linking issue with StdVector without any user

changes... I cross my fingers...
This commit is contained in:
Gael Guennebaud 2009-04-21 11:44:58 +00:00
parent 4efcc14b91
commit 5e5bac52d7

View File

@ -67,38 +67,40 @@ struct ei_has_aligned_operator_new {
namespace std { namespace std {
#define EIGEN_STD_VECTOR_SPECIALIZATION_BODY \ #define EIGEN_STD_VECTOR_SPECIALIZATION_BODY(VECTOR) \
public: \ public: \
typedef T value_type; \ typedef T value_type; \
typedef typename vector_base::allocator_type allocator_type; \ typedef typename vector_base::allocator_type allocator_type; \
typedef typename vector_base::size_type size_type; \ typedef typename vector_base::size_type size_type; \
typedef typename vector_base::iterator iterator; \ typedef typename vector_base::iterator iterator; \
explicit vector(const allocator_type& __a = allocator_type()) : vector_base(__a) {} \ explicit VECTOR(const allocator_type& __a = allocator_type()) : vector_base(__a) {} \
vector(const vector& c) : vector_base(c) {} \ VECTOR(const VECTOR& c) : vector_base(c) {} \
vector(size_type num, const value_type& val = value_type()) : vector_base(num, val) {} \ VECTOR(size_type num, const value_type& val = value_type()) : vector_base(num, val) {} \
vector(iterator start, iterator end) : vector_base(start, end) {} \ VECTOR(iterator start, iterator end) : vector_base(start, end) {} \
vector& operator=(const vector& __x) { \ VECTOR& operator=(const VECTOR& __x) { \
vector_base::operator=(__x); \ vector_base::operator=(__x); \
return *this; \ return *this; \
} }
template<typename T, template<typename T,
typename AllocT = std::allocator<T>, typename AllocT = std::allocator<T>,
bool HasAlignedNew = Eigen::ei_has_aligned_operator_new<T>::ret> bool HasAlignedNew = Eigen::ei_has_aligned_operator_new<T>::ret>
class vector : public std::std_vector<T,AllocT> class ei_vector : public std::std_vector<T,AllocT>
{ {
typedef std_vector<T, AllocT> vector_base; typedef std_vector<T, AllocT> vector_base;
EIGEN_STD_VECTOR_SPECIALIZATION_BODY EIGEN_STD_VECTOR_SPECIALIZATION_BODY(ei_vector)
}; };
template<typename T,typename DummyAlloc> template<typename T,typename DummyAlloc>
class vector<T,DummyAlloc,true> class ei_vector<T,DummyAlloc,true>
: public std::std_vector<_EIGEN_WORKAROUND_MSVC_STD_VECTOR(T), : public std::std_vector<_EIGEN_WORKAROUND_MSVC_STD_VECTOR(T),
Eigen::aligned_allocator<_EIGEN_WORKAROUND_MSVC_STD_VECTOR(T)> > Eigen::aligned_allocator<_EIGEN_WORKAROUND_MSVC_STD_VECTOR(T)> >
{ {
typedef std_vector<_EIGEN_WORKAROUND_MSVC_STD_VECTOR(T), typedef std_vector<_EIGEN_WORKAROUND_MSVC_STD_VECTOR(T),
Eigen::aligned_allocator<_EIGEN_WORKAROUND_MSVC_STD_VECTOR(T)> > vector_base; Eigen::aligned_allocator<_EIGEN_WORKAROUND_MSVC_STD_VECTOR(T)> > vector_base;
EIGEN_STD_VECTOR_SPECIALIZATION_BODY EIGEN_STD_VECTOR_SPECIALIZATION_BODY(ei_vector)
void resize(size_type __new_size) void resize(size_type __new_size)
{ resize(__new_size, T()); } { resize(__new_size, T()); }
@ -135,6 +137,14 @@ class vector<T,DummyAlloc,true>
}; };
template<typename T,
typename AllocT = std::allocator<T> >
class vector : public ei_vector<T,AllocT>
{
typedef ei_vector<T, AllocT> vector_base;
EIGEN_STD_VECTOR_SPECIALIZATION_BODY(vector)
};
} }
#endif // EIGEN_STDVECTOR_MODULE_H #endif // EIGEN_STDVECTOR_MODULE_H