提交 0ff7954f 编写于 作者: B Behdad Esfahbod

[meta] Add hb_is_trivial

上级 7162a97b
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册