mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 18:22:50 +01:00
ircd::util: Add is_specialization_of template utility.
This commit is contained in:
parent
dfd23fac4c
commit
e7036fa79f
1 changed files with 22 additions and 4 deletions
|
@ -504,14 +504,32 @@ 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
|
||||
{
|
||||
};
|
||||
{};
|
||||
|
||||
|
||||
//
|
||||
// Test if type is a specialization of a template
|
||||
//
|
||||
|
||||
template<class,
|
||||
template<class...>
|
||||
class>
|
||||
struct is_specialization_of
|
||||
:std::false_type
|
||||
{};
|
||||
|
||||
template<template<class...>
|
||||
class T,
|
||||
class... args>
|
||||
struct is_specialization_of<T<args...>, T>
|
||||
:std::true_type
|
||||
{};
|
||||
|
||||
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue