[meta] Add hb_is_trivial
This commit is contained in:
parent
7162a97bca
commit
0ff7954f9f
@ -389,5 +389,12 @@ using hb_is_trivially_copyable= hb_bool_constant<
|
||||
>;
|
||||
#define hb_is_trivially_copyable(T) hb_is_trivially_copyable<T>::value
|
||||
|
||||
template <typename T>
|
||||
using hb_is_trivial= hb_bool_constant<
|
||||
hb_is_trivially_copyable (T) &&
|
||||
hb_is_trivially_default_constructible (T)
|
||||
>;
|
||||
#define hb_is_trivial(T) hb_is_trivial<T>::value
|
||||
|
||||
|
||||
#endif /* HB_META_HH */
|
||||
|
@ -119,6 +119,10 @@ main (int argc, char **argv)
|
||||
static_assert (hb_is_trivially_copyable (X), "");
|
||||
static_assert (hb_is_trivially_copyable (Y), "");
|
||||
|
||||
static_assert (hb_is_trivial (int), "");
|
||||
static_assert (hb_is_trivial (X), "");
|
||||
static_assert (hb_is_trivial (Y), "");
|
||||
|
||||
/* TODO Add more meaningful tests. */
|
||||
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user