Warning, file /include/eigen3/Eigen/src/StlSupport/StdList.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef EIGEN_STDLIST_H
0011 #define EIGEN_STDLIST_H
0012
0013 #include "details.h"
0014
0015
0016
0017
0018
0019
0020 #define EIGEN_DEFINE_STL_LIST_SPECIALIZATION(...) \
0021 namespace std \
0022 { \
0023 template<> \
0024 class list<__VA_ARGS__, std::allocator<__VA_ARGS__> > \
0025 : public list<__VA_ARGS__, EIGEN_ALIGNED_ALLOCATOR<__VA_ARGS__> > \
0026 { \
0027 typedef list<__VA_ARGS__, EIGEN_ALIGNED_ALLOCATOR<__VA_ARGS__> > list_base; \
0028 public: \
0029 typedef __VA_ARGS__ value_type; \
0030 typedef list_base::allocator_type allocator_type; \
0031 typedef list_base::size_type size_type; \
0032 typedef list_base::iterator iterator; \
0033 explicit list(const allocator_type& a = allocator_type()) : list_base(a) {} \
0034 template<typename InputIterator> \
0035 list(InputIterator first, InputIterator last, const allocator_type& a = allocator_type()) : list_base(first, last, a) {} \
0036 list(const list& c) : list_base(c) {} \
0037 explicit list(size_type num, const value_type& val = value_type()) : list_base(num, val) {} \
0038 list(iterator start_, iterator end_) : list_base(start_, end_) {} \
0039 list& operator=(const list& x) { \
0040 list_base::operator=(x); \
0041 return *this; \
0042 } \
0043 }; \
0044 }
0045
0046
0047 #if !EIGEN_HAS_CXX11_CONTAINERS && !(defined(_GLIBCXX_LIST) && (!EIGEN_GNUC_AT_LEAST(4,1)))
0048
0049 namespace std
0050 {
0051
0052 #define EIGEN_STD_LIST_SPECIALIZATION_BODY \
0053 public: \
0054 typedef T value_type; \
0055 typedef typename list_base::allocator_type allocator_type; \
0056 typedef typename list_base::size_type size_type; \
0057 typedef typename list_base::iterator iterator; \
0058 typedef typename list_base::const_iterator const_iterator; \
0059 explicit list(const allocator_type& a = allocator_type()) : list_base(a) {} \
0060 template<typename InputIterator> \
0061 list(InputIterator first, InputIterator last, const allocator_type& a = allocator_type()) \
0062 : list_base(first, last, a) {} \
0063 list(const list& c) : list_base(c) {} \
0064 explicit list(size_type num, const value_type& val = value_type()) : list_base(num, val) {} \
0065 list(iterator start_, iterator end_) : list_base(start_, end_) {} \
0066 list& operator=(const list& x) { \
0067 list_base::operator=(x); \
0068 return *this; \
0069 }
0070
0071 template<typename T>
0072 class list<T,EIGEN_ALIGNED_ALLOCATOR<T> >
0073 : public list<EIGEN_WORKAROUND_MSVC_STL_SUPPORT(T),
0074 Eigen::aligned_allocator_indirection<EIGEN_WORKAROUND_MSVC_STL_SUPPORT(T)> >
0075 {
0076 typedef list<EIGEN_WORKAROUND_MSVC_STL_SUPPORT(T),
0077 Eigen::aligned_allocator_indirection<EIGEN_WORKAROUND_MSVC_STL_SUPPORT(T)> > list_base;
0078 EIGEN_STD_LIST_SPECIALIZATION_BODY
0079
0080 void resize(size_type new_size)
0081 { resize(new_size, T()); }
0082
0083 void resize(size_type new_size, const value_type& x)
0084 {
0085 if (list_base::size() < new_size)
0086 list_base::insert(list_base::end(), new_size - list_base::size(), x);
0087 else
0088 while (new_size < list_base::size()) list_base::pop_back();
0089 }
0090
0091 #if defined(_LIST_)
0092
0093 void push_back(const value_type& x)
0094 { list_base::push_back(x); }
0095 using list_base::insert;
0096 iterator insert(const_iterator position, const value_type& x)
0097 { return list_base::insert(position,x); }
0098 void insert(const_iterator position, size_type new_size, const value_type& x)
0099 { list_base::insert(position, new_size, x); }
0100 #endif
0101 };
0102 }
0103
0104 #endif
0105
0106 #endif