Changed a constructor of tockArrayView in the C++CSP support header, so that retyping conversions are more distinct from same-type constructors

This commit is contained in:
Neil Brown 2007-10-13 12:50:01 +00:00
parent ec43e592f0
commit 90799499d8

View File

@ -241,23 +241,21 @@ public:
{ {
} }
//Retyping: //The retyping constructors have their parameters in the other order to the same-type functions above,
// Removed for now because it is causing ambiguity problems with the standard constructor (to do with const-ness) //to avoid ambiguities between retyping and same types (especially when const is involved):
// and because I'm not actually sure if it is used (I think retyping uses the constructor below with tockArrayView)
/*
template <typename U> template <typename U>
inline tockArrayView(U* _realArray,const std::pair< boost::array<unsigned,DIMS> , unsigned >& _dims) inline tockArrayView(const std::pair< boost::array<unsigned,DIMS> , unsigned >& _dims,U* _realArray)
: realArray(reinterpret_cast<T*>(_realArray)),dims(_dims.first),totalSubDim(_dims.second) : realArray(reinterpret_cast<T*>(_realArray)),dims(_dims.first),totalSubDim(_dims.second)
{ {
//Assume it's a single U item: //Assume it's a single U item:
correctDimsRetype(sizeof(U)); correctDimsRetype(sizeof(U));
} }
*/
//Retyping, same number of dims: //Retyping, same number of dims:
template <typename U,unsigned FROMDIMS> template <typename U,unsigned FROMDIMS>
inline tockArrayView(const tockArrayView<U,FROMDIMS>& tav,const std::pair< boost::array<unsigned,DIMS> , unsigned >& _dims) inline tockArrayView(const std::pair< boost::array<unsigned,DIMS> , unsigned >& _dims,const tockArrayView<U,FROMDIMS>& tav)
: realArray(reinterpret_cast<T*>(tav.data())),dims(_dims.first),totalSubDim(_dims.second) : realArray(reinterpret_cast<T*>(tav.data())),dims(_dims.first),totalSubDim(_dims.second)
{ {
correctDimsRetype(tav.size() * sizeof(U)); correctDimsRetype(tav.size() * sizeof(U));