SpECTRE
v2021.04.06
Documentation
Introduction
Releases
Installation
User Tutorials
Dev Guide
Code of Conduct
Contributing Guide
Code Reference
Topics
Namespaces
Files
Bibliography
View on GitHub
src
Utilities
TypeTraits
IsStdArray.hpp
1
// Distributed under the MIT License.
2
// See LICENSE.txt for details.
3
4
#pragma once
5
6
#include <
array
>
7
#include <
type_traits
>
8
9
namespace
tt
{
10
// @{
11
/// \ingroup TypeTraitsGroup
12
/// \brief Check if type T is a std::array
13
///
14
/// \details
15
/// Given a type `T` derives from std::true_type if `T` is a std::array and from
16
/// std::false_type if `T` is not a std::array.
17
///
18
/// \usage
19
/// For any type `T`
20
/// \code
21
/// using result = tt::is_std_array<T>;
22
/// \endcode
23
///
24
/// \metareturns
25
/// std::bool_constant
26
///
27
/// \semantics
28
/// If `T` is a std::array then
29
/// \code
30
/// typename result::type = std::bool_constant<true>;
31
/// \endcode
32
/// otherwise
33
/// \code
34
/// typename result::type = std::bool_constant<false>;
35
/// \endcode
36
///
37
/// \example
38
/// \snippet Test_IsStdArray.cpp is_std_array_example
39
/// \see is_a is_std_array_of_size
40
/// \tparam T the type to check
41
template
<
typename
T>
42
struct
is_std_array
:
std::false_type
{};
43
44
/// \cond HIDDEN_SYMBOLS
45
template
<
typename
T,
size_t
N>
46
struct
is_std_array
<std::array<T, N>> :
std::true_type
{};
47
/// \endcond
48
49
/// \see is_std_array
50
template
<
typename
T>
51
constexpr
bool
is_std_array_v
=
is_std_array<T>::value
;
52
53
/// \see is_std_array
54
template
<
typename
T>
55
using
is_std_array_t
=
typename
is_std_array<T>::type
;
56
// @}
57
}
// namespace tt
std::false_type
tt::is_std_array_t
typename is_std_array< T >::type is_std_array_t
Definition:
IsStdArray.hpp:55
array
tt::is_std_array_v
constexpr bool is_std_array_v
Definition:
IsStdArray.hpp:51
tt
Definition:
TensorExpression.hpp:141
tt::is_std_array
Check if type T is a std::array.
Definition:
IsStdArray.hpp:42
type_traits
© Copyright 2017 - 2021
SXS Collaboration
,
Distributed under the
MIT License