Nektar++
TestRawType.cpp
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: TestRawType.cpp
4//
5// For more information, please see: http://www.nektar.info
6//
7// The MIT License
8//
9// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10// Department of Aeronautics, Imperial College London (UK), and Scientific
11// Computing and Imaging Institute, University of Utah (USA).
12//
13// Permission is hereby granted, free of charge, to any person obtaining a
14// copy of this software and associated documentation files (the "Software"),
15// to deal in the Software without restriction, including without limitation
16// the rights to use, copy, modify, merge, publish, distribute, sublicense,
17// and/or sell copies of the Software, and to permit persons to whom the
18// Software is furnished to do so, subject to the following conditions:
19//
20// The above copyright notice and this permission notice shall be included
21// in all copies or substantial portions of the Software.
22//
23// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29// DEALINGS IN THE SOFTWARE.
30//
31// Description: Test the RawType metafunction. These are compile tests, so if
32// this file compiles successfully, then all tests have passed.
33//
34///////////////////////////////////////////////////////////////////////////////
35
37#include <type_traits>
38
39namespace Nektar
40{
41static_assert(std::is_same_v<double, RawType<double>::type>, "RawType error");
42static_assert(std::is_same_v<double, RawType<const double>::type>,
43 "RawType error");
44static_assert(std::is_same_v<double, RawType<volatile double>::type>,
45 "RawType error");
46static_assert(std::is_same_v<double, RawType<const volatile double>::type>,
47 "RawType error");
48
49static_assert(std::is_same_v<double, RawType<double *>::type>, "RawType error");
50static_assert(std::is_same_v<double, RawType<const double *>::type>,
51 "RawType error");
52static_assert(std::is_same_v<double, RawType<volatile double *>::type>,
53 "RawType error");
54static_assert(std::is_same_v<double, RawType<const volatile double *>::type>,
55 "RawType error");
56
57static_assert(std::is_same_v<double, RawType<double *const>::type>,
58 "RawType error");
59static_assert(std::is_same_v<double, RawType<const double *const>::type>,
60 "RawType error");
61static_assert(std::is_same_v<double, RawType<volatile double *const>::type>,
62 "RawType error");
63static_assert(
64 std::is_same_v<double, RawType<const volatile double *const>::type>,
65 "RawType error");
66
67static_assert(std::is_same_v<double, RawType<double *volatile>::type>,
68 "RawType error");
69static_assert(std::is_same_v<double, RawType<const double *volatile>::type>,
70 "RawType error");
71static_assert(std::is_same_v<double, RawType<volatile double *volatile>::type>,
72 "RawType error");
73static_assert(
74 std::is_same_v<double, RawType<const volatile double *volatile>::type>,
75 "RawType error");
76
77static_assert(std::is_same_v<double, RawType<double *const volatile>::type>,
78 "RawType error");
79static_assert(
80 std::is_same_v<double, RawType<const double *const volatile>::type>,
81 "RawType error");
82static_assert(
83 std::is_same_v<double, RawType<volatile double *const volatile>::type>,
84 "RawType error");
85static_assert(std::is_same_v<
87 "RawType error");
88
89static_assert(std::is_same_v<double, RawType<std::shared_ptr<double>>::type>,
90 "RawType error");
91static_assert(
92 std::is_same_v<double, RawType<const std::shared_ptr<double>>::type>,
93 "RawType error");
94static_assert(
95 std::is_same_v<double, RawType<volatile std::shared_ptr<double>>::type>,
96 "RawType error");
97static_assert(
98 std::is_same_v<double,
99 RawType<const volatile std::shared_ptr<double>>::type>,
100 "RawType error");
101
102static_assert(
103 std::is_same_v<double, RawType<std::shared_ptr<const double>>::type>,
104 "RawType error");
105static_assert(
106 std::is_same_v<double, RawType<const std::shared_ptr<const double>>::type>,
107 "RawType error");
108static_assert(
109 std::is_same_v<double,
110 RawType<volatile std::shared_ptr<const double>>::type>,
111 "RawType error");
112static_assert(
113 std::is_same_v<double,
114 RawType<const volatile std::shared_ptr<const double>>::type>,
115 "RawType error");
116
117static_assert(
118 std::is_same_v<double, RawType<std::shared_ptr<volatile double>>::type>,
119 "RawType error");
120static_assert(
121 std::is_same_v<double,
122 RawType<const std::shared_ptr<volatile double>>::type>,
123 "RawType error");
124static_assert(
125 std::is_same_v<double,
126 RawType<volatile std::shared_ptr<volatile double>>::type>,
127 "RawType error");
128static_assert(
129 std::is_same_v<
130 double, RawType<const volatile std::shared_ptr<volatile double>>::type>,
131 "RawType error");
132
133static_assert(
134 std::is_same_v<double,
135 RawType<std::shared_ptr<const volatile double>>::type>,
136 "RawType error");
137static_assert(
138 std::is_same_v<double,
139 RawType<const std::shared_ptr<const volatile double>>::type>,
140 "RawType error");
141static_assert(
142 std::is_same_v<
143 double, RawType<volatile std::shared_ptr<const volatile double>>::type>,
144 "RawType error");
145static_assert(
146 std::is_same_v<
147 double,
148 RawType<const volatile std::shared_ptr<const volatile double>>::type>,
149 "RawType error");
150
151} // namespace Nektar
std::decay< typenamestd::remove_pointer< T >::type >::type type
Definition: RawType.hpp:47