Toolbox snapshot
The Reactive C++ Toolbox
Loading...
Searching...
No Matches
TypeTraits.ut.cpp
Go to the documentation of this file.
1// The Reactive C++ Toolbox.
2// Copyright (C) 2013-2019 Swirly Cloud Limited
3// Copyright (C) 2024 Reactive Markets Limited
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing, software
12// distributed under the License is distributed on an "AS IS" BASIS,
13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14// See the License for the specific language governing permissions and
15// limitations under the License.
16
17#include "TypeTraits.hpp"
18#include <vector>
19
20using namespace toolbox::util;
21
22static_assert(is_string_v<std::string>);
26static_assert(!is_string_v<std::string*>);
30static_assert(!is_string_v<std::string&>);
34static_assert(!is_string_v<void>);
35static_assert(!is_string_v<int>);
37static_assert(!is_string_v<char*>);
38static_assert(!is_string_v<const char*>);
39static_assert(!is_string_v<std::string_view>);
40
53static_assert(!is_string_view_v<void>);
54static_assert(!is_string_view_v<int>);
56static_assert(!is_string_view_v<char*>);
57static_assert(!is_string_view_v<const char*>);
58static_assert(!is_string_view_v<std::string>);
59
68static_assert(!is_decay_to_cstring_v<int[]>);
72static_assert(!is_decay_to_cstring_v<int[5]>);
92static_assert(!is_decay_to_cstring_v<char>);
95static_assert(!is_decay_to_cstring_v<int>);
96static_assert(!is_decay_to_cstring_v<void>);
97static_assert(!is_decay_to_cstring_v<double>);
100
101static_assert(is_string_type_v<std::string>);
102static_assert(!is_string_type_v<std::string*>);
103static_assert(!is_string_type_v<std::string&>);
104
108
109static_assert(is_string_type_v<char*>);
110static_assert(is_string_type_v<char* const>);
113static_assert(is_string_type_v<const char*>);
125static_assert(is_string_type_v<char[]>);
126static_assert(is_string_type_v<const char[]>);
129static_assert(is_string_type_v<char[5]>);
133static_assert(!is_string_type_v<void>);
134static_assert(!is_string_type_v<int>);
135static_assert(!is_string_type_v<float>);
160static_assert(!is_string_type_v<signed char[]>);
constexpr auto bind() noexcept
Definition Slot.hpp:92