2020-04-22 21:05:25 +01:00
|
|
|
/* This file is part of the mp project.
|
|
|
|
* Copyright (c) 2020 MerryMage
|
|
|
|
* SPDX-License-Identifier: 0BSD
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2020-04-22 21:06:56 +01:00
|
|
|
#include <mp/metavalue/value.h>
|
2020-04-22 21:05:25 +01:00
|
|
|
|
|
|
|
namespace mp {
|
|
|
|
|
|
|
|
/// Is type T an instance of template class C?
|
|
|
|
template <template <class...> class, class>
|
2020-04-22 21:06:56 +01:00
|
|
|
struct is_instance_of_template : false_type {};
|
2020-04-22 21:05:25 +01:00
|
|
|
|
|
|
|
template <template <class...> class C, class... As>
|
2020-04-22 21:06:56 +01:00
|
|
|
struct is_instance_of_template<C, C<As...>> : true_type {};
|
2020-04-22 21:05:25 +01:00
|
|
|
|
|
|
|
/// Is type T an instance of template class C?
|
|
|
|
template<template <class...> class C, class T>
|
|
|
|
constexpr bool is_instance_of_template_v = is_instance_of_template<C, T>::value;
|
|
|
|
|
|
|
|
} // namespace mp
|