From 2caae4a59aadf889b410c4e2f42c0285013c22e6 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 29 Jun 2020 01:18:28 -0700 Subject: [PATCH] m Move class traits --- src/hb-meta.hh | 11 +++++++++++ src/hb.hh | 8 -------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/hb-meta.hh b/src/hb-meta.hh index 9fd73ac7f..e40d9fd17 100644 --- a/src/hb-meta.hh +++ b/src/hb-meta.hh @@ -224,6 +224,8 @@ struct hb_reference_wrapper }; +/* Type traits */ + template using hb_is_integral = hb_bool_constant< hb_is_same (hb_decay, char) || @@ -296,6 +298,15 @@ template <> struct hb_int_max : hb_integral_constant::value +/* Class traits. */ + +#define HB_DELETE_COPY_ASSIGN(TypeName) \ + TypeName(const TypeName&) = delete; \ + void operator=(const TypeName&) = delete +#define HB_DELETE_CREATE_COPY_ASSIGN(TypeName) \ + TypeName() = delete; \ + TypeName(const TypeName&) = delete; \ + void operator=(const TypeName&) = delete template struct _hb_is_destructible : hb_false_type {}; diff --git a/src/hb.hh b/src/hb.hh index 3bddeeaeb..f569fbfc7 100644 --- a/src/hb.hh +++ b/src/hb.hh @@ -447,14 +447,6 @@ static_assert ((sizeof (hb_position_t) == 4), ""); static_assert ((sizeof (hb_mask_t) == 4), ""); static_assert ((sizeof (hb_var_int_t) == 4), ""); -#define HB_DELETE_COPY_ASSIGN(TypeName) \ - TypeName(const TypeName&) = delete; \ - void operator=(const TypeName&) = delete -#define HB_DELETE_CREATE_COPY_ASSIGN(TypeName) \ - TypeName() = delete; \ - TypeName(const TypeName&) = delete; \ - void operator=(const TypeName&) = delete - /* Size signifying variable-sized array */ #ifndef HB_VAR_ARRAY