mirror of
https://github.com/boostorg/multi_array.git
synced 2025-05-11 21:33:52 +00:00
New fix for MSVC regressions avoids problems with partial function
template ordering. [SVN r23638]
This commit is contained in:
parent
7b7b88e836
commit
6638f92b48
@ -157,6 +157,11 @@ public:
|
||||
// A multi_array is constructible from any multi_array_ref, subarray, or
|
||||
// array_view object. The following constructors ensure that.
|
||||
//
|
||||
|
||||
// Due to limited support for partial template ordering,
|
||||
// MSVC 6&7 confuse the following with the most basic ExtentList
|
||||
// constructor.
|
||||
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
template <typename OPtr>
|
||||
multi_array(const const_multi_array_ref<T,NumDims,OPtr>& rhs,
|
||||
const general_storage_order<NumDims>& so = c_storage_order())
|
||||
@ -167,6 +172,87 @@ public:
|
||||
std::copy(rhs.begin(),rhs.end(),this->begin());
|
||||
}
|
||||
|
||||
template <typename OPtr>
|
||||
multi_array(const detail::multi_array::
|
||||
const_sub_array<T,NumDims,OPtr>& rhs,
|
||||
const general_storage_order<NumDims>& so = c_storage_order())
|
||||
: super_type(0,so,rhs.index_bases(),rhs.shape())
|
||||
{
|
||||
allocate_space();
|
||||
std::copy(rhs.begin(),rhs.end(),this->begin());
|
||||
}
|
||||
|
||||
|
||||
template <typename OPtr>
|
||||
multi_array(const detail::multi_array::
|
||||
const_multi_array_view<T,NumDims,OPtr>& rhs,
|
||||
const general_storage_order<NumDims>& so = c_storage_order())
|
||||
: super_type(0,so,rhs.index_bases(),rhs.shape())
|
||||
{
|
||||
allocate_space();
|
||||
std::copy(rhs.begin(),rhs.end(),this->begin());
|
||||
}
|
||||
|
||||
#else // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
// Enumerate the cases for MSVC
|
||||
|
||||
multi_array(const const_multi_array_ref<T,NumDims,T*>& rhs,
|
||||
const general_storage_order<NumDims>& so = c_storage_order())
|
||||
: super_type(0,so,rhs.index_bases(),rhs.shape())
|
||||
{
|
||||
allocate_space();
|
||||
// Warning! storage order may change, hence the following copy technique.
|
||||
std::copy(rhs.begin(),rhs.end(),this->begin());
|
||||
}
|
||||
|
||||
multi_array(const const_multi_array_ref<T,NumDims,T const*>& rhs,
|
||||
const general_storage_order<NumDims>& so = c_storage_order())
|
||||
: super_type(0,so,rhs.index_bases(),rhs.shape())
|
||||
{
|
||||
allocate_space();
|
||||
// Warning! storage order may change, hence the following copy technique.
|
||||
std::copy(rhs.begin(),rhs.end(),this->begin());
|
||||
}
|
||||
|
||||
multi_array(const detail::multi_array::
|
||||
const_sub_array<T,NumDims,T*>& rhs,
|
||||
const general_storage_order<NumDims>& so = c_storage_order())
|
||||
: super_type(0,so,rhs.index_bases(),rhs.shape())
|
||||
{
|
||||
allocate_space();
|
||||
std::copy(rhs.begin(),rhs.end(),this->begin());
|
||||
}
|
||||
|
||||
multi_array(const detail::multi_array::
|
||||
const_sub_array<T,NumDims,T const*>& rhs,
|
||||
const general_storage_order<NumDims>& so = c_storage_order())
|
||||
: super_type(0,so,rhs.index_bases(),rhs.shape())
|
||||
{
|
||||
allocate_space();
|
||||
std::copy(rhs.begin(),rhs.end(),this->begin());
|
||||
}
|
||||
|
||||
|
||||
multi_array(const detail::multi_array::
|
||||
const_multi_array_view<T,NumDims,T*>& rhs,
|
||||
const general_storage_order<NumDims>& so = c_storage_order())
|
||||
: super_type(0,so,rhs.index_bases(),rhs.shape())
|
||||
{
|
||||
allocate_space();
|
||||
std::copy(rhs.begin(),rhs.end(),this->begin());
|
||||
}
|
||||
|
||||
multi_array(const detail::multi_array::
|
||||
const_multi_array_view<T,NumDims,T const*>& rhs,
|
||||
const general_storage_order<NumDims>& so = c_storage_order())
|
||||
: super_type(0,so,rhs.index_bases(),rhs.shape())
|
||||
{
|
||||
allocate_space();
|
||||
std::copy(rhs.begin(),rhs.end(),this->begin());
|
||||
}
|
||||
|
||||
#endif // !BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
|
||||
// This constructor is necessary because of more exact template matches.
|
||||
// enable-if?
|
||||
multi_array(const multi_array_ref<T,NumDims>& rhs,
|
||||
@ -179,16 +265,6 @@ public:
|
||||
}
|
||||
|
||||
|
||||
template <typename OPtr>
|
||||
multi_array(const detail::multi_array::
|
||||
const_sub_array<T,NumDims,OPtr>& rhs,
|
||||
const general_storage_order<NumDims>& so = c_storage_order())
|
||||
: super_type(0,so,rhs.index_bases(),rhs.shape())
|
||||
{
|
||||
allocate_space();
|
||||
std::copy(rhs.begin(),rhs.end(),this->begin());
|
||||
}
|
||||
|
||||
// This constructor is necessary because of more exact template matches.
|
||||
// enable-if?
|
||||
multi_array(const detail::multi_array::
|
||||
@ -200,16 +276,6 @@ public:
|
||||
std::copy(rhs.begin(),rhs.end(),this->begin());
|
||||
}
|
||||
|
||||
template <typename OPtr>
|
||||
multi_array(const detail::multi_array::
|
||||
const_multi_array_view<T,NumDims,OPtr>& rhs,
|
||||
const general_storage_order<NumDims>& so = c_storage_order())
|
||||
: super_type(0,so,rhs.index_bases(),rhs.shape())
|
||||
{
|
||||
allocate_space();
|
||||
std::copy(rhs.begin(),rhs.end(),this->begin());
|
||||
}
|
||||
|
||||
// This constructor is necessary because of more exact template matches.
|
||||
// enable-if?
|
||||
multi_array(const detail::multi_array::
|
||||
|
Loading…
x
Reference in New Issue
Block a user