From 2f0b4e1abc6b105434fcb85df2461a37a810172b Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Fri, 21 Aug 2009 12:16:37 -0400 Subject: 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. --- Eigen/StdVector | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Eigen/StdVector') diff --git a/Eigen/StdVector b/Eigen/StdVector index a7f39ea37..f37de5ff6 100644 --- a/Eigen/StdVector +++ b/Eigen/StdVector @@ -136,10 +136,8 @@ class vector > { 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 > 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) { -- cgit v1.2.3