[array] Simplify copy assignment/constructor
To fix bogus MSVC warnings: c:\projects\harfbuzz\src\hb-array.hh(189): warning C4521: 'hb_array_t<Type>': multiple copy constructors specified [C:\projects\harfbuzz\build\harfbuzz.vcxproj] c:\projects\harfbuzz\src\hb-array.hh(189): warning C4522: 'hb_array_t<Type>': multiple assignment operators specified [C:\projects\harfbuzz\build\harfbuzz.vcxproj]
This commit is contained in:
parent
693d91cd49
commit
91d958acc0
|
@ -43,20 +43,29 @@ struct hb_array_t : hb_iter_with_fallback_t<hb_array_t<Type>, Type&>
|
||||||
* Constructors.
|
* Constructors.
|
||||||
*/
|
*/
|
||||||
hb_array_t () : arrayZ (nullptr), length (0) {}
|
hb_array_t () : arrayZ (nullptr), length (0) {}
|
||||||
hb_array_t (const hb_array_t<Type> &o) :
|
|
||||||
hb_iter_with_fallback_t<hb_array_t<Type>, Type&> (),
|
|
||||||
arrayZ (o.arrayZ), length (o.length) {}
|
|
||||||
template <typename U = Type, hb_enable_if (hb_is_const (U))>
|
|
||||||
hb_array_t (const hb_array_t<hb_remove_const<Type> > &o) : arrayZ (o.arrayZ), length (o.length) {}
|
|
||||||
|
|
||||||
hb_array_t (Type *array_, unsigned int length_) : arrayZ (array_), length (length_) {}
|
hb_array_t (Type *array_, unsigned int length_) : arrayZ (array_), length (length_) {}
|
||||||
template <unsigned int length_> hb_array_t (Type (&array_)[length_]) : arrayZ (array_), length (length_) {}
|
template <unsigned int length_> hb_array_t (Type (&array_)[length_]) : arrayZ (array_), length (length_) {}
|
||||||
|
|
||||||
template <typename U = Type, hb_enable_if (hb_is_const (U))>
|
template <typename U,
|
||||||
hb_array_t& operator = (const hb_array_t<hb_remove_const<Type> > &o)
|
hb_enable_if (
|
||||||
{ arrayZ = o.arrayZ; length = o.length; return *this; }
|
hb_is_same (Type, U) ||
|
||||||
hb_array_t& operator = (const hb_array_t &o)
|
hb_is_same (hb_remove_const<Type>, U) ||
|
||||||
|
hb_is_same (Type, hb_remove_reference<U>) ||
|
||||||
|
hb_is_same (hb_remove_const<Type>, hb_remove_reference<U>)
|
||||||
|
)>
|
||||||
|
hb_array_t (const hb_array_t<U> &o) :
|
||||||
|
hb_iter_with_fallback_t<hb_array_t<Type>, Type&> (),
|
||||||
|
arrayZ (o.arrayZ), length (o.length) {}
|
||||||
|
template <typename U,
|
||||||
|
hb_enable_if (
|
||||||
|
hb_is_same (Type, U) ||
|
||||||
|
hb_is_same (hb_remove_const<Type>, U) ||
|
||||||
|
hb_is_same (Type, hb_remove_reference<U>) ||
|
||||||
|
hb_is_same (hb_remove_const<Type>, hb_remove_reference<U>)
|
||||||
|
)>
|
||||||
|
hb_array_t& operator = (const hb_array_t<U> &o)
|
||||||
{ arrayZ = o.arrayZ; length = o.length; return *this; }
|
{ arrayZ = o.arrayZ; length = o.length; return *this; }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Iterator implementation.
|
* Iterator implementation.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue