From: Behdad Esfahbod Date: Thu, 18 Apr 2019 14:04:10 +0000 (-0400) Subject: [array] Simplify copy assignment/constructor X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=91d958acc08cb99ddd3b656922e13497b9d1595d;p=platform%2Fupstream%2FlibHarfBuzzSharp.git [array] Simplify copy assignment/constructor To fix bogus MSVC warnings: c:\projects\harfbuzz\src\hb-array.hh(189): warning C4521: 'hb_array_t': multiple copy constructors specified [C:\projects\harfbuzz\build\harfbuzz.vcxproj] c:\projects\harfbuzz\src\hb-array.hh(189): warning C4522: 'hb_array_t': multiple assignment operators specified [C:\projects\harfbuzz\build\harfbuzz.vcxproj] --- diff --git a/src/hb-array.hh b/src/hb-array.hh index 74b6757..ee34dd5 100644 --- a/src/hb-array.hh +++ b/src/hb-array.hh @@ -43,20 +43,29 @@ struct hb_array_t : hb_iter_with_fallback_t, Type&> * Constructors. */ hb_array_t () : arrayZ (nullptr), length (0) {} - hb_array_t (const hb_array_t &o) : - hb_iter_with_fallback_t, Type&> (), - arrayZ (o.arrayZ), length (o.length) {} - template - hb_array_t (const hb_array_t > &o) : arrayZ (o.arrayZ), length (o.length) {} - hb_array_t (Type *array_, unsigned int length_) : arrayZ (array_), length (length_) {} template hb_array_t (Type (&array_)[length_]) : arrayZ (array_), length (length_) {} - template - hb_array_t& operator = (const hb_array_t > &o) - { arrayZ = o.arrayZ; length = o.length; return *this; } - hb_array_t& operator = (const hb_array_t &o) + template , U) || + hb_is_same (Type, hb_remove_reference) || + hb_is_same (hb_remove_const, hb_remove_reference) + )> + hb_array_t (const hb_array_t &o) : + hb_iter_with_fallback_t, Type&> (), + arrayZ (o.arrayZ), length (o.length) {} + template , U) || + hb_is_same (Type, hb_remove_reference) || + hb_is_same (hb_remove_const, hb_remove_reference) + )> + hb_array_t& operator = (const hb_array_t &o) { arrayZ = o.arrayZ; length = o.length; return *this; } + /* * Iterator implementation. */