|
191 | 191 | // in our -pure-cpp2 "import std;" simulation mode... if you need this,
|
192 | 192 | // use mixed mode (not -pure-cpp2) and #include all the headers you need
|
193 | 193 | // including this one
|
194 |
| - // |
| 194 | + // |
195 | 195 | // #include <execution>
|
196 | 196 | #endif
|
197 | 197 |
|
198 | 198 | // Otherwise, we're not in -pure-cpp2 and so just #include
|
199 | 199 | // what we need in this header to make this self-contained
|
200 | 200 | #else
|
201 |
| - #include <type_traits> |
202 |
| - #include <new> |
203 |
| - #include <memory> |
204 |
| - #include <random> |
205 |
| - #include <tuple> |
206 |
| - #include <string> |
207 |
| - #include <string_view> |
208 |
| - #include <vector> |
209 |
| - #include <span> |
210 |
| - #include <iostream> |
211 |
| - #include <variant> |
212 |
| - #include <any> |
213 |
| - #include <optional> |
214 |
| - #include <cstddef> |
215 |
| - #include <utility> |
216 |
| - #include <cstdio> |
217 |
| - #include <cstdint> |
| 201 | + #include <version> // has the _cpp_* preprocessor defs, include first |
218 | 202 | #include <algorithm>
|
| 203 | + #include <any> |
| 204 | + #include <array> |
| 205 | + #include <atomic> |
| 206 | + #ifdef __cpp_lib_barrier |
| 207 | + #include <barrier> |
| 208 | + #endif |
| 209 | + #include <bit> |
| 210 | + #include <bitset> |
| 211 | + #include <cctype> |
| 212 | + #include <charconv> |
| 213 | + #include <chrono> |
| 214 | + #include <cassert> |
| 215 | + #include <cerrno> |
| 216 | + #include <cfenv> |
| 217 | + #include <cfloat> |
| 218 | + #include <cinttypes> |
| 219 | + #include <climits> |
| 220 | + #include <clocale> |
| 221 | + #include <cmath> |
| 222 | + #include <codecvt> |
219 | 223 | #include <compare>
|
220 |
| - #include <iterator> |
| 224 | + #include <complex> |
221 | 225 | #include <concepts>
|
222 |
| - #include <system_error> |
223 |
| - #include <limits> |
224 |
| - |
| 226 | + #include <condition_variable> |
| 227 | + #ifdef __cpp_lib_coroutine |
| 228 | + #include <coroutine> |
| 229 | + #endif |
| 230 | + #include <csetjmp> |
| 231 | + #include <csignal> |
| 232 | + #include <cstdarg> |
| 233 | + #include <cstddef> |
| 234 | + #include <cstdint> |
| 235 | + #include <cstdio> |
| 236 | + #include <cstdlib> |
| 237 | + #include <cstring> |
| 238 | + #include <ctime> |
| 239 | + #if __has_include(<cuchar>) |
| 240 | + #include <cuchar> |
| 241 | + #endif |
| 242 | + #include <cwchar> |
| 243 | + #include <cwctype> |
| 244 | + #include <deque> |
225 | 245 | #ifndef CPP2_NO_EXCEPTIONS
|
226 | 246 | #include <exception>
|
227 | 247 | #endif
|
228 |
| - #ifndef CPP2_NO_RTTI |
229 |
| - #include <typeinfo> |
| 248 | + #include <filesystem> |
| 249 | + #ifdef __cpp_lib_format |
| 250 | + #include <format> |
230 | 251 | #endif
|
231 |
| - |
232 |
| - #if defined(CPP2_USE_SOURCE_LOCATION) |
| 252 | + #include <forward_list> |
| 253 | + #include <fstream> |
| 254 | + #include <future> |
| 255 | + #include <functional> |
| 256 | + #include <initializer_list> |
| 257 | + #include <iomanip> |
| 258 | + #include <ios> |
| 259 | + #include <iosfwd> |
| 260 | + #include <iostream> |
| 261 | + #include <iso646.h> |
| 262 | + #include <istream> |
| 263 | + #include <iterator> |
| 264 | + #ifdef __cpp_lib_latch |
| 265 | + #include <latch> |
| 266 | + #endif |
| 267 | + #include <limits> |
| 268 | + #include <list> |
| 269 | + #include <locale> |
| 270 | + #include <map> |
| 271 | + #include <memory> |
| 272 | + #ifdef __cpp_lib_memory_resource |
| 273 | + #include <memory_resource> |
| 274 | + #endif |
| 275 | + #include <mutex> |
| 276 | + #include <new> |
| 277 | + #include <numbers> |
| 278 | + #include <numeric> |
| 279 | + #include <optional> |
| 280 | + #include <ostream> |
| 281 | + #include <queue> |
| 282 | + #include <ranges> |
| 283 | + #include <random> |
| 284 | + #include <ratio> |
| 285 | + #include <regex> |
| 286 | + #include <scoped_allocator> |
| 287 | + #ifdef __cpp_lib_semaphore |
| 288 | + #include <semaphore> |
| 289 | + #endif |
| 290 | + #include <set> |
| 291 | + #include <shared_mutex> |
| 292 | + #ifdef __cpp_lib_source_location |
233 | 293 | #include <source_location>
|
234 | 294 | #endif
|
| 295 | + #include <span> |
| 296 | + #ifdef __cpp_lib_spanstream |
| 297 | + #include <spanstream> |
| 298 | + #endif |
| 299 | + #include <stack> |
| 300 | + #include <stdexcept> |
| 301 | + #include <string> |
| 302 | + #include <string_view> |
| 303 | + #include <system_error> |
| 304 | + #include <sstream> |
| 305 | + #ifdef __cpp_lib_jthread |
| 306 | + #include <stop_token> |
| 307 | + #endif |
| 308 | + #include <streambuf> |
| 309 | + #ifdef __cpp_lib_syncstream |
| 310 | + #include <syncstream> |
| 311 | + #endif |
| 312 | + #include <thread> |
| 313 | + #include <tuple> |
| 314 | + #include <type_traits> |
| 315 | + #include <typeindex> |
| 316 | + #ifndef CPP2_NO_RTTI |
| 317 | + #include <typeinfo> |
| 318 | + #endif |
| 319 | + #include <unordered_map> |
| 320 | + #include <unordered_set> |
| 321 | + #include <utility> |
| 322 | + #include <valarray> |
| 323 | + #include <variant> |
| 324 | + #include <vector> |
235 | 325 | #endif
|
236 | 326 |
|
237 | 327 |
|
@@ -483,7 +573,7 @@ template<typename T>
|
483 | 573 | auto Typeid() -> decltype(auto) {
|
484 | 574 | #ifdef CPP2_NO_RTTI
|
485 | 575 | Type.expects(
|
486 |
| - !"'any' dynamic casting is disabled with -fno-rtti", // more likely to appear on console |
| 576 | + !"'any' dynamic casting is disabled with -fno-rtti", // more likely to appear on console |
487 | 577 | "'any' dynamic casting is disabled with -fno-rtti" // make message available to hooked handlers
|
488 | 578 | );
|
489 | 579 | #else
|
@@ -829,7 +919,7 @@ inline auto to_string(std::string const& s) -> std::string const&
|
829 | 919 |
|
830 | 920 | template<typename T>
|
831 | 921 | inline auto to_string(T const& sv) -> std::string
|
832 |
| - requires (std::is_convertible_v<T, std::string_view> |
| 922 | + requires (std::is_convertible_v<T, std::string_view> |
833 | 923 | && !std::is_convertible_v<T, const char*>)
|
834 | 924 | {
|
835 | 925 | return std::string{sv};
|
@@ -952,17 +1042,17 @@ auto is( X const& ) -> bool {
|
952 | 1042 |
|
953 | 1043 | template< typename C, typename X >
|
954 | 1044 | requires (
|
955 |
| - ( std::is_base_of_v<X, C> || |
956 |
| - ( std::is_polymorphic_v<C> && std::is_polymorphic_v<X>) |
| 1045 | + ( std::is_base_of_v<X, C> || |
| 1046 | + ( std::is_polymorphic_v<C> && std::is_polymorphic_v<X>) |
957 | 1047 | ) && !std::is_same_v<C,X>)
|
958 | 1048 | auto is( X const& x ) -> bool {
|
959 | 1049 | return Dynamic_cast<C const*>(&x) != nullptr;
|
960 | 1050 | }
|
961 | 1051 |
|
962 | 1052 | template< typename C, typename X >
|
963 | 1053 | requires (
|
964 |
| - ( std::is_base_of_v<X, C> || |
965 |
| - ( std::is_polymorphic_v<C> && std::is_polymorphic_v<X>) |
| 1054 | + ( std::is_base_of_v<X, C> || |
| 1055 | + ( std::is_polymorphic_v<C> && std::is_polymorphic_v<X>) |
966 | 1056 | ) && !std::is_same_v<C,X>)
|
967 | 1057 | auto is( X const* x ) -> bool {
|
968 | 1058 | return Dynamic_cast<C const*>(x) != nullptr;
|
|
0 commit comments