mirror of
https://github.com/matrix-construct/construct
synced 2024-12-01 19:22:53 +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>
|
class = void>
|
||||||
struct is_complete
|
struct is_complete
|
||||||
:std::false_type
|
:std::false_type
|
||||||
{
|
{};
|
||||||
};
|
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
struct is_complete<T, decltype(void(sizeof(T)))>
|
struct is_complete<T, decltype(void(sizeof(T)))>
|
||||||
:std::true_type
|
: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