@@ -80,41 +80,43 @@ namespace std {
80
80
81
81
*/
82
82
83
- #include < __config>
84
- #include < __memory/allocator.h>
85
- #include < __memory/allocator_destructor.h>
86
- #include < __memory/allocator_traits.h>
87
- #include < __memory/unique_ptr.h>
88
- #include < __type_traits/add_cv_quals.h>
89
- #include < __type_traits/add_pointer.h>
90
- #include < __type_traits/aligned_storage.h>
91
- #include < __type_traits/conditional.h>
92
- #include < __type_traits/decay.h>
93
- #include < __type_traits/enable_if.h>
94
- #include < __type_traits/is_constructible.h>
95
- #include < __type_traits/is_function.h>
96
- #include < __type_traits/is_nothrow_constructible.h>
97
- #include < __type_traits/is_reference.h>
98
- #include < __type_traits/is_same.h>
99
- #include < __type_traits/is_void.h>
100
- #include < __type_traits/remove_cv.h>
101
- #include < __type_traits/remove_cvref.h>
102
- #include < __type_traits/remove_reference.h>
103
- #include < __utility/forward.h>
104
- #include < __utility/in_place.h>
105
- #include < __utility/move.h>
106
- #include < __utility/unreachable.h>
107
- #include < __verbose_abort>
108
- #include < initializer_list>
109
- #include < typeinfo>
110
- #include < version>
111
-
112
- #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
113
- # pragma GCC system_header
114
- #endif
83
+ #if 0
84
+ #else // 0
85
+ # include < __config>
86
+ # include < __memory/allocator.h>
87
+ # include < __memory/allocator_destructor.h>
88
+ # include < __memory/allocator_traits.h>
89
+ # include < __memory/unique_ptr.h>
90
+ # include < __type_traits/add_cv_quals.h>
91
+ # include < __type_traits/add_pointer.h>
92
+ # include < __type_traits/aligned_storage.h>
93
+ # include < __type_traits/conditional.h>
94
+ # include < __type_traits/decay.h>
95
+ # include < __type_traits/enable_if.h>
96
+ # include < __type_traits/is_constructible.h>
97
+ # include < __type_traits/is_function.h>
98
+ # include < __type_traits/is_nothrow_constructible.h>
99
+ # include < __type_traits/is_reference.h>
100
+ # include < __type_traits/is_same.h>
101
+ # include < __type_traits/is_void.h>
102
+ # include < __type_traits/remove_cv.h>
103
+ # include < __type_traits/remove_cvref.h>
104
+ # include < __type_traits/remove_reference.h>
105
+ # include < __utility/forward.h>
106
+ # include < __utility/in_place.h>
107
+ # include < __utility/move.h>
108
+ # include < __utility/unreachable.h>
109
+ # include < __verbose_abort>
110
+ # include < initializer_list>
111
+ # include < typeinfo>
112
+ # include < version>
113
+
114
+ # if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
115
+ # pragma GCC system_header
116
+ # endif
115
117
116
118
_LIBCPP_PUSH_MACROS
117
- #include < __undef_macros>
119
+ # include < __undef_macros>
118
120
119
121
namespace std {
120
122
class _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_AVAILABILITY_BAD_ANY_CAST bad_any_cast : public bad_cast {
@@ -125,14 +127,14 @@ public:
125
127
126
128
_LIBCPP_BEGIN_NAMESPACE_STD
127
129
128
- #if _LIBCPP_STD_VER >= 17
130
+ # if _LIBCPP_STD_VER >= 17
129
131
130
132
[[noreturn]] inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST void __throw_bad_any_cast () {
131
- # if _LIBCPP_HAS_EXCEPTIONS
133
+ # if _LIBCPP_HAS_EXCEPTIONS
132
134
throw bad_any_cast ();
133
- # else
135
+ # else
134
136
_LIBCPP_VERBOSE_ABORT (" bad_any_cast was thrown in -fno-exceptions mode" );
135
- # endif
137
+ # endif
136
138
}
137
139
138
140
// Forward declarations
@@ -174,10 +176,10 @@ inline _LIBCPP_HIDE_FROM_ABI constexpr const void* __get_fallback_typeid() {
174
176
175
177
template <class _Tp >
176
178
inline _LIBCPP_HIDE_FROM_ABI bool __compare_typeid (type_info const * __id, const void * __fallback_id) {
177
- # if _LIBCPP_HAS_RTTI
179
+ # if _LIBCPP_HAS_RTTI
178
180
if (__id && *__id == typeid (_Tp))
179
181
return true ;
180
- # endif
182
+ # endif
181
183
return !__id && __fallback_id == __any_imp::__get_fallback_typeid<_Tp>();
182
184
}
183
185
@@ -264,15 +266,15 @@ public:
264
266
// 6.3.4 any observers
265
267
_LIBCPP_HIDE_FROM_ABI bool has_value () const _NOEXCEPT { return __h_ != nullptr ; }
266
268
267
- # if _LIBCPP_HAS_RTTI
269
+ # if _LIBCPP_HAS_RTTI
268
270
_LIBCPP_HIDE_FROM_ABI const type_info& type () const _NOEXCEPT {
269
271
if (__h_) {
270
272
return *static_cast <type_info const *>(this ->__call (_Action::_TypeInfo));
271
273
} else {
272
274
return typeid (void );
273
275
}
274
276
}
275
- # endif
277
+ # endif
276
278
277
279
private:
278
280
typedef __any_imp::_Action _Action;
@@ -370,11 +372,11 @@ private:
370
372
}
371
373
372
374
_LIBCPP_HIDE_FROM_ABI static void * __type_info () {
373
- # if _LIBCPP_HAS_RTTI
375
+ # if _LIBCPP_HAS_RTTI
374
376
return const_cast <void *>(static_cast <void const *>(&typeid (_Tp)));
375
- # else
377
+ # else
376
378
return nullptr ;
377
- # endif
379
+ # endif
378
380
}
379
381
};
380
382
@@ -442,11 +444,11 @@ private:
442
444
}
443
445
444
446
_LIBCPP_HIDE_FROM_ABI static void * __type_info () {
445
- # if _LIBCPP_HAS_RTTI
447
+ # if _LIBCPP_HAS_RTTI
446
448
return const_cast <void *>(static_cast <void const *>(&typeid (_Tp)));
447
- # else
449
+ # else
448
450
return nullptr ;
449
- # endif
451
+ # endif
450
452
}
451
453
};
452
454
@@ -577,37 +579,38 @@ _LIBCPP_HIDE_FROM_ABI add_pointer_t<_ValueType> any_cast(any* __any) _NOEXCEPT {
577
579
void * __p = __any->__call (
578
580
_Action::_Get,
579
581
nullptr ,
580
- # if _LIBCPP_HAS_RTTI
582
+ # if _LIBCPP_HAS_RTTI
581
583
&typeid (_ValueType),
582
- # else
584
+ # else
583
585
nullptr ,
584
- # endif
586
+ # endif
585
587
__any_imp::__get_fallback_typeid<_ValueType>());
586
588
return std::__pointer_or_func_cast<_ReturnType>(__p, is_function<_ValueType>{});
587
589
}
588
590
return nullptr ;
589
591
}
590
592
591
- #endif // _LIBCPP_STD_VER >= 17
593
+ # endif // _LIBCPP_STD_VER >= 17
592
594
593
595
_LIBCPP_END_NAMESPACE_STD
594
596
595
597
_LIBCPP_POP_MACROS
596
598
597
- #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
598
- # include < chrono>
599
- #endif
600
-
601
- #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
602
- # include < atomic>
603
- # include < concepts>
604
- # include < cstdlib>
605
- # include < iosfwd>
606
- # include < iterator>
607
- # include < memory>
608
- # include < stdexcept>
609
- # include < type_traits>
610
- # include < variant>
611
- #endif
599
+ # if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
600
+ # include < chrono>
601
+ # endif
602
+
603
+ # if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
604
+ # include < atomic>
605
+ # include < concepts>
606
+ # include < cstdlib>
607
+ # include < iosfwd>
608
+ # include < iterator>
609
+ # include < memory>
610
+ # include < stdexcept>
611
+ # include < type_traits>
612
+ # include < variant>
613
+ # endif
614
+ #endif // 0
612
615
613
616
#endif // _LIBCPP_ANY
0 commit comments