mirror of
https://github.com/matrix-construct/construct
synced 2024-10-05 23:28:53 +02:00
ircd::util: Add util to test is type is complete.
This commit is contained in:
parent
417594d0cd
commit
8f9a4bd6db
1 changed files with 18 additions and 0 deletions
|
@ -363,6 +363,24 @@ template<class exception_t,
|
||||||
using throw_overload = typename std::enable_if<!is_nothrow<exception_t>(), return_t>::type;
|
using throw_overload = typename std::enable_if<!is_nothrow<exception_t>(), return_t>::type;
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Test if type is forward declared or complete
|
||||||
|
//
|
||||||
|
|
||||||
|
template<class T,
|
||||||
|
class = void>
|
||||||
|
struct is_complete
|
||||||
|
:std::false_type
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
struct is_complete<T, decltype(void(sizeof(T)))>
|
||||||
|
:std::true_type
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
} // namespace util
|
} // namespace util
|
||||||
} // namespace ircd
|
} // namespace ircd
|
||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
||||||
|
|
Loading…
Reference in a new issue