-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathTypeTraits.h
30 lines (27 loc) · 1.06 KB
/
TypeTraits.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#pragma once
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <type_traits>
namespace Aws
{
namespace Crt
{
/**
* A type trait for determining if the first template parameter is a template specialization of the second
* template parameter. Based on p2098 (https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2098r1.pdf).
*
* @note Known limitations: does not support template classes with non-type template parameter, e.g. std::array.
*/
template <typename T, template <typename...> class Primary> struct IsSpecializationOf : std::false_type
{
};
/* Specialization for the case when the first template parameter is a template specialization of the second
* template parameter. */
template <template <typename...> class Primary, typename... Args>
struct IsSpecializationOf<Primary<Args...>, Primary> : std::true_type
{
};
} // namespace Crt
} // namespace Aws