2
0
mirror of https://github.com/boostorg/ublas.git synced 2026-02-24 04:22:12 +00:00

quick fix for VC6 mapped_type problem

svn path=/trunk/boost/boost/numeric/ublas/; revision=25176
This commit is contained in:
Michael Stevens
2004-09-17 15:58:33 +00:00
parent d5086a016c
commit 456ecbcab1
3 changed files with 14 additions and 7 deletions

View File

@@ -240,7 +240,7 @@ namespace boost { namespace numeric { namespace ublas {
typedef A array_type;
typedef const T &const_reference;
#ifndef BOOST_UBLAS_STRICT_MATRIX_SPARSE
typedef BOOST_UBLAS_TYPENAME detail::map_traits<A>::reference reference;
typedef BOOST_UBLAS_TYPENAME detail::map_traits<A, T>::reference reference;
#else
typedef sparse_matrix_element<sparse_matrix<T, F, A> > reference;
#endif
@@ -1295,7 +1295,7 @@ namespace boost { namespace numeric { namespace ublas {
typedef T value_type;
typedef const T &const_reference;
#ifndef BOOST_UBLAS_STRICT_MATRIX_SPARSE
typedef typename detail::map_traits<typename A::data_value_type>::reference reference;
typedef typename detail::map_traits<typename A::data_value_type, T>::reference reference;
#else
typedef sparse_matrix_element<sparse_vector_of_sparse_vector<T, F, A> > reference;
#endif

View File

@@ -562,17 +562,24 @@ namespace boost { namespace numeric { namespace ublas {
};
namespace detail {
template<class A>
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template<class A, class T>
struct map_traits {
typedef BOOST_UBLAS_TYPENAME A::mapped_type &reference;
};
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template<class I, class T, class ALLOC>
struct map_traits<map_array<I, T, ALLOC> > {
struct map_traits<map_array<I, T, ALLOC>, T > {
typedef typename map_array<I, T, ALLOC>::data_reference reference;
};
#elif defined (BOOST_UBLAS_STRICT_MAP_ARRAY)
#else
#if defined (BOOST_UBLAS_STRICT_MAP_ARRAY)
#error BOOST_UBLAS_STRICT_MAP_ARRAY require partial template speciazation
#endif
// ISSUE: T is actually only required for VC6 as it can't find mapped_type
template<class A, class T>
struct map_traits {
typedef T &reference;
};
#endif
// reserve helpers for map_array and generic maps

View File

@@ -235,7 +235,7 @@ namespace boost { namespace numeric { namespace ublas {
typedef A array_type;
typedef const value_type &const_reference;
#ifndef BOOST_UBLAS_STRICT_VECTOR_SPARSE
typedef BOOST_UBLAS_TYPENAME detail::map_traits<A>::reference reference;
typedef BOOST_UBLAS_TYPENAME detail::map_traits<A,T>::reference reference;
#else
typedef sparse_vector_element<sparse_vector<T, A> > reference;
#endif