Kagome
Polkadot Runtime Engine in C++17
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
type_traits.hpp
Go to the documentation of this file.
1
6
#ifndef KAGOME_TYPE_TRAITS
7
#define KAGOME_TYPE_TRAITS
8
9
namespace
kagome
{
10
11
// SFINAE-way for detect shared pointer
12
template
<
typename
T>
13
struct
is_shared_ptr
: std::false_type {};
14
template
<
typename
T>
15
struct
is_shared_ptr
<
std
::shared_ptr<T>> : std::true_type {};
16
17
// SFINAE-way for detect unique pointer
18
template
<
typename
T>
19
struct
is_unique_ptr
: std::false_type {};
20
template
<
typename
T>
21
struct
is_unique_ptr
<std::unique_ptr<T>> : std::true_type {};
22
23
// SFINAE-way for detect unique and smart pointers both
24
template
<
typename
T>
25
struct
is_smart_ptr
: std::false_type {};
26
template
<
typename
T>
27
struct
is_smart_ptr
<std::unique_ptr<T>> : std::true_type {};
28
template
<
typename
T>
29
struct
is_smart_ptr
<std::shared_ptr<T>> : std::true_type {};
30
31
}
// namespace kagome
32
#endif // KAGOME_TYPE_TRAITS
std
STL namespace.
kagome::is_shared_ptr
Definition:
type_traits.hpp:13
kagome::is_smart_ptr
Definition:
type_traits.hpp:25
kagome
kagome::is_unique_ptr
Definition:
type_traits.hpp:19
core
common
type_traits.hpp
Generated by
1.8.11