Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef EIGEN_STL_DETAILS_H
00027 #define EIGEN_STL_DETAILS_H
00028
00029 #ifndef EIGEN_ALIGNED_ALLOCATOR
00030 #define EIGEN_ALIGNED_ALLOCATOR Eigen::aligned_allocator
00031 #endif
00032
00033 namespace Eigen {
00034
00035
00036 template <class T>
00037 class aligned_allocator_indirection : public EIGEN_ALIGNED_ALLOCATOR<T>
00038 {
00039 public:
00040 typedef size_t size_type;
00041 typedef ptrdiff_t difference_type;
00042 typedef T* pointer;
00043 typedef const T* const_pointer;
00044 typedef T& reference;
00045 typedef const T& const_reference;
00046 typedef T value_type;
00047
00048 template<class U>
00049 struct rebind
00050 {
00051 typedef aligned_allocator_indirection<U> other;
00052 };
00053
00054 aligned_allocator_indirection() {}
00055 aligned_allocator_indirection(const aligned_allocator_indirection& ) : EIGEN_ALIGNED_ALLOCATOR<T>() {}
00056 aligned_allocator_indirection(const EIGEN_ALIGNED_ALLOCATOR<T>& ) {}
00057 template<class U>
00058 aligned_allocator_indirection(const aligned_allocator_indirection<U>& ) {}
00059 template<class U>
00060 aligned_allocator_indirection(const EIGEN_ALIGNED_ALLOCATOR<U>& ) {}
00061 ~aligned_allocator_indirection() {}
00062 };
00063
00064 #ifdef _MSC_VER
00065
00066
00067
00068
00069 #define EIGEN_WORKAROUND_MSVC_STL_SUPPORT(T) \
00070 typename Eigen::internal::conditional< \
00071 Eigen::internal::is_arithmetic<T>::value, \
00072 T, \
00073 Eigen::internal::workaround_msvc_stl_support<T> \
00074 >::type
00075
00076 namespace internal {
00077 template<typename T> struct workaround_msvc_stl_support : public T
00078 {
00079 inline workaround_msvc_stl_support() : T() {}
00080 inline workaround_msvc_stl_support(const T& other) : T(other) {}
00081 inline operator T& () { return *static_cast<T*>(this); }
00082 inline operator const T& () const { return *static_cast<const T*>(this); }
00083 template<typename OtherT>
00084 inline T& operator=(const OtherT& other)
00085 { T::operator=(other); return *this; }
00086 inline workaround_msvc_stl_support& operator=(const workaround_msvc_stl_support& other)
00087 { T::operator=(other); return *this; }
00088 };
00089 }
00090
00091 #else
00092
00093 #define EIGEN_WORKAROUND_MSVC_STL_SUPPORT(T) T
00094
00095 #endif
00096
00097 }
00098
00099 #endif // EIGEN_STL_DETAILS_H