aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/StdVector
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-08-21 12:16:37 -0400
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2009-08-21 12:16:37 -0400
commit2f0b4e1abc6b105434fcb85df2461a37a810172b (patch)
tree3701625374e6762f1fc0a7da6d2ad5763e96bc92 /Eigen/StdVector
parent72b002eab91cf058dfc667911db5e06cc1448a39 (diff)
fix compilation with gcc 4.1. Indeed the path for recent gcc doesn't work with gcc 4.1, and looking at the implementation of vector in g++ 4.1, it was exactly our fallback case, so use that.
Diffstat (limited to 'Eigen/StdVector')
-rw-r--r--Eigen/StdVector9
1 files changed, 5 insertions, 4 deletions
diff --git a/Eigen/StdVector b/Eigen/StdVector
index a7f39ea37..f37de5ff6 100644
--- a/Eigen/StdVector
+++ b/Eigen/StdVector
@@ -136,10 +136,8 @@ class vector<T,Eigen::aligned_allocator<T> >
{ return vector_base::insert(position,x); }
void insert(const_iterator position, size_type new_size, const value_type& x)
{ vector_base::insert(position, new_size, x); }
-#elif defined(_GLIBCXX_VECTOR) && EIGEN_GNUC_AT_LEAST(4,1)
+#elif defined(_GLIBCXX_VECTOR) && EIGEN_GNUC_AT_LEAST(4,2)
// workaround GCC std::vector implementation
- // Note that before gcc-4.1 we already have: std::vector::resize(size_type,const T&),
- // no no need to workaround !
void resize(size_type new_size, const value_type& x)
{
if (new_size < vector_base::size())
@@ -147,9 +145,12 @@ class vector<T,Eigen::aligned_allocator<T> >
else
vector_base::insert(vector_base::end(), new_size - vector_base::size(), x);
}
-#elif defined(_GLIBCXX_VECTOR)
+#elif defined(_GLIBCXX_VECTOR) && (!EIGEN_GNUC_AT_LEAST(4,1))
+ // Note that before gcc-4.1 we already have: std::vector::resize(size_type,const T&),
+ // no no need to workaround !
using vector_base::resize;
#else
+ // either GCC 4.1 or non-GCC
// default implementation which should always work.
void resize(size_type new_size, const value_type& x)
{