[array] Another try at sizeof sorted_array

This commit is contained in:
Behdad Esfahbod 2022-11-14 13:43:58 -07:00
parent 72ba0b2aa2
commit a87843be3d
2 changed files with 5 additions and 6 deletions

View File

@ -295,8 +295,8 @@ hb_array (T (&array_)[length_])
template <typename Type> template <typename Type>
struct hb_sorted_array_t : struct hb_sorted_array_t :
hb_iter_t<hb_sorted_array_t<Type>, Type&>, hb_array_t<Type>,
hb_array_t<Type> hb_iter_t<hb_sorted_array_t<Type>, Type&>
{ {
typedef hb_iter_t<hb_sorted_array_t, Type&> iter_base_t; typedef hb_iter_t<hb_sorted_array_t, Type&> iter_base_t;
HB_ITER_USING (iter_base_t); HB_ITER_USING (iter_base_t);
@ -316,8 +316,8 @@ struct hb_sorted_array_t :
template <typename U, template <typename U,
hb_enable_if (hb_is_cr_convertible(U, Type))> hb_enable_if (hb_is_cr_convertible(U, Type))>
constexpr hb_sorted_array_t (const hb_array_t<U> &o) : constexpr hb_sorted_array_t (const hb_array_t<U> &o) :
hb_iter_t<hb_sorted_array_t, Type&> (), hb_array_t<Type> (o),
hb_array_t<Type> (o) {} hb_iter_t<hb_sorted_array_t, Type&> () {}
template <typename U, template <typename U,
hb_enable_if (hb_is_cr_convertible(U, Type))> hb_enable_if (hb_is_cr_convertible(U, Type))>
hb_sorted_array_t& operator = (const hb_array_t<U> &o) hb_sorted_array_t& operator = (const hb_array_t<U> &o)

View File

@ -70,8 +70,7 @@ test_reverse_invalid ()
int int
main (int argc, char **argv) main (int argc, char **argv)
{ {
/* The following fails on MSVC. */ assert (sizeof (hb_array_t<int>) == sizeof (hb_sorted_array_t<int>));
// assert (sizeof (hb_array_t<int>) == sizeof (hb_sorted_array_t<int>));
test_reverse (); test_reverse ();
test_reverse_range (); test_reverse_range ();