xref: /llvm-project-15.0.7/libcxx/include/any (revision faef447e)
1// -*- C++ -*-
2//===----------------------------------------------------------------------===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_ANY
11#define _LIBCPP_ANY
12
13/*
14   any synopsis
15
16namespace std {
17
18  class bad_any_cast : public bad_cast
19  {
20  public:
21    virtual const char* what() const noexcept;
22  };
23
24  class any
25  {
26  public:
27
28    // 6.3.1 any construct/destruct
29    any() noexcept;
30
31    any(const any& other);
32    any(any&& other) noexcept;
33
34    template <class ValueType>
35      any(ValueType&& value);
36
37    ~any();
38
39    // 6.3.2 any assignments
40    any& operator=(const any& rhs);
41    any& operator=(any&& rhs) noexcept;
42
43    template <class ValueType>
44      any& operator=(ValueType&& rhs);
45
46    // 6.3.3 any modifiers
47    template <class ValueType, class... Args>
48      decay_t<ValueType>& emplace(Args&&... args);
49    template <class ValueType, class U, class... Args>
50      decay_t<ValueType>& emplace(initializer_list<U>, Args&&...);
51    void reset() noexcept;
52    void swap(any& rhs) noexcept;
53
54    // 6.3.4 any observers
55    bool has_value() const noexcept;
56    const type_info& type() const noexcept;
57  };
58
59   // 6.4 Non-member functions
60  void swap(any& x, any& y) noexcept;
61
62  template <class T, class ...Args>
63    any make_any(Args&& ...args);
64  template <class T, class U, class ...Args>
65    any make_any(initializer_list<U>, Args&& ...args);
66
67  template<class ValueType>
68    ValueType any_cast(const any& operand);
69  template<class ValueType>
70    ValueType any_cast(any& operand);
71  template<class ValueType>
72    ValueType any_cast(any&& operand);
73
74  template<class ValueType>
75    const ValueType* any_cast(const any* operand) noexcept;
76  template<class ValueType>
77    ValueType* any_cast(any* operand) noexcept;
78
79} // namespace std
80
81*/
82
83#include <__assert> // all public C++ headers provide the assertion handler
84#include <__availability>
85#include <__config>
86#include <__utility/forward.h>
87#include <__utility/in_place.h>
88#include <__utility/move.h>
89#include <__utility/unreachable.h>
90#include <cstdlib>
91#include <memory>
92#include <type_traits>
93#include <typeinfo>
94#include <version>
95
96#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
97#  pragma GCC system_header
98#endif
99
100namespace std {
101class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_ANY_CAST bad_any_cast : public bad_cast
102{
103public:
104    virtual const char* what() const _NOEXCEPT;
105};
106} // namespace std
107
108_LIBCPP_BEGIN_NAMESPACE_STD
109
110#if _LIBCPP_STD_VER > 14
111
112_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY
113_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
114void __throw_bad_any_cast()
115{
116#ifndef _LIBCPP_NO_EXCEPTIONS
117    throw bad_any_cast();
118#else
119    _VSTD::abort();
120#endif
121}
122
123// Forward declarations
124class _LIBCPP_TEMPLATE_VIS any;
125
126template <class _ValueType>
127_LIBCPP_INLINE_VISIBILITY
128add_pointer_t<add_const_t<_ValueType>>
129any_cast(any const *) _NOEXCEPT;
130
131template <class _ValueType>
132_LIBCPP_INLINE_VISIBILITY
133add_pointer_t<_ValueType> any_cast(any *) _NOEXCEPT;
134
135namespace __any_imp
136{
137  using _Buffer = aligned_storage_t<3*sizeof(void*), alignment_of<void*>::value>;
138
139  template <class _Tp>
140  using _IsSmallObject = integral_constant<bool
141        , sizeof(_Tp) <= sizeof(_Buffer)
142          && alignment_of<_Buffer>::value
143             % alignment_of<_Tp>::value == 0
144          && is_nothrow_move_constructible<_Tp>::value
145        >;
146
147  enum class _Action {
148    _Destroy,
149    _Copy,
150    _Move,
151    _Get,
152    _TypeInfo
153  };
154
155  template <class _Tp> struct _SmallHandler;
156  template <class _Tp> struct _LargeHandler;
157
158  template <class _Tp>
159  struct  _LIBCPP_TEMPLATE_VIS __unique_typeinfo { static constexpr int __id = 0; };
160  template <class _Tp> constexpr int __unique_typeinfo<_Tp>::__id;
161
162  template <class _Tp>
163  inline _LIBCPP_INLINE_VISIBILITY
164  constexpr const void* __get_fallback_typeid() {
165      return &__unique_typeinfo<remove_cv_t<remove_reference_t<_Tp>>>::__id;
166  }
167
168  template <class _Tp>
169  inline _LIBCPP_INLINE_VISIBILITY
170  bool __compare_typeid(type_info const* __id, const void* __fallback_id)
171  {
172#if !defined(_LIBCPP_NO_RTTI)
173      if (__id && *__id == typeid(_Tp))
174          return true;
175#endif
176      if (!__id && __fallback_id == __any_imp::__get_fallback_typeid<_Tp>())
177          return true;
178      return false;
179  }
180
181  template <class _Tp>
182  using _Handler = conditional_t<
183    _IsSmallObject<_Tp>::value, _SmallHandler<_Tp>, _LargeHandler<_Tp>>;
184
185} // namespace __any_imp
186
187class _LIBCPP_TEMPLATE_VIS any
188{
189public:
190  // construct/destruct
191  _LIBCPP_INLINE_VISIBILITY
192  constexpr any() _NOEXCEPT : __h(nullptr) {}
193
194  _LIBCPP_INLINE_VISIBILITY
195  any(any const & __other) : __h(nullptr)
196  {
197    if (__other.__h) __other.__call(_Action::_Copy, this);
198  }
199
200  _LIBCPP_INLINE_VISIBILITY
201  any(any && __other) _NOEXCEPT : __h(nullptr)
202  {
203    if (__other.__h) __other.__call(_Action::_Move, this);
204  }
205
206  template <
207      class _ValueType
208    , class _Tp = decay_t<_ValueType>
209    , class = enable_if_t<
210        !is_same<_Tp, any>::value &&
211        !__is_inplace_type<_ValueType>::value &&
212        is_copy_constructible<_Tp>::value>
213    >
214  _LIBCPP_INLINE_VISIBILITY
215  any(_ValueType && __value);
216
217  template <class _ValueType, class ..._Args,
218    class _Tp = decay_t<_ValueType>,
219    class = enable_if_t<
220        is_constructible<_Tp, _Args...>::value &&
221        is_copy_constructible<_Tp>::value
222    >
223  >
224  _LIBCPP_INLINE_VISIBILITY
225  explicit any(in_place_type_t<_ValueType>, _Args&&... __args);
226
227  template <class _ValueType, class _Up, class ..._Args,
228    class _Tp = decay_t<_ValueType>,
229    class = enable_if_t<
230        is_constructible<_Tp, initializer_list<_Up>&, _Args...>::value &&
231        is_copy_constructible<_Tp>::value>
232  >
233  _LIBCPP_INLINE_VISIBILITY
234  explicit any(in_place_type_t<_ValueType>, initializer_list<_Up>, _Args&&... __args);
235
236  _LIBCPP_INLINE_VISIBILITY
237  ~any() { this->reset(); }
238
239  // assignments
240  _LIBCPP_INLINE_VISIBILITY
241  any & operator=(any const & __rhs) {
242    any(__rhs).swap(*this);
243    return *this;
244  }
245
246  _LIBCPP_INLINE_VISIBILITY
247  any & operator=(any && __rhs) _NOEXCEPT {
248    any(_VSTD::move(__rhs)).swap(*this);
249    return *this;
250  }
251
252  template <
253      class _ValueType
254    , class _Tp = decay_t<_ValueType>
255    , class = enable_if_t<
256          !is_same<_Tp, any>::value
257          && is_copy_constructible<_Tp>::value>
258    >
259  _LIBCPP_INLINE_VISIBILITY
260  any & operator=(_ValueType && __rhs);
261
262  template <class _ValueType, class ..._Args,
263    class _Tp = decay_t<_ValueType>,
264    class = enable_if_t<
265        is_constructible<_Tp, _Args...>::value &&
266        is_copy_constructible<_Tp>::value>
267    >
268  _LIBCPP_INLINE_VISIBILITY
269  _Tp& emplace(_Args&&... args);
270
271  template <class _ValueType, class _Up, class ..._Args,
272    class _Tp = decay_t<_ValueType>,
273    class = enable_if_t<
274        is_constructible<_Tp, initializer_list<_Up>&, _Args...>::value &&
275        is_copy_constructible<_Tp>::value>
276  >
277  _LIBCPP_INLINE_VISIBILITY
278  _Tp& emplace(initializer_list<_Up>, _Args&&...);
279
280  // 6.3.3 any modifiers
281  _LIBCPP_INLINE_VISIBILITY
282  void reset() _NOEXCEPT { if (__h) this->__call(_Action::_Destroy); }
283
284  _LIBCPP_INLINE_VISIBILITY
285  void swap(any & __rhs) _NOEXCEPT;
286
287  // 6.3.4 any observers
288  _LIBCPP_INLINE_VISIBILITY
289  bool has_value() const _NOEXCEPT { return __h != nullptr; }
290
291#if !defined(_LIBCPP_NO_RTTI)
292  _LIBCPP_INLINE_VISIBILITY
293  const type_info & type() const _NOEXCEPT {
294    if (__h) {
295        return *static_cast<type_info const *>(this->__call(_Action::_TypeInfo));
296    } else {
297        return typeid(void);
298    }
299  }
300#endif
301
302private:
303    typedef __any_imp::_Action _Action;
304    using _HandleFuncPtr =  void* (*)(_Action, any const *, any *, const type_info *,
305      const void* __fallback_info);
306
307    union _Storage {
308        constexpr _Storage() : __ptr(nullptr) {}
309        void *  __ptr;
310        __any_imp::_Buffer __buf;
311    };
312
313    _LIBCPP_INLINE_VISIBILITY
314    void * __call(_Action __a, any * __other = nullptr,
315                  type_info const * __info = nullptr,
316                   const void* __fallback_info = nullptr) const
317    {
318        return __h(__a, this, __other, __info, __fallback_info);
319    }
320
321    _LIBCPP_INLINE_VISIBILITY
322    void * __call(_Action __a, any * __other = nullptr,
323                  type_info const * __info = nullptr,
324                  const void* __fallback_info = nullptr)
325    {
326        return __h(__a, this, __other, __info, __fallback_info);
327    }
328
329    template <class>
330    friend struct __any_imp::_SmallHandler;
331    template <class>
332    friend struct __any_imp::_LargeHandler;
333
334    template <class _ValueType>
335    friend add_pointer_t<add_const_t<_ValueType>>
336    any_cast(any const *) _NOEXCEPT;
337
338    template <class _ValueType>
339    friend add_pointer_t<_ValueType>
340    any_cast(any *) _NOEXCEPT;
341
342    _HandleFuncPtr __h = nullptr;
343    _Storage __s;
344};
345
346namespace __any_imp
347{
348  template <class _Tp>
349  struct _LIBCPP_TEMPLATE_VIS _SmallHandler
350  {
351     _LIBCPP_INLINE_VISIBILITY
352     static void* __handle(_Action __act, any const * __this, any * __other,
353                           type_info const * __info, const void* __fallback_info)
354     {
355        switch (__act)
356        {
357        case _Action::_Destroy:
358          __destroy(const_cast<any &>(*__this));
359          return nullptr;
360        case _Action::_Copy:
361            __copy(*__this, *__other);
362            return nullptr;
363        case _Action::_Move:
364          __move(const_cast<any &>(*__this), *__other);
365          return nullptr;
366        case _Action::_Get:
367            return __get(const_cast<any &>(*__this), __info, __fallback_info);
368        case _Action::_TypeInfo:
369          return __type_info();
370        }
371        __libcpp_unreachable();
372    }
373
374    template <class ..._Args>
375    _LIBCPP_INLINE_VISIBILITY
376    static _Tp& __create(any & __dest, _Args&&... __args) {
377        typedef allocator<_Tp> _Alloc;
378        typedef allocator_traits<_Alloc> _ATraits;
379        _Alloc __a;
380        _Tp * __ret = static_cast<_Tp*>(static_cast<void*>(&__dest.__s.__buf));
381        _ATraits::construct(__a, __ret, _VSTD::forward<_Args>(__args)...);
382        __dest.__h = &_SmallHandler::__handle;
383        return *__ret;
384    }
385
386  private:
387    _LIBCPP_INLINE_VISIBILITY
388    static void __destroy(any & __this) {
389        typedef allocator<_Tp> _Alloc;
390        typedef allocator_traits<_Alloc> _ATraits;
391        _Alloc __a;
392        _Tp * __p = static_cast<_Tp *>(static_cast<void*>(&__this.__s.__buf));
393        _ATraits::destroy(__a, __p);
394        __this.__h = nullptr;
395    }
396
397    _LIBCPP_INLINE_VISIBILITY
398    static void __copy(any const & __this, any & __dest) {
399        _SmallHandler::__create(__dest, *static_cast<_Tp const *>(
400            static_cast<void const *>(&__this.__s.__buf)));
401    }
402
403    _LIBCPP_INLINE_VISIBILITY
404    static void __move(any & __this, any & __dest) {
405        _SmallHandler::__create(__dest, _VSTD::move(
406            *static_cast<_Tp*>(static_cast<void*>(&__this.__s.__buf))));
407        __destroy(__this);
408    }
409
410    _LIBCPP_INLINE_VISIBILITY
411    static void* __get(any & __this,
412                       type_info const * __info,
413                       const void* __fallback_id)
414    {
415        if (__any_imp::__compare_typeid<_Tp>(__info, __fallback_id))
416            return static_cast<void*>(&__this.__s.__buf);
417        return nullptr;
418    }
419
420    _LIBCPP_INLINE_VISIBILITY
421    static void* __type_info()
422    {
423#if !defined(_LIBCPP_NO_RTTI)
424        return const_cast<void*>(static_cast<void const *>(&typeid(_Tp)));
425#else
426        return nullptr;
427#endif
428    }
429  };
430
431  template <class _Tp>
432  struct _LIBCPP_TEMPLATE_VIS _LargeHandler
433  {
434    _LIBCPP_INLINE_VISIBILITY
435    static void* __handle(_Action __act, any const * __this,
436                          any * __other, type_info const * __info,
437                          void const* __fallback_info)
438    {
439        switch (__act)
440        {
441        case _Action::_Destroy:
442          __destroy(const_cast<any &>(*__this));
443          return nullptr;
444        case _Action::_Copy:
445          __copy(*__this, *__other);
446          return nullptr;
447        case _Action::_Move:
448          __move(const_cast<any &>(*__this), *__other);
449          return nullptr;
450        case _Action::_Get:
451            return __get(const_cast<any &>(*__this), __info, __fallback_info);
452        case _Action::_TypeInfo:
453          return __type_info();
454        }
455        __libcpp_unreachable();
456    }
457
458    template <class ..._Args>
459    _LIBCPP_INLINE_VISIBILITY
460    static _Tp& __create(any & __dest, _Args&&... __args) {
461        typedef allocator<_Tp> _Alloc;
462        typedef allocator_traits<_Alloc> _ATraits;
463        typedef __allocator_destructor<_Alloc> _Dp;
464        _Alloc __a;
465        unique_ptr<_Tp, _Dp> __hold(_ATraits::allocate(__a, 1), _Dp(__a, 1));
466        _Tp * __ret = __hold.get();
467        _ATraits::construct(__a, __ret, _VSTD::forward<_Args>(__args)...);
468        __dest.__s.__ptr = __hold.release();
469        __dest.__h = &_LargeHandler::__handle;
470        return *__ret;
471    }
472
473  private:
474
475    _LIBCPP_INLINE_VISIBILITY
476    static void __destroy(any & __this){
477        typedef allocator<_Tp> _Alloc;
478        typedef allocator_traits<_Alloc> _ATraits;
479        _Alloc __a;
480        _Tp * __p = static_cast<_Tp *>(__this.__s.__ptr);
481        _ATraits::destroy(__a, __p);
482        _ATraits::deallocate(__a, __p, 1);
483        __this.__h = nullptr;
484    }
485
486    _LIBCPP_INLINE_VISIBILITY
487    static void __copy(any const & __this, any & __dest) {
488        _LargeHandler::__create(__dest, *static_cast<_Tp const *>(__this.__s.__ptr));
489    }
490
491    _LIBCPP_INLINE_VISIBILITY
492    static void __move(any & __this, any & __dest) {
493      __dest.__s.__ptr = __this.__s.__ptr;
494      __dest.__h = &_LargeHandler::__handle;
495      __this.__h = nullptr;
496    }
497
498    _LIBCPP_INLINE_VISIBILITY
499    static void* __get(any & __this, type_info const * __info,
500                       void const* __fallback_info)
501    {
502        if (__any_imp::__compare_typeid<_Tp>(__info, __fallback_info))
503            return static_cast<void*>(__this.__s.__ptr);
504        return nullptr;
505
506    }
507
508    _LIBCPP_INLINE_VISIBILITY
509    static void* __type_info()
510    {
511#if !defined(_LIBCPP_NO_RTTI)
512        return const_cast<void*>(static_cast<void const *>(&typeid(_Tp)));
513#else
514        return nullptr;
515#endif
516    }
517  };
518
519} // namespace __any_imp
520
521
522template <class _ValueType, class _Tp, class>
523any::any(_ValueType && __v) : __h(nullptr)
524{
525  __any_imp::_Handler<_Tp>::__create(*this, _VSTD::forward<_ValueType>(__v));
526}
527
528template <class _ValueType, class ..._Args, class _Tp, class>
529any::any(in_place_type_t<_ValueType>, _Args&&... __args) {
530  __any_imp::_Handler<_Tp>::__create(*this, _VSTD::forward<_Args>(__args)...);
531}
532
533template <class _ValueType, class _Up, class ..._Args, class _Tp, class>
534any::any(in_place_type_t<_ValueType>, initializer_list<_Up> __il, _Args&&... __args) {
535  __any_imp::_Handler<_Tp>::__create(*this, __il, _VSTD::forward<_Args>(__args)...);
536}
537
538template <class _ValueType, class, class>
539inline _LIBCPP_INLINE_VISIBILITY
540any & any::operator=(_ValueType && __v)
541{
542  any(_VSTD::forward<_ValueType>(__v)).swap(*this);
543  return *this;
544}
545
546template <class _ValueType, class ..._Args, class _Tp, class>
547inline _LIBCPP_INLINE_VISIBILITY
548_Tp& any::emplace(_Args&&... __args) {
549  reset();
550  return __any_imp::_Handler<_Tp>::__create(*this, _VSTD::forward<_Args>(__args)...);
551}
552
553template <class _ValueType, class _Up, class ..._Args, class _Tp, class>
554inline _LIBCPP_INLINE_VISIBILITY
555_Tp& any::emplace(initializer_list<_Up> __il, _Args&&... __args) {
556  reset();
557  return __any_imp::_Handler<_Tp>::__create(*this, __il, _VSTD::forward<_Args>(__args)...);
558}
559
560inline _LIBCPP_INLINE_VISIBILITY
561void any::swap(any & __rhs) _NOEXCEPT
562{
563    if (this == &__rhs)
564      return;
565    if (__h && __rhs.__h) {
566        any __tmp;
567        __rhs.__call(_Action::_Move, &__tmp);
568        this->__call(_Action::_Move, &__rhs);
569        __tmp.__call(_Action::_Move, this);
570    }
571    else if (__h) {
572        this->__call(_Action::_Move, &__rhs);
573    }
574    else if (__rhs.__h) {
575        __rhs.__call(_Action::_Move, this);
576    }
577}
578
579// 6.4 Non-member functions
580
581inline _LIBCPP_INLINE_VISIBILITY
582void swap(any & __lhs, any & __rhs) _NOEXCEPT
583{
584    __lhs.swap(__rhs);
585}
586
587template <class _Tp, class ..._Args>
588inline _LIBCPP_INLINE_VISIBILITY
589any make_any(_Args&&... __args) {
590    return any(in_place_type<_Tp>, _VSTD::forward<_Args>(__args)...);
591}
592
593template <class _Tp, class _Up, class ..._Args>
594inline _LIBCPP_INLINE_VISIBILITY
595any make_any(initializer_list<_Up> __il, _Args&&... __args) {
596    return any(in_place_type<_Tp>, __il, _VSTD::forward<_Args>(__args)...);
597}
598
599template <class _ValueType>
600inline _LIBCPP_INLINE_VISIBILITY
601_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
602_ValueType any_cast(any const & __v)
603{
604    using _RawValueType = __uncvref_t<_ValueType>;
605    static_assert(is_constructible<_ValueType, _RawValueType const &>::value,
606                  "ValueType is required to be a const lvalue reference "
607                  "or a CopyConstructible type");
608    auto __tmp = _VSTD::any_cast<add_const_t<_RawValueType>>(&__v);
609    if (__tmp == nullptr)
610        __throw_bad_any_cast();
611    return static_cast<_ValueType>(*__tmp);
612}
613
614template <class _ValueType>
615inline _LIBCPP_INLINE_VISIBILITY
616_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
617_ValueType any_cast(any & __v)
618{
619    using _RawValueType = __uncvref_t<_ValueType>;
620    static_assert(is_constructible<_ValueType, _RawValueType &>::value,
621                  "ValueType is required to be an lvalue reference "
622                  "or a CopyConstructible type");
623    auto __tmp = _VSTD::any_cast<_RawValueType>(&__v);
624    if (__tmp == nullptr)
625        __throw_bad_any_cast();
626    return static_cast<_ValueType>(*__tmp);
627}
628
629template <class _ValueType>
630inline _LIBCPP_INLINE_VISIBILITY
631_LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST
632_ValueType any_cast(any && __v)
633{
634    using _RawValueType = __uncvref_t<_ValueType>;
635    static_assert(is_constructible<_ValueType, _RawValueType>::value,
636                  "ValueType is required to be an rvalue reference "
637                  "or a CopyConstructible type");
638    auto __tmp = _VSTD::any_cast<_RawValueType>(&__v);
639    if (__tmp == nullptr)
640        __throw_bad_any_cast();
641    return static_cast<_ValueType>(_VSTD::move(*__tmp));
642}
643
644template <class _ValueType>
645inline _LIBCPP_INLINE_VISIBILITY
646add_pointer_t<add_const_t<_ValueType>>
647any_cast(any const * __any) _NOEXCEPT
648{
649    static_assert(!is_reference<_ValueType>::value,
650                  "_ValueType may not be a reference.");
651    return _VSTD::any_cast<_ValueType>(const_cast<any *>(__any));
652}
653
654template <class _RetType>
655inline _LIBCPP_INLINE_VISIBILITY
656_RetType __pointer_or_func_cast(void* __p, /*IsFunction*/false_type) noexcept {
657  return static_cast<_RetType>(__p);
658}
659
660template <class _RetType>
661inline _LIBCPP_INLINE_VISIBILITY
662_RetType __pointer_or_func_cast(void*, /*IsFunction*/true_type) noexcept {
663  return nullptr;
664}
665
666template <class _ValueType>
667add_pointer_t<_ValueType>
668any_cast(any * __any) _NOEXCEPT
669{
670    using __any_imp::_Action;
671    static_assert(!is_reference<_ValueType>::value,
672                  "_ValueType may not be a reference.");
673    typedef typename add_pointer<_ValueType>::type _ReturnType;
674    if (__any && __any->__h) {
675      void *__p = __any->__call(_Action::_Get, nullptr,
676#if !defined(_LIBCPP_NO_RTTI)
677                          &typeid(_ValueType),
678#else
679                          nullptr,
680#endif
681                          __any_imp::__get_fallback_typeid<_ValueType>());
682        return _VSTD::__pointer_or_func_cast<_ReturnType>(
683            __p, is_function<_ValueType>{});
684    }
685    return nullptr;
686}
687
688#endif // _LIBCPP_STD_VER > 14
689
690_LIBCPP_END_NAMESPACE_STD
691
692#endif // _LIBCPP_ANY
693