diff --git a/include/boost/numeric/ublas/vector.hpp b/include/boost/numeric/ublas/vector.hpp index 65ba99c1..6fad05b4 100644 --- a/include/boost/numeric/ublas/vector.hpp +++ b/include/boost/numeric/ublas/vector.hpp @@ -39,6 +39,13 @@ namespace boost { namespace numeric { namespace ublas { // Thanks to Karl Meerbergen for the functor workaround which we use by default template struct resize_functor { + void operator() (A& a, typename A::size_type size, bool ) const { + a.resize (size, typename A::value_type (0)); + } + }; + // Specialise for storage_array + template + struct resize_functor > { void operator() (A& a, typename A::size_type size, bool preserve) const { if (preserve) a.resize (size, typename A::value_type (0)); @@ -47,14 +54,6 @@ namespace boost { namespace numeric { namespace ublas { } }; - // Specialise for std::vector - template - struct resize_functor > { - void operator() (std::vector& a, typename std::vector::size_type size, bool ) const { - a.resize (size); - } - }; - template BOOST_UBLAS_INLINE void resize (A& a, typename A::size_type size, bool preserve) { @@ -69,7 +68,7 @@ namespace boost { namespace numeric { namespace ublas { else a.resize_new (size); } - /* ISSUE Specialise for std::vector + /* ISSUE Specialise for std::vector ONLY * however some (MSVC-6/7) compilers without template partial specialization * also think this is ambiguous when std::vector is used! */