diff --git a/include/boost/numeric/ublas/storage.hpp b/include/boost/numeric/ublas/storage.hpp index 37959b79..c23c4739 100644 --- a/include/boost/numeric/ublas/storage.hpp +++ b/include/boost/numeric/ublas/storage.hpp @@ -1776,10 +1776,12 @@ namespace boost { namespace numeric { namespace ublas { bool compare(const self_type& rhs) const { return (v1_ < rhs.v1_); } +#ifndef BOOST_UBLAS_NO_MEMBER_FRIENDS BOOST_UBLAS_INLINE friend bool operator < (const self_type& lhs, const self_type& rhs) { return lhs.compare(rhs); } +#endif private: size_type i_; @@ -1787,6 +1789,20 @@ namespace boost { namespace numeric { namespace ublas { typename V::value2_type v2_; }; +#ifdef BOOST_UBLAS_NO_MEMBER_FRIENDS + template + BOOST_UBLAS_INLINE + void swap(index_pair lhs, index_pair rhs) { + lhs.swap(rhs); + } + + template + BOOST_UBLAS_INLINE + bool operator < (const index_pair& lhs, const index_pair& rhs) { + return lhs.compare(rhs); + } +#endif + template class index_pair_array: private boost::noncopyable { @@ -1912,10 +1928,12 @@ namespace boost { namespace numeric { namespace ublas { return ((v1_ < rhs.v1_) || (v1_ == rhs.v1_ && v2_ < rhs.v2_)); } +#ifndef BOOST_UBLAS_NO_MEMBER_FRIENDS BOOST_UBLAS_INLINE friend bool operator < (const self_type& lhs, const self_type& rhs) { return lhs.compare(rhs); } +#endif private: size_type i_; @@ -1924,6 +1942,20 @@ namespace boost { namespace numeric { namespace ublas { typename M::value3_type v3_; }; +#ifdef BOOST_UBLAS_NO_MEMBER_FRIENDS + template + BOOST_UBLAS_INLINE + void swap(index_triple lhs, index_triple rhs) { + lhs.swap(rhs); + } + + template + BOOST_UBLAS_INLINE + bool operator < (const index_triple& lhs, const index_triple& rhs) { + return lhs.compare(rhs); + } +#endif + template class index_triple_array: private boost::noncopyable {