mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-10 23:21:47 +08:00
fix bug #262: Compilation error of stdvector_overload test with GCC 4.6
Now our aligned allocator is automatically activatived only when the user did not specified an allocator (or specified the default std::allocator). (transplanted from b85c89c313a79fa68b3e27c64247437f51a3657e )
This commit is contained in:
parent
b2d10249b4
commit
55149df4e8
@ -28,24 +28,16 @@
|
|||||||
|
|
||||||
#include "Eigen/src/StlSupport/details.h"
|
#include "Eigen/src/StlSupport/details.h"
|
||||||
|
|
||||||
// Define the explicit instantiation (e.g. necessary for the Intel compiler)
|
|
||||||
#if defined(__INTEL_COMPILER) || defined(__GNUC__)
|
|
||||||
#define EIGEN_EXPLICIT_STL_VECTOR_INSTANTIATION(...) template class std::vector<__VA_ARGS__, EIGEN_ALIGNED_ALLOCATOR<__VA_ARGS__> >;
|
|
||||||
#else
|
|
||||||
#define EIGEN_EXPLICIT_STL_VECTOR_INSTANTIATION(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This section contains a convenience MACRO which allows an easy specialization of
|
* This section contains a convenience MACRO which allows an easy specialization of
|
||||||
* std::vector such that for data types with alignment issues the correct allocator
|
* std::vector such that for data types with alignment issues the correct allocator
|
||||||
* is used automatically.
|
* is used automatically.
|
||||||
*/
|
*/
|
||||||
#define EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(...) \
|
#define EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(...) \
|
||||||
EIGEN_EXPLICIT_STL_VECTOR_INSTANTIATION(__VA_ARGS__) \
|
|
||||||
namespace std \
|
namespace std \
|
||||||
{ \
|
{ \
|
||||||
template<typename _Ay> \
|
template<> \
|
||||||
class vector<__VA_ARGS__, _Ay> \
|
class vector<__VA_ARGS__, std::allocator<__VA_ARGS__> > \
|
||||||
: public vector<__VA_ARGS__, EIGEN_ALIGNED_ALLOCATOR<__VA_ARGS__> > \
|
: public vector<__VA_ARGS__, EIGEN_ALIGNED_ALLOCATOR<__VA_ARGS__> > \
|
||||||
{ \
|
{ \
|
||||||
typedef vector<__VA_ARGS__, EIGEN_ALIGNED_ALLOCATOR<__VA_ARGS__> > vector_base; \
|
typedef vector<__VA_ARGS__, EIGEN_ALIGNED_ALLOCATOR<__VA_ARGS__> > vector_base; \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user