dynarmic/include/mp/traits/is_instance_of_template.h
MerryMage 7b0c47d3f0 Squashed 'externals/mp/' content from commit 29cb5588d
git-subtree-dir: externals/mp
git-subtree-split: 29cb5588da3a18ed571a0e41622900a01b9f01eb
2020-04-22 21:05:25 +01:00

24 lines
635 B
C++

/* This file is part of the mp project.
* Copyright (c) 2020 MerryMage
* SPDX-License-Identifier: 0BSD
*/
#pragma once
#include <type_traits>
namespace mp {
/// Is type T an instance of template class C?
template <template <class...> class, class>
struct is_instance_of_template : public std::false_type {};
template <template <class...> class C, class... As>
struct is_instance_of_template<C, C<As...>> : public std::true_type {};
/// 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