Add more type traits to CTL

This commit is contained in:
Justine Tunney 2024-06-30 20:59:38 -07:00
parent e437bed006
commit 44191b3f50
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
12 changed files with 286 additions and 0 deletions

18
ctl/is_polymorphic.h Normal file
View file

@ -0,0 +1,18 @@
// -*-mode:c++;indent-tabs-mode:nil;c-basic-offset:4;tab-width:8;coding:utf-8-*-
// vi: set et ft=cpp ts=4 sts=4 sw=4 fenc=utf-8 :vi
#ifndef CTL_IS_POLYMORPHIC_H_
#define CTL_IS_POLYMORPHIC_H_
#include "integral_constant.h"
namespace ctl {
template<typename T>
struct is_polymorphic : public integral_constant<bool, __is_polymorphic(T)>
{};
template<typename T>
inline constexpr bool is_polymorphic_v = __is_polymorphic(T);
} // namespace ctl
#endif // CTL_IS_POLYMORPHIC_H_