diff --git a/include/boost/numeric/ublas/matrix.hpp b/include/boost/numeric/ublas/matrix.hpp index 300a531a..ed940c22 100644 --- a/include/boost/numeric/ublas/matrix.hpp +++ b/include/boost/numeric/ublas/matrix.hpp @@ -43,6 +43,7 @@ namespace boost { namespace numeric { namespace ublas { typedef T &reference; typedef A array_type; private: + typedef T *pointer; typedef F functor_type; typedef const matrix const_self_type; typedef matrix self_type; @@ -148,6 +149,7 @@ namespace boost { namespace numeric { namespace ublas { data () = m.data (); return *this; } +#ifndef BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS template // Generic matrix assignment without temporary BOOST_UBLAS_INLINE matrix &operator = (const matrix &m) { @@ -155,6 +157,7 @@ namespace boost { namespace numeric { namespace ublas { assign (m); return *this; } +#endif BOOST_UBLAS_INLINE matrix &assign_temporary (matrix &m) { swap (m); @@ -338,7 +341,7 @@ namespace boost { namespace numeric { namespace ublas { typedef typename matrix::value_type value_type; typedef typename matrix::difference_type difference_type; typedef typename matrix::const_reference reference; - typedef const typename matrix::value_type *pointer; + typedef const typename matrix::pointer pointer; #endif typedef const_iterator2 dual_iterator_type; typedef const_reverse_iterator2 dual_reverse_iterator_type; @@ -481,7 +484,7 @@ namespace boost { namespace numeric { namespace ublas { typedef typename matrix::value_type value_type; typedef typename matrix::difference_type difference_type; typedef typename matrix::reference reference; - typedef typename matrix::value_type *pointer; + typedef typename matrix::pointer pointer; #endif typedef iterator2 dual_iterator_type; typedef reverse_iterator2 dual_reverse_iterator_type; @@ -623,7 +626,7 @@ namespace boost { namespace numeric { namespace ublas { typedef typename matrix::value_type value_type; typedef typename matrix::difference_type difference_type; typedef typename matrix::const_reference reference; - typedef const typename matrix::value_type *pointer; + typedef const typename matrix::pointer pointer; #endif typedef const_iterator1 dual_iterator_type; typedef const_reverse_iterator1 dual_reverse_iterator_type; @@ -766,7 +769,7 @@ namespace boost { namespace numeric { namespace ublas { typedef typename matrix::value_type value_type; typedef typename matrix::difference_type difference_type; typedef typename matrix::reference reference; - typedef typename matrix::value_type *pointer; + typedef typename matrix::pointer pointer; #endif typedef iterator1 dual_iterator_type; typedef reverse_iterator1 dual_reverse_iterator_type; @@ -975,12 +978,14 @@ namespace boost { namespace numeric { namespace ublas { matrix_type::operator = (m); return *this; } +#ifdef BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS template // Generic matrix assignment BOOST_UBLAS_INLINE bounded_matrix &operator = (const matrix &m) { matrix_type::operator = (m); return *this; } +#endif template BOOST_UBLAS_INLINE bounded_matrix &operator = (const matrix_expression &ae) { @@ -1004,6 +1009,7 @@ namespace boost { namespace numeric { namespace ublas { typedef T &reference; typedef A array_type; private: + typedef T *pointer; typedef F functor_type; typedef const vector_of_vector const_self_type; typedef vector_of_vector self_type; @@ -1275,7 +1281,7 @@ namespace boost { namespace numeric { namespace ublas { typedef typename vector_of_vector::value_type value_type; typedef typename vector_of_vector::difference_type difference_type; typedef typename vector_of_vector::const_reference reference; - typedef const typename vector_of_vector::value_type *pointer; + typedef const typename vector_of_vector::pointer pointer; #endif typedef const_iterator2 dual_iterator_type; typedef const_reverse_iterator2 dual_reverse_iterator_type; @@ -1435,7 +1441,7 @@ namespace boost { namespace numeric { namespace ublas { typedef typename vector_of_vector::value_type value_type; typedef typename vector_of_vector::difference_type difference_type; typedef typename vector_of_vector::reference reference; - typedef typename vector_of_vector::value_type *pointer; + typedef typename vector_of_vector::pointer pointer; #endif typedef iterator2 dual_iterator_type; typedef reverse_iterator2 dual_reverse_iterator_type; @@ -1594,7 +1600,7 @@ namespace boost { namespace numeric { namespace ublas { typedef typename vector_of_vector::value_type value_type; typedef typename vector_of_vector::difference_type difference_type; typedef typename vector_of_vector::const_reference reference; - typedef const typename vector_of_vector::value_type *pointer; + typedef const typename vector_of_vector::pointer pointer; #endif typedef const_iterator1 dual_iterator_type; typedef const_reverse_iterator1 dual_reverse_iterator_type; @@ -1754,7 +1760,7 @@ namespace boost { namespace numeric { namespace ublas { typedef typename vector_of_vector::value_type value_type; typedef typename vector_of_vector::difference_type difference_type; typedef typename vector_of_vector::reference reference; - typedef typename vector_of_vector::value_type *pointer; + typedef typename vector_of_vector::pointer pointer; #endif typedef iterator1 dual_iterator_type; typedef reverse_iterator1 dual_reverse_iterator_type; @@ -1958,6 +1964,7 @@ namespace boost { namespace numeric { namespace ublas { typedef const T &const_reference; typedef T &reference; private: + typedef const T *const_pointer; typedef const identity_matrix const_self_type; typedef identity_matrix self_type; public: @@ -2102,7 +2109,7 @@ namespace boost { namespace numeric { namespace ublas { typedef typename identity_matrix::value_type value_type; typedef typename identity_matrix::difference_type difference_type; typedef typename identity_matrix::const_reference reference; - typedef const typename identity_matrix::value_type *pointer; + typedef typename identity_matrix::const_pointer pointer; #endif typedef const_iterator2 dual_iterator_type; typedef const_reverse_iterator2 dual_reverse_iterator_type; @@ -2247,7 +2254,7 @@ namespace boost { namespace numeric { namespace ublas { typedef typename identity_matrix::value_type value_type; typedef typename identity_matrix::difference_type difference_type; typedef typename identity_matrix::const_reference reference; - typedef const typename identity_matrix::value_type *pointer; + typedef typename identity_matrix::const_pointer pointer; #endif typedef const_iterator1 dual_iterator_type; typedef const_reverse_iterator1 dual_reverse_iterator_type; @@ -2433,6 +2440,7 @@ namespace boost { namespace numeric { namespace ublas { typedef const T &const_reference; typedef T &reference; private: + typedef const T *const_pointer; typedef const zero_matrix const_self_type; typedef zero_matrix self_type; public: @@ -2569,7 +2577,7 @@ namespace boost { namespace numeric { namespace ublas { typedef typename zero_matrix::value_type value_type; typedef typename zero_matrix::difference_type difference_type; typedef typename zero_matrix::const_reference reference; - typedef const typename zero_matrix::value_type *pointer; + typedef typename zero_matrix::const_pointer pointer; #endif typedef const_iterator2 dual_iterator_type; typedef const_reverse_iterator2 dual_reverse_iterator_type; @@ -2708,7 +2716,7 @@ namespace boost { namespace numeric { namespace ublas { typedef typename zero_matrix::value_type value_type; typedef typename zero_matrix::difference_type difference_type; typedef typename zero_matrix::const_reference reference; - typedef const typename zero_matrix::value_type *pointer; + typedef typename zero_matrix::const_pointer pointer; #endif typedef const_iterator1 dual_iterator_type; typedef const_reverse_iterator1 dual_reverse_iterator_type; @@ -2887,6 +2895,7 @@ namespace boost { namespace numeric { namespace ublas { typedef const T &const_reference; typedef T &reference; private: + typedef const T *const_pointer; typedef const scalar_matrix const_self_type; typedef scalar_matrix self_type; public: @@ -3012,7 +3021,7 @@ namespace boost { namespace numeric { namespace ublas { typedef typename scalar_matrix::value_type value_type; typedef typename scalar_matrix::difference_type difference_type; typedef typename scalar_matrix::const_reference reference; - typedef const typename scalar_matrix::value_type *pointer; + typedef typename scalar_matrix::const_pointer pointer; #endif typedef const_iterator2 dual_iterator_type; typedef const_reverse_iterator2 dual_reverse_iterator_type; @@ -3157,7 +3166,7 @@ namespace boost { namespace numeric { namespace ublas { typedef typename scalar_matrix::value_type value_type; typedef typename scalar_matrix::difference_type difference_type; typedef typename scalar_matrix::const_reference reference; - typedef const typename scalar_matrix::value_type *pointer; + typedef typename scalar_matrix::const_pointer pointer; #endif typedef const_iterator1 dual_iterator_type; typedef const_reverse_iterator1 dual_reverse_iterator_type; @@ -3553,8 +3562,8 @@ namespace boost { namespace numeric { namespace ublas { // Iterator types private: // Use pointers for iterator - typedef const T *const_iterator_type; - typedef T *iterator_type; + typedef const_pointer const_iterator_type; + typedef pointer iterator_type; public: #ifdef BOOST_UBLAS_USE_INDEXED_ITERATOR diff --git a/include/boost/numeric/ublas/vector.hpp b/include/boost/numeric/ublas/vector.hpp index 740b0a99..50fef5e9 100644 --- a/include/boost/numeric/ublas/vector.hpp +++ b/include/boost/numeric/ublas/vector.hpp @@ -90,7 +90,6 @@ namespace boost { namespace numeric { namespace ublas { typedef T &reference; typedef A array_type; private: - typedef const T *const_pointer; typedef T *pointer; typedef const vector const_self_type; typedef vector self_type; @@ -175,6 +174,7 @@ namespace boost { namespace numeric { namespace ublas { data () = v.data (); return *this; } +#ifndef BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS template // Generic vector assignment without temporary BOOST_UBLAS_INLINE vector &operator = (const vector &v) { @@ -182,6 +182,7 @@ namespace boost { namespace numeric { namespace ublas { assign (v); return *this; } +#endif BOOST_UBLAS_INLINE vector &assign_temporary (vector &v) { swap (v); @@ -333,7 +334,7 @@ namespace boost { namespace numeric { namespace ublas { typedef typename vector::difference_type difference_type; typedef typename vector::value_type value_type; typedef typename vector::const_reference reference; - typedef typename vector::const_pointer pointer; + typedef const typename vector::pointer pointer; #endif // Construction and destruction @@ -581,10 +582,12 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_INLINE bounded_vector (const bounded_vector &v): vector_type (v) {} +#ifndef BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS template // Allow vector construction BOOST_UBLAS_INLINE bounded_vector (const vector &v): vector_type (v) {} +#endif template BOOST_UBLAS_INLINE bounded_vector (const vector_expression &ae): @@ -627,7 +630,6 @@ namespace boost { namespace numeric { namespace ublas { typedef T &reference; private: typedef const T *const_pointer; - typedef T *pointer; typedef const unit_vector const_self_type; typedef unit_vector self_type; public: @@ -885,7 +887,6 @@ namespace boost { namespace numeric { namespace ublas { typedef T &reference; private: typedef const T *const_pointer; - typedef T *pointer; typedef const zero_vector const_self_type; typedef zero_vector self_type; public: @@ -1098,7 +1099,6 @@ namespace boost { namespace numeric { namespace ublas { typedef T &reference; private: typedef const T *const_pointer; - typedef T *pointer; typedef const scalar_vector const_self_type; typedef scalar_vector self_type; public: @@ -1529,8 +1529,8 @@ namespace boost { namespace numeric { namespace ublas { // Iterator types private: // Use pointers for iterator - typedef const T *const_iterator_type; - typedef T *iterator_type; + typedef const_pointer const_iterator_type; + typedef pointer iterator_type; public: #ifdef BOOST_UBLAS_USE_INDEXED_ITERATOR