25 #ifndef EIGEN_STDLIST_H
26 #define EIGEN_STDLIST_H
31 #if defined(__INTEL_COMPILER) || defined(__GNUC__)
32 #define EIGEN_EXPLICIT_STL_LIST_INSTANTIATION(...) template class std::list<__VA_ARGS__, EIGEN_ALIGNED_ALLOCATOR<__VA_ARGS__> >;
34 #define EIGEN_EXPLICIT_STL_LIST_INSTANTIATION(...)
42 #define EIGEN_DEFINE_STL_LIST_SPECIALIZATION(...) \
43 EIGEN_EXPLICIT_STL_LIST_INSTANTIATION(__VA_ARGS__) \
46 template<typename _Ay> \
47 class list<__VA_ARGS__, _Ay> \
48 : public list<__VA_ARGS__, EIGEN_ALIGNED_ALLOCATOR<__VA_ARGS__> > \
50 typedef list<__VA_ARGS__, EIGEN_ALIGNED_ALLOCATOR<__VA_ARGS__> > list_base; \
52 typedef __VA_ARGS__ value_type; \
53 typedef typename list_base::allocator_type allocator_type; \
54 typedef typename list_base::size_type size_type; \
55 typedef typename list_base::iterator iterator; \
56 explicit list(const allocator_type& a = allocator_type()) : list_base(a) {} \
57 template<typename InputIterator> \
58 list(InputIterator first, InputIterator last, const allocator_type& a = allocator_type()) : list_base(first, last, a) {} \
59 list(const list& c) : list_base(c) {} \
60 explicit list(size_type num, const value_type& val = value_type()) : list_base(num, val) {} \
61 list(iterator start, iterator end) : list_base(start, end) {} \
62 list& operator=(const list& x) { \
63 list_base::operator=(x); \
70 #if !(defined(_GLIBCXX_VECTOR) && (!EIGEN_GNUC_AT_LEAST(4,1)))
75 #define EIGEN_STD_LIST_SPECIALIZATION_BODY \
77 typedef T value_type; \
78 typedef typename list_base::allocator_type allocator_type; \
79 typedef typename list_base::size_type size_type; \
80 typedef typename list_base::iterator iterator; \
81 typedef typename list_base::const_iterator const_iterator; \
82 explicit list(const allocator_type& a = allocator_type()) : list_base(a) {} \
83 template<typename InputIterator> \
84 list(InputIterator first, InputIterator last, const allocator_type& a = allocator_type()) \
85 : list_base(first, last, a) {} \
86 list(const list& c) : list_base(c) {} \
87 explicit list(size_type num, const value_type& val = value_type()) : list_base(num, val) {} \
88 list(iterator start, iterator end) : list_base(start, end) {} \
89 list& operator=(const list& x) { \
90 list_base::operator=(x); \
96 :
public list<EIGEN_WORKAROUND_MSVC_STL_SUPPORT(T),
97 Eigen::aligned_allocator_indirection<EIGEN_WORKAROUND_MSVC_STL_SUPPORT(T)> >
103 void resize(size_type new_size)
104 { resize(new_size, T()); }
106 void resize(size_type new_size,
const value_type& x)
108 if (list_base::size() < new_size)
109 list_base::insert(list_base::end(), new_size - list_base::size(), x);
111 while (new_size < list_base::size()) list_base::pop_back();
116 void push_back(
const value_type& x)
117 { list_base::push_back(x); }
118 using list_base::insert;
119 iterator insert(const_iterator position,
const value_type& x)
120 {
return list_base::insert(position,x); }
121 void insert(const_iterator position, size_type new_size,
const value_type& x)
122 { list_base::insert(position, new_size, x); }
127 #endif // check whether specialization is actually required
129 #endif // EIGEN_STDLIST_H