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<double, RawType<double>::type>::value,
42 "RawType error");
43static_assert(std::is_same<double, RawType<const double>::type>::value,
44 "RawType error");
45static_assert(std::is_same<double, RawType<volatile double>::type>::value,
46 "RawType error");
47static_assert(std::is_same<double, RawType<const volatile double>::type>::value,
48 "RawType error");
49
50static_assert(std::is_same<double, RawType<double *>::type>::value,
51 "RawType error");
52static_assert(std::is_same<double, RawType<const double *>::type>::value,
53 "RawType error");
54static_assert(std::is_same<double, RawType<volatile double *>::type>::value,
55 "RawType error");
56static_assert(
57 std::is_same<double, RawType<const volatile double *>::type>::value,
58 "RawType error");
59
60static_assert(std::is_same<double, RawType<double *const>::type>::value,
61 "RawType error");
62static_assert(std::is_same<double, RawType<const double *const>::type>::value,
63 "RawType error");
64static_assert(
65 std::is_same<double, RawType<volatile double *const>::type>::value,
66 "RawType error");
67static_assert(
68 std::is_same<double, RawType<const volatile double *const>::type>::value,
69 "RawType error");
70
71static_assert(std::is_same<double, RawType<double *volatile>::type>::value,
72 "RawType error");
73static_assert(
74 std::is_same<double, RawType<const double *volatile>::type>::value,
75 "RawType error");
76static_assert(
77 std::is_same<double, RawType<volatile double *volatile>::type>::value,
78 "RawType error");
79static_assert(
80 std::is_same<double, RawType<const volatile double *volatile>::type>::value,
81 "RawType error");
82
83static_assert(
84 std::is_same<double, RawType<double *const volatile>::type>::value,
85 "RawType error");
86static_assert(
87 std::is_same<double, RawType<const double *const volatile>::type>::value,
88 "RawType error");
89static_assert(
90 std::is_same<double, RawType<volatile double *const volatile>::type>::value,
91 "RawType error");
92static_assert(
93 std::is_same<double,
95 "RawType error");
96
97static_assert(
98 std::is_same<double, RawType<std::shared_ptr<double>>::type>::value,
99 "RawType error");
100static_assert(
101 std::is_same<double, RawType<const std::shared_ptr<double>>::type>::value,
102 "RawType error");
103static_assert(
104 std::is_same<double,
105 RawType<volatile std::shared_ptr<double>>::type>::value,
106 "RawType error");
107static_assert(
108 std::is_same<double,
109 RawType<const volatile std::shared_ptr<double>>::type>::value,
110 "RawType error");
111
112static_assert(
113 std::is_same<double, RawType<std::shared_ptr<const double>>::type>::value,
114 "RawType error");
115static_assert(
116 std::is_same<double,
117 RawType<const std::shared_ptr<const double>>::type>::value,
118 "RawType error");
119static_assert(
120 std::is_same<double,
121 RawType<volatile std::shared_ptr<const double>>::type>::value,
122 "RawType error");
123static_assert(
124 std::is_same<
125 double,
126 RawType<const volatile std::shared_ptr<const double>>::type>::value,
127 "RawType error");
128
129static_assert(
130 std::is_same<double,
131 RawType<std::shared_ptr<volatile double>>::type>::value,
132 "RawType error");
133static_assert(
134 std::is_same<double,
135 RawType<const std::shared_ptr<volatile double>>::type>::value,
136 "RawType error");
137static_assert(
138 std::is_same<
139 double,
140 RawType<volatile std::shared_ptr<volatile double>>::type>::value,
141 "RawType error");
142static_assert(
143 std::is_same<
144 double,
145 RawType<const volatile std::shared_ptr<volatile double>>::type>::value,
146 "RawType error");
147
148static_assert(
149 std::is_same<double,
150 RawType<std::shared_ptr<const volatile double>>::type>::value,
151 "RawType error");
152static_assert(
153 std::is_same<
154 double,
155 RawType<const std::shared_ptr<const volatile double>>::type>::value,
156 "RawType error");
157static_assert(
158 std::is_same<
159 double,
160 RawType<volatile std::shared_ptr<const volatile double>>::type>::value,
161 "RawType error");
162static_assert(std::is_same<double, RawType<const volatile std::shared_ptr<
163 const volatile double>>::type>::value,
164 "RawType error");
165
166} // namespace Nektar
std::decay< typenamestd::remove_pointer< T >::type >::type type
Definition: RawType.hpp:47