0
0
Fork 0
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:
Jason Volk 2017-12-13 14:32:05 -07:00
parent dfd23fac4c
commit e7036fa79f

View file

@ -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
{};
// //