1*700637cbSDimitry Andric// -*- C++ -*- 2*700637cbSDimitry Andric//===----------------------------------------------------------------------===// 3*700637cbSDimitry Andric// 4*700637cbSDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 5*700637cbSDimitry Andric// See https://llvm.org/LICENSE.txt for license information. 6*700637cbSDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7*700637cbSDimitry Andric// 8*700637cbSDimitry Andric//===----------------------------------------------------------------------===// 9*700637cbSDimitry Andric 10*700637cbSDimitry Andric#ifndef _LIBCPP___CXX03_MEMORY 11*700637cbSDimitry Andric#define _LIBCPP___CXX03_MEMORY 12*700637cbSDimitry Andric 13*700637cbSDimitry Andric// clang-format off 14*700637cbSDimitry Andric 15*700637cbSDimitry Andric/* 16*700637cbSDimitry Andric memory synopsis 17*700637cbSDimitry Andric 18*700637cbSDimitry Andricnamespace std 19*700637cbSDimitry Andric{ 20*700637cbSDimitry Andric 21*700637cbSDimitry Andricstruct allocator_arg_t { }; 22*700637cbSDimitry Andricinline constexpr allocator_arg_t allocator_arg = allocator_arg_t(); 23*700637cbSDimitry Andric 24*700637cbSDimitry Andrictemplate <class T, class Alloc> struct uses_allocator; 25*700637cbSDimitry Andric 26*700637cbSDimitry Andrictemplate <class Ptr> 27*700637cbSDimitry Andricstruct pointer_traits 28*700637cbSDimitry Andric{ 29*700637cbSDimitry Andric typedef Ptr pointer; 30*700637cbSDimitry Andric typedef <details> element_type; 31*700637cbSDimitry Andric typedef <details> difference_type; 32*700637cbSDimitry Andric 33*700637cbSDimitry Andric template <class U> using rebind = <details>; 34*700637cbSDimitry Andric 35*700637cbSDimitry Andric static pointer pointer_to(<details>); 36*700637cbSDimitry Andric}; 37*700637cbSDimitry Andric 38*700637cbSDimitry Andrictemplate <class T> 39*700637cbSDimitry Andricstruct pointer_traits<T*> 40*700637cbSDimitry Andric{ 41*700637cbSDimitry Andric typedef T* pointer; 42*700637cbSDimitry Andric typedef T element_type; 43*700637cbSDimitry Andric typedef ptrdiff_t difference_type; 44*700637cbSDimitry Andric 45*700637cbSDimitry Andric template <class U> using rebind = U*; 46*700637cbSDimitry Andric 47*700637cbSDimitry Andric static pointer pointer_to(<details>) noexcept; // constexpr in C++20 48*700637cbSDimitry Andric}; 49*700637cbSDimitry Andric 50*700637cbSDimitry Andrictemplate <class T> constexpr T* to_address(T* p) noexcept; // C++20 51*700637cbSDimitry Andrictemplate <class Ptr> constexpr auto to_address(const Ptr& p) noexcept; // C++20 52*700637cbSDimitry Andric 53*700637cbSDimitry Andrictemplate <class Alloc> 54*700637cbSDimitry Andricstruct allocator_traits 55*700637cbSDimitry Andric{ 56*700637cbSDimitry Andric typedef Alloc allocator_type; 57*700637cbSDimitry Andric typedef typename allocator_type::value_type 58*700637cbSDimitry Andric value_type; 59*700637cbSDimitry Andric 60*700637cbSDimitry Andric typedef Alloc::pointer | value_type* pointer; 61*700637cbSDimitry Andric typedef Alloc::const_pointer 62*700637cbSDimitry Andric | pointer_traits<pointer>::rebind<const value_type> 63*700637cbSDimitry Andric const_pointer; 64*700637cbSDimitry Andric typedef Alloc::void_pointer 65*700637cbSDimitry Andric | pointer_traits<pointer>::rebind<void> 66*700637cbSDimitry Andric void_pointer; 67*700637cbSDimitry Andric typedef Alloc::const_void_pointer 68*700637cbSDimitry Andric | pointer_traits<pointer>::rebind<const void> 69*700637cbSDimitry Andric const_void_pointer; 70*700637cbSDimitry Andric typedef Alloc::difference_type 71*700637cbSDimitry Andric | pointer_traits<pointer>::difference_type 72*700637cbSDimitry Andric difference_type; 73*700637cbSDimitry Andric typedef Alloc::size_type 74*700637cbSDimitry Andric | make_unsigned<difference_type>::type 75*700637cbSDimitry Andric size_type; 76*700637cbSDimitry Andric typedef Alloc::propagate_on_container_copy_assignment 77*700637cbSDimitry Andric | false_type propagate_on_container_copy_assignment; 78*700637cbSDimitry Andric typedef Alloc::propagate_on_container_move_assignment 79*700637cbSDimitry Andric | false_type propagate_on_container_move_assignment; 80*700637cbSDimitry Andric typedef Alloc::propagate_on_container_swap 81*700637cbSDimitry Andric | false_type propagate_on_container_swap; 82*700637cbSDimitry Andric typedef Alloc::is_always_equal 83*700637cbSDimitry Andric | is_empty is_always_equal; 84*700637cbSDimitry Andric 85*700637cbSDimitry Andric template <class T> using rebind_alloc = Alloc::rebind<T>::other | Alloc<T, Args...>; 86*700637cbSDimitry Andric template <class T> using rebind_traits = allocator_traits<rebind_alloc<T>>; 87*700637cbSDimitry Andric 88*700637cbSDimitry Andric static pointer allocate(allocator_type& a, size_type n); // constexpr and [[nodiscard]] in C++20 89*700637cbSDimitry Andric static pointer allocate(allocator_type& a, size_type n, const_void_pointer hint); // constexpr and [[nodiscard]] in C++20 90*700637cbSDimitry Andric 91*700637cbSDimitry Andric [[nodiscard]] static constexpr allocation_result<pointer, size_type> 92*700637cbSDimitry Andric allocate_at_least(Alloc& a, size_type n); // Since C++23 93*700637cbSDimitry Andric 94*700637cbSDimitry Andric static void deallocate(allocator_type& a, pointer p, size_type n) noexcept; // constexpr in C++20 95*700637cbSDimitry Andric 96*700637cbSDimitry Andric template <class T, class... Args> 97*700637cbSDimitry Andric static void construct(allocator_type& a, T* p, Args&&... args); // constexpr in C++20 98*700637cbSDimitry Andric 99*700637cbSDimitry Andric template <class T> 100*700637cbSDimitry Andric static void destroy(allocator_type& a, T* p); // constexpr in C++20 101*700637cbSDimitry Andric 102*700637cbSDimitry Andric static size_type max_size(const allocator_type& a); // noexcept in C++14, constexpr in C++20 103*700637cbSDimitry Andric static allocator_type select_on_container_copy_construction(const allocator_type& a); // constexpr in C++20 104*700637cbSDimitry Andric}; 105*700637cbSDimitry Andric 106*700637cbSDimitry Andrictemplate<class Pointer, class SizeType = size_t> 107*700637cbSDimitry Andricstruct allocation_result { 108*700637cbSDimitry Andric Pointer ptr; 109*700637cbSDimitry Andric SizeType count; 110*700637cbSDimitry Andric}; // Since C++23 111*700637cbSDimitry Andric 112*700637cbSDimitry Andrictemplate <> 113*700637cbSDimitry Andricclass allocator<void> // removed in C++20 114*700637cbSDimitry Andric{ 115*700637cbSDimitry Andricpublic: 116*700637cbSDimitry Andric typedef void* pointer; 117*700637cbSDimitry Andric typedef const void* const_pointer; 118*700637cbSDimitry Andric typedef void value_type; 119*700637cbSDimitry Andric 120*700637cbSDimitry Andric template <class _Up> struct rebind {typedef allocator<_Up> other;}; 121*700637cbSDimitry Andric}; 122*700637cbSDimitry Andric 123*700637cbSDimitry Andrictemplate <class T> 124*700637cbSDimitry Andricclass allocator 125*700637cbSDimitry Andric{ 126*700637cbSDimitry Andricpublic: 127*700637cbSDimitry Andric typedef size_t size_type; 128*700637cbSDimitry Andric typedef ptrdiff_t difference_type; 129*700637cbSDimitry Andric typedef T* pointer; // deprecated in C++17, removed in C++20 130*700637cbSDimitry Andric typedef const T* const_pointer; // deprecated in C++17, removed in C++20 131*700637cbSDimitry Andric typedef typename add_lvalue_reference<T>::type 132*700637cbSDimitry Andric reference; // deprecated in C++17, removed in C++20 133*700637cbSDimitry Andric typedef typename add_lvalue_reference<const T>::type 134*700637cbSDimitry Andric const_reference; // deprecated in C++17, removed in C++20 135*700637cbSDimitry Andric 136*700637cbSDimitry Andric typedef T value_type; 137*700637cbSDimitry Andric 138*700637cbSDimitry Andric template <class U> struct rebind {typedef allocator<U> other;}; // deprecated in C++17, removed in C++20 139*700637cbSDimitry Andric 140*700637cbSDimitry Andric typedef true_type propagate_on_container_move_assignment; 141*700637cbSDimitry Andric typedef true_type is_always_equal; // Deprecated in C++23, removed in C++26 142*700637cbSDimitry Andric 143*700637cbSDimitry Andric constexpr allocator() noexcept; // constexpr in C++20 144*700637cbSDimitry Andric constexpr allocator(const allocator&) noexcept; // constexpr in C++20 145*700637cbSDimitry Andric template <class U> 146*700637cbSDimitry Andric constexpr allocator(const allocator<U>&) noexcept; // constexpr in C++20 147*700637cbSDimitry Andric ~allocator(); // constexpr in C++20 148*700637cbSDimitry Andric pointer address(reference x) const noexcept; // deprecated in C++17, removed in C++20 149*700637cbSDimitry Andric const_pointer address(const_reference x) const noexcept; // deprecated in C++17, removed in C++20 150*700637cbSDimitry Andric T* allocate(size_t n, const void* hint); // deprecated in C++17, removed in C++20 151*700637cbSDimitry Andric T* allocate(size_t n); // constexpr in C++20 152*700637cbSDimitry Andric void deallocate(T* p, size_t n) noexcept; // constexpr in C++20 153*700637cbSDimitry Andric size_type max_size() const noexcept; // deprecated in C++17, removed in C++20 154*700637cbSDimitry Andric template<class U, class... Args> 155*700637cbSDimitry Andric void construct(U* p, Args&&... args); // deprecated in C++17, removed in C++20 156*700637cbSDimitry Andric template <class U> 157*700637cbSDimitry Andric void destroy(U* p); // deprecated in C++17, removed in C++20 158*700637cbSDimitry Andric}; 159*700637cbSDimitry Andric 160*700637cbSDimitry Andrictemplate <class T, class U> 161*700637cbSDimitry Andricbool operator==(const allocator<T>&, const allocator<U>&) noexcept; // constexpr in C++20 162*700637cbSDimitry Andric 163*700637cbSDimitry Andrictemplate <class T, class U> 164*700637cbSDimitry Andricbool operator!=(const allocator<T>&, const allocator<U>&) noexcept; // removed in C++20 165*700637cbSDimitry Andric 166*700637cbSDimitry Andrictemplate <class OutputIterator, class T> 167*700637cbSDimitry Andricclass raw_storage_iterator // deprecated in C++17, removed in C++20 168*700637cbSDimitry Andric : public iterator<output_iterator_tag, void, void, void, void> // until C++17 169*700637cbSDimitry Andric{ 170*700637cbSDimitry Andricpublic: 171*700637cbSDimitry Andric typedef output_iterator_tag iterator_category; 172*700637cbSDimitry Andric typedef void value_type; 173*700637cbSDimitry Andric typedef void difference_type; // until C++20 174*700637cbSDimitry Andric typedef ptrdiff_t difference_type; // since C++20 175*700637cbSDimitry Andric typedef void pointer; 176*700637cbSDimitry Andric typedef void reference; 177*700637cbSDimitry Andric 178*700637cbSDimitry Andric explicit raw_storage_iterator(OutputIterator x); 179*700637cbSDimitry Andric raw_storage_iterator& operator*(); 180*700637cbSDimitry Andric raw_storage_iterator& operator=(const T& element); 181*700637cbSDimitry Andric raw_storage_iterator& operator++(); 182*700637cbSDimitry Andric raw_storage_iterator operator++(int); 183*700637cbSDimitry Andric}; 184*700637cbSDimitry Andric 185*700637cbSDimitry Andrictemplate <class T> pair<T*,ptrdiff_t> get_temporary_buffer(ptrdiff_t n) noexcept; 186*700637cbSDimitry Andrictemplate <class T> void return_temporary_buffer(T* p) noexcept; 187*700637cbSDimitry Andric 188*700637cbSDimitry Andrictemplate <class T> T* addressof(T& r) noexcept; 189*700637cbSDimitry Andrictemplate <class T> T* addressof(const T&& r) noexcept = delete; 190*700637cbSDimitry Andric 191*700637cbSDimitry Andrictemplate <class InputIterator, class ForwardIterator> 192*700637cbSDimitry AndricForwardIterator 193*700637cbSDimitry Andricuninitialized_copy(InputIterator first, InputIterator last, ForwardIterator result); 194*700637cbSDimitry Andric 195*700637cbSDimitry Andricnamespace ranges { 196*700637cbSDimitry Andric 197*700637cbSDimitry Andrictemplate<class InputIterator, class OutputIterator> 198*700637cbSDimitry Andricusing uninitialized_copy_result = in_out_result<InputIterator, OutputIterator>; // since C++20 199*700637cbSDimitry Andric 200*700637cbSDimitry Andrictemplate<input_iterator InputIterator, sentinel-for<InputIterator> Sentinel1, nothrow-forward-iterator OutputIterator, nothrow-sentinel-for<OutputIterator> Sentinel2> 201*700637cbSDimitry Andric requires constructible_from<iter_value_t<OutputIterator>, iter_reference_t<InputIterator>> 202*700637cbSDimitry Andricuninitialized_copy_result<InputIterator, OutputIterator> 203*700637cbSDimitry Andricuninitialized_copy(InputIterator ifirst, Sentinel1 ilast, OutputIterator ofirst, Sentinel2 olast); // since C++20 204*700637cbSDimitry Andric 205*700637cbSDimitry Andrictemplate<input_range InputRange, nothrow-forward-range OutputRange> 206*700637cbSDimitry Andric requires constructible_from<range_value_t<OutputRange>, range_reference_t<InputRange>> 207*700637cbSDimitry Andricuninitialized_copy_result<borrowed_iterator_t<InputRange>, borrowed_iterator_t<OutputRange>> 208*700637cbSDimitry Andricuninitialized_copy(InputRange&& in_range, OutputRange&& out_range); // since C++20 209*700637cbSDimitry Andric 210*700637cbSDimitry Andric} 211*700637cbSDimitry Andric 212*700637cbSDimitry Andrictemplate <class InputIterator, class Size, class ForwardIterator> 213*700637cbSDimitry AndricForwardIterator 214*700637cbSDimitry Andricuninitialized_copy_n(InputIterator first, Size n, ForwardIterator result); 215*700637cbSDimitry Andric 216*700637cbSDimitry Andricnamespace ranges { 217*700637cbSDimitry Andric 218*700637cbSDimitry Andrictemplate<class InputIterator, class OutputIterator> 219*700637cbSDimitry Andricusing uninitialized_copy_n_result = in_out_result<InputIterator, OutputIterator>; // since C++20 220*700637cbSDimitry Andric 221*700637cbSDimitry Andrictemplate<input_iterator InputIterator, nothrow-forward-iterator OutputIterator, nothrow-sentinel-for<OutputIterator> Sentinel> 222*700637cbSDimitry Andric requires constructible_from<iter_value_t<OutputIterator>, iter_reference_t<InputIterator>> 223*700637cbSDimitry Andricuninitialized_copy_n_result<InputIterator, OutputIterator> 224*700637cbSDimitry Andricuninitialized_copy_n(InputIterator ifirst, iter_difference_t<InputIterator> n, OutputIterator ofirst, Sentinel olast); // since C++20 225*700637cbSDimitry Andric 226*700637cbSDimitry Andric} 227*700637cbSDimitry Andric 228*700637cbSDimitry Andrictemplate <class ForwardIterator, class T> 229*700637cbSDimitry Andricvoid uninitialized_fill(ForwardIterator first, ForwardIterator last, const T& x); 230*700637cbSDimitry Andric 231*700637cbSDimitry Andricnamespace ranges { 232*700637cbSDimitry Andric 233*700637cbSDimitry Andrictemplate <nothrow-forward-iterator ForwardIterator, nothrow-sentinel-for<ForwardIterator> Sentinel, class T> 234*700637cbSDimitry Andric requires constructible_from<iter_value_t<ForwardIterator>, const T&> 235*700637cbSDimitry AndricForwardIterator uninitialized_fill(ForwardIterator first, Sentinel last, const T& x); // since C++20 236*700637cbSDimitry Andric 237*700637cbSDimitry Andrictemplate <nothrow-forward-range ForwardRange, class T> 238*700637cbSDimitry Andric requires constructible_from<range_value_t<ForwardRange>, const T&> 239*700637cbSDimitry Andricborrowed_iterator_t<ForwardRange> uninitialized_fill(ForwardRange&& range, const T& x); // since C++20 240*700637cbSDimitry Andric 241*700637cbSDimitry Andric} 242*700637cbSDimitry Andric 243*700637cbSDimitry Andrictemplate <class ForwardIterator, class Size, class T> 244*700637cbSDimitry AndricForwardIterator 245*700637cbSDimitry Andricuninitialized_fill_n(ForwardIterator first, Size n, const T& x); 246*700637cbSDimitry Andric 247*700637cbSDimitry Andricnamespace ranges { 248*700637cbSDimitry Andric 249*700637cbSDimitry Andrictemplate <nothrow-forward-iterator ForwardIterator, class T> 250*700637cbSDimitry Andric requires constructible_from<iter_value_t<ForwardIterator>, const T&> 251*700637cbSDimitry AndricForwardIterator uninitialized_fill_n(ForwardIterator first, iter_difference_t<ForwardIterator> n); // since C++20 252*700637cbSDimitry Andric 253*700637cbSDimitry Andric} 254*700637cbSDimitry Andric 255*700637cbSDimitry Andrictemplate <class T, class ...Args> 256*700637cbSDimitry Andricconstexpr T* construct_at(T* location, Args&& ...args); // since C++20 257*700637cbSDimitry Andric 258*700637cbSDimitry Andricnamespace ranges { 259*700637cbSDimitry Andric template<class T, class... Args> 260*700637cbSDimitry Andric constexpr T* construct_at(T* location, Args&&... args); // since C++20 261*700637cbSDimitry Andric} 262*700637cbSDimitry Andric 263*700637cbSDimitry Andrictemplate <class T> 264*700637cbSDimitry Andricvoid destroy_at(T* location); // constexpr in C++20 265*700637cbSDimitry Andric 266*700637cbSDimitry Andricnamespace ranges { 267*700637cbSDimitry Andric template<destructible T> 268*700637cbSDimitry Andric constexpr void destroy_at(T* location) noexcept; // since C++20 269*700637cbSDimitry Andric} 270*700637cbSDimitry Andric 271*700637cbSDimitry Andrictemplate <class ForwardIterator> 272*700637cbSDimitry Andricvoid destroy(ForwardIterator first, ForwardIterator last); // constexpr in C++20 273*700637cbSDimitry Andric 274*700637cbSDimitry Andricnamespace ranges { 275*700637cbSDimitry Andric template<nothrow-input-iterator InputIterator, nothrow-sentinel-for<InputIterator> Sentinel> 276*700637cbSDimitry Andric requires destructible<iter_value_t<InputIterator>> 277*700637cbSDimitry Andric constexpr InputIterator destroy(InputIterator first, Sentinel last) noexcept; // since C++20 278*700637cbSDimitry Andric template<nothrow-input-range InputRange> 279*700637cbSDimitry Andric requires destructible<range_value_t<InputRange>> 280*700637cbSDimitry Andric constexpr borrowed_iterator_t<InputRange> destroy(InputRange&& range) noexcept; // since C++20 281*700637cbSDimitry Andric} 282*700637cbSDimitry Andric 283*700637cbSDimitry Andrictemplate <class ForwardIterator, class Size> 284*700637cbSDimitry AndricForwardIterator destroy_n(ForwardIterator first, Size n); // constexpr in C++20 285*700637cbSDimitry Andric 286*700637cbSDimitry Andricnamespace ranges { 287*700637cbSDimitry Andric template<nothrow-input-iterator InputIterator> 288*700637cbSDimitry Andric requires destructible<iter_value_t<InputIterator>> 289*700637cbSDimitry Andric constexpr InputIterator destroy_n(InputIterator first, iter_difference_t<InputIterator> n) noexcept; // since C++20 290*700637cbSDimitry Andric} 291*700637cbSDimitry Andric 292*700637cbSDimitry Andrictemplate <class InputIterator, class ForwardIterator> 293*700637cbSDimitry Andric ForwardIterator uninitialized_move(InputIterator first, InputIterator last, ForwardIterator result); 294*700637cbSDimitry Andric 295*700637cbSDimitry Andricnamespace ranges { 296*700637cbSDimitry Andric 297*700637cbSDimitry Andrictemplate<class InputIterator, class OutputIterator> 298*700637cbSDimitry Andricusing uninitialized_move_result = in_out_result<InputIterator, OutputIterator>; // since C++20 299*700637cbSDimitry Andric 300*700637cbSDimitry Andrictemplate <input_iterator InputIterator, sentinel_for<InputIterator> Sentinel1, nothrow-forward-iterator OutputIterator, nothrow-sentinel-for<O> Sentinel2> 301*700637cbSDimitry Andric requires constructible_from<iter_value_t<OutputIterator>, iter_rvalue_reference_t<InputIterator>> 302*700637cbSDimitry Andricuninitialized_move_result<InputIterator, OutputIterator> 303*700637cbSDimitry Andricuninitialized_move(InputIterator ifirst, Sentinel1 ilast, OutputIterator ofirst, Sentinel2 olast); // since C++20 304*700637cbSDimitry Andric 305*700637cbSDimitry Andrictemplate<input_range InputRange, nothrow-forward-range OutputRange> 306*700637cbSDimitry Andric requires constructible_from<range_value_t<OutputRange>, range_rvalue_reference_t<InputRange>> 307*700637cbSDimitry Andricuninitialized_move_result<borrowed_iterator_t<InputRange>, borrowed_iterator_t<OutputRange>> 308*700637cbSDimitry Andricuninitialized_move(InputRange&& in_range, OutputRange&& out_range); // since C++20 309*700637cbSDimitry Andric 310*700637cbSDimitry Andric} 311*700637cbSDimitry Andric 312*700637cbSDimitry Andrictemplate <class InputIterator, class Size, class ForwardIterator> 313*700637cbSDimitry Andric pair<InputIterator,ForwardIterator> uninitialized_move_n(InputIterator first, Size n, ForwardIterator result); 314*700637cbSDimitry Andric 315*700637cbSDimitry Andricnamespace ranges { 316*700637cbSDimitry Andric 317*700637cbSDimitry Andrictemplate<class InputIterator, class OutputIterator> 318*700637cbSDimitry Andricusing uninitialized_move_n_result = in_out_result<InputIterator, OutputIterator>; // since C++20 319*700637cbSDimitry Andric 320*700637cbSDimitry Andrictemplate<input_iterator InputIterator, nothrow-forward-iterator OutputIterator, nothrow-sentinel-for<OutputIterator> Sentinel> 321*700637cbSDimitry Andric requires constructible_from<iter_value_t<OutputIterator>, iter_rvalue_reference_t<InputIterator>> 322*700637cbSDimitry Andricuninitialized_move_n_result<InputIterator, OutputIterator> 323*700637cbSDimitry Andricuninitialized_move_n(InputIterator ifirst, iter_difference_t<InputIterator> n, OutputIterator ofirst, Sentinel olast); // since C++20 324*700637cbSDimitry Andric 325*700637cbSDimitry Andric} 326*700637cbSDimitry Andric 327*700637cbSDimitry Andrictemplate <class ForwardIterator> 328*700637cbSDimitry Andric void uninitialized_value_construct(ForwardIterator first, ForwardIterator last); 329*700637cbSDimitry Andric 330*700637cbSDimitry Andricnamespace ranges { 331*700637cbSDimitry Andric 332*700637cbSDimitry Andrictemplate <nothrow-forward-iterator ForwardIterator, nothrow-sentinel-for<ForwardIterator> Sentinel> 333*700637cbSDimitry Andric requires default_initializable<iter_value_t<ForwardIterator>> 334*700637cbSDimitry Andric ForwardIterator uninitialized_value_construct(ForwardIterator first, Sentinel last); // since C++20 335*700637cbSDimitry Andric 336*700637cbSDimitry Andrictemplate <nothrow-forward-range ForwardRange> 337*700637cbSDimitry Andric requires default_initializable<range_value_t<ForwardRange>> 338*700637cbSDimitry Andric borrowed_iterator_t<ForwardRange> uninitialized_value_construct(ForwardRange&& r); // since C++20 339*700637cbSDimitry Andric 340*700637cbSDimitry Andric} 341*700637cbSDimitry Andric 342*700637cbSDimitry Andrictemplate <class ForwardIterator, class Size> 343*700637cbSDimitry Andric ForwardIterator uninitialized_value_construct_n(ForwardIterator first, Size n); 344*700637cbSDimitry Andric 345*700637cbSDimitry Andricnamespace ranges { 346*700637cbSDimitry Andric 347*700637cbSDimitry Andrictemplate <nothrow-forward-iterator ForwardIterator> 348*700637cbSDimitry Andric requires default_initializable<iter_value_t<ForwardIterator>> 349*700637cbSDimitry Andric ForwardIterator uninitialized_value_construct_n(ForwardIterator first, iter_difference_t<ForwardIterator> n); // since C++20 350*700637cbSDimitry Andric 351*700637cbSDimitry Andric} 352*700637cbSDimitry Andric 353*700637cbSDimitry Andrictemplate <class ForwardIterator> 354*700637cbSDimitry Andric void uninitialized_default_construct(ForwardIterator first, ForwardIterator last); 355*700637cbSDimitry Andric 356*700637cbSDimitry Andricnamespace ranges { 357*700637cbSDimitry Andric 358*700637cbSDimitry Andrictemplate <nothrow-forward-iterator ForwardIterator, nothrow-sentinel-for<ForwardIterator> Sentinel> 359*700637cbSDimitry Andric requires default_initializable<iter_value_t<ForwardIterator>> 360*700637cbSDimitry Andric ForwardIterator uninitialized_default_construct(ForwardIterator first, Sentinel last); // since C++20 361*700637cbSDimitry Andric 362*700637cbSDimitry Andrictemplate <nothrow-forward-range ForwardRange> 363*700637cbSDimitry Andric requires default_initializable<range_value_t<ForwardRange>> 364*700637cbSDimitry Andric borrowed_iterator_t<ForwardRange> uninitialized_default_construct(ForwardRange&& r); // since C++20 365*700637cbSDimitry Andric 366*700637cbSDimitry Andric} 367*700637cbSDimitry Andric 368*700637cbSDimitry Andrictemplate <class ForwardIterator, class Size> 369*700637cbSDimitry Andric ForwardIterator uninitialized_default_construct_n(ForwardIterator first, Size n); 370*700637cbSDimitry Andric 371*700637cbSDimitry Andricnamespace ranges { 372*700637cbSDimitry Andric 373*700637cbSDimitry Andrictemplate <nothrow-forward-iterator ForwardIterator> 374*700637cbSDimitry Andric requires default_initializable<iter_value_t<ForwardIterator>> 375*700637cbSDimitry Andric ForwardIterator uninitialized_default_construct_n(ForwardIterator first, iter_difference_t<ForwardIterator> n); // since C++20 376*700637cbSDimitry Andric 377*700637cbSDimitry Andric} 378*700637cbSDimitry Andric 379*700637cbSDimitry Andrictemplate <class Y> struct auto_ptr_ref {}; // deprecated in C++11, removed in C++17 380*700637cbSDimitry Andric 381*700637cbSDimitry Andrictemplate<class X> 382*700637cbSDimitry Andricclass auto_ptr // deprecated in C++11, removed in C++17 383*700637cbSDimitry Andric{ 384*700637cbSDimitry Andricpublic: 385*700637cbSDimitry Andric typedef X element_type; 386*700637cbSDimitry Andric 387*700637cbSDimitry Andric explicit auto_ptr(X* p =0) throw(); 388*700637cbSDimitry Andric auto_ptr(auto_ptr&) throw(); 389*700637cbSDimitry Andric template<class Y> auto_ptr(auto_ptr<Y>&) throw(); 390*700637cbSDimitry Andric auto_ptr& operator=(auto_ptr&) throw(); 391*700637cbSDimitry Andric template<class Y> auto_ptr& operator=(auto_ptr<Y>&) throw(); 392*700637cbSDimitry Andric auto_ptr& operator=(auto_ptr_ref<X> r) throw(); 393*700637cbSDimitry Andric ~auto_ptr() throw(); 394*700637cbSDimitry Andric 395*700637cbSDimitry Andric typename add_lvalue_reference<X>::type operator*() const throw(); 396*700637cbSDimitry Andric X* operator->() const throw(); 397*700637cbSDimitry Andric X* get() const throw(); 398*700637cbSDimitry Andric X* release() throw(); 399*700637cbSDimitry Andric void reset(X* p =0) throw(); 400*700637cbSDimitry Andric 401*700637cbSDimitry Andric auto_ptr(auto_ptr_ref<X>) throw(); 402*700637cbSDimitry Andric template<class Y> operator auto_ptr_ref<Y>() throw(); 403*700637cbSDimitry Andric template<class Y> operator auto_ptr<Y>() throw(); 404*700637cbSDimitry Andric}; 405*700637cbSDimitry Andric 406*700637cbSDimitry Andrictemplate <class T> 407*700637cbSDimitry Andricstruct default_delete 408*700637cbSDimitry Andric{ 409*700637cbSDimitry Andric constexpr default_delete() noexcept = default; 410*700637cbSDimitry Andric template <class U> constexpr default_delete(const default_delete<U>&) noexcept; // constexpr since C++23 411*700637cbSDimitry Andric 412*700637cbSDimitry Andric constexpr void operator()(T*) const noexcept; // constexpr since C++23 413*700637cbSDimitry Andric}; 414*700637cbSDimitry Andric 415*700637cbSDimitry Andrictemplate <class T> 416*700637cbSDimitry Andricstruct default_delete<T[]> 417*700637cbSDimitry Andric{ 418*700637cbSDimitry Andric constexpr default_delete() noexcept = default; 419*700637cbSDimitry Andric template <class U> constexpr default_delete(const default_delete <U[]>&) noexcept; // constexpr since C++23 420*700637cbSDimitry Andric constexpr void operator()(T*) const noexcept; // constexpr since C++23 421*700637cbSDimitry Andric template <class U> void operator()(U*) const = delete; 422*700637cbSDimitry Andric}; 423*700637cbSDimitry Andric 424*700637cbSDimitry Andrictemplate <class T, class D = default_delete<T>> 425*700637cbSDimitry Andricclass unique_ptr 426*700637cbSDimitry Andric{ 427*700637cbSDimitry Andricpublic: 428*700637cbSDimitry Andric typedef see below pointer; 429*700637cbSDimitry Andric typedef T element_type; 430*700637cbSDimitry Andric typedef D deleter_type; 431*700637cbSDimitry Andric 432*700637cbSDimitry Andric // constructors 433*700637cbSDimitry Andric constexpr unique_ptr() noexcept; 434*700637cbSDimitry Andric constexpr explicit unique_ptr(pointer p) noexcept; // constexpr since C++23 435*700637cbSDimitry Andric constexpr unique_ptr(pointer p, see below d1) noexcept; // constexpr since C++23 436*700637cbSDimitry Andric constexpr unique_ptr(pointer p, see below d2) noexcept; // constexpr since C++23 437*700637cbSDimitry Andric constexpr unique_ptr(unique_ptr&& u) noexcept; // constexpr since C++23 438*700637cbSDimitry Andric constexpr unique_ptr(nullptr_t) noexcept : unique_ptr() { } 439*700637cbSDimitry Andric template <class U, class E> 440*700637cbSDimitry Andric constexpr unique_ptr(unique_ptr<U, E>&& u) noexcept; // constexpr since C++23 441*700637cbSDimitry Andric template <class U> 442*700637cbSDimitry Andric unique_ptr(auto_ptr<U>&& u) noexcept; // removed in C++17 443*700637cbSDimitry Andric 444*700637cbSDimitry Andric // destructor 445*700637cbSDimitry Andric constexpr ~unique_ptr(); // constexpr since C++23 446*700637cbSDimitry Andric 447*700637cbSDimitry Andric // assignment 448*700637cbSDimitry Andric constexpr unique_ptr& operator=(unique_ptr&& u) noexcept; // constexpr since C++23 449*700637cbSDimitry Andric template <class U, class E> 450*700637cbSDimitry Andric constexpr unique_ptr& operator=(unique_ptr<U, E>&& u) noexcept; // constexpr since C++23 451*700637cbSDimitry Andric constexpr unique_ptr& operator=(nullptr_t) noexcept; // constexpr since C++23 452*700637cbSDimitry Andric 453*700637cbSDimitry Andric // observers 454*700637cbSDimitry Andric constexpr 455*700637cbSDimitry Andric add_lvalue_reference<T>::type operator*() const noexcept(see below); // constexpr since C++23 456*700637cbSDimitry Andric constexpr pointer operator->() const noexcept; // constexpr since C++23 457*700637cbSDimitry Andric constexpr pointer get() const noexcept; // constexpr since C++23 458*700637cbSDimitry Andric constexpr deleter_type& get_deleter() noexcept; // constexpr since C++23 459*700637cbSDimitry Andric constexpr const deleter_type& get_deleter() const noexcept; // constexpr since C++23 460*700637cbSDimitry Andric constexpr explicit operator bool() const noexcept; // constexpr since C++23 461*700637cbSDimitry Andric 462*700637cbSDimitry Andric // modifiers 463*700637cbSDimitry Andric constexpr pointer release() noexcept; // constexpr since C++23 464*700637cbSDimitry Andric constexpr void reset(pointer p = pointer()) noexcept; // constexpr since C++23 465*700637cbSDimitry Andric constexpr void swap(unique_ptr& u) noexcept; // constexpr since C++23 466*700637cbSDimitry Andric}; 467*700637cbSDimitry Andric 468*700637cbSDimitry Andrictemplate <class T, class D> 469*700637cbSDimitry Andricclass unique_ptr<T[], D> 470*700637cbSDimitry Andric{ 471*700637cbSDimitry Andricpublic: 472*700637cbSDimitry Andric typedef implementation-defined pointer; 473*700637cbSDimitry Andric typedef T element_type; 474*700637cbSDimitry Andric typedef D deleter_type; 475*700637cbSDimitry Andric 476*700637cbSDimitry Andric // constructors 477*700637cbSDimitry Andric constexpr unique_ptr() noexcept; 478*700637cbSDimitry Andric constexpr explicit unique_ptr(pointer p) noexcept; // constexpr since C++23 479*700637cbSDimitry Andric constexpr unique_ptr(pointer p, see below d) noexcept; // constexpr since C++23 480*700637cbSDimitry Andric constexpr unique_ptr(pointer p, see below d) noexcept; // constexpr since C++23 481*700637cbSDimitry Andric constexpr unique_ptr(unique_ptr&& u) noexcept; // constexpr since C++23 482*700637cbSDimitry Andric template <class U, class E> 483*700637cbSDimitry Andric constexpr unique_ptr(unique_ptr <U, E>&& u) noexcept; // constexpr since C++23 484*700637cbSDimitry Andric constexpr unique_ptr(nullptr_t) noexcept : unique_ptr() { } 485*700637cbSDimitry Andric 486*700637cbSDimitry Andric // destructor 487*700637cbSDimitry Andric constexpr ~unique_ptr(); // constexpr since C++23 488*700637cbSDimitry Andric 489*700637cbSDimitry Andric // assignment 490*700637cbSDimitry Andric constexpr unique_ptr& operator=(unique_ptr&& u) noexcept; // constexpr since C++23 491*700637cbSDimitry Andric template <class U, class E> 492*700637cbSDimitry Andric constexpr unique_ptr& operator=(unique_ptr <U, E>&& u) noexcept; // constexpr since C++23 493*700637cbSDimitry Andric constexpr unique_ptr& operator=(nullptr_t) noexcept; // constexpr since C++23 494*700637cbSDimitry Andric 495*700637cbSDimitry Andric // observers 496*700637cbSDimitry Andric constexpr T& operator[](size_t i) const; // constexpr since C++23 497*700637cbSDimitry Andric constexpr pointer get() const noexcept; // constexpr since C++23 498*700637cbSDimitry Andric constexpr deleter_type& get_deleter() noexcept; // constexpr since C++23 499*700637cbSDimitry Andric constexpr const deleter_type& get_deleter() const noexcept; // constexpr since C++23 500*700637cbSDimitry Andric constexpr explicit operator bool() const noexcept; // constexpr since C++23 501*700637cbSDimitry Andric 502*700637cbSDimitry Andric // modifiers 503*700637cbSDimitry Andric constexpr pointer release() noexcept; // constexpr since C++23 504*700637cbSDimitry Andric constexpr void reset(pointer p = pointer()) noexcept; // constexpr since C++23 505*700637cbSDimitry Andric constexpr void reset(nullptr_t) noexcept; // constexpr since C++23 506*700637cbSDimitry Andric template <class U> void reset(U) = delete; 507*700637cbSDimitry Andric constexpr void swap(unique_ptr& u) noexcept; // constexpr since C++23 508*700637cbSDimitry Andric}; 509*700637cbSDimitry Andric 510*700637cbSDimitry Andrictemplate <class T, class D> 511*700637cbSDimitry Andric constexpr void swap(unique_ptr<T, D>& x, unique_ptr<T, D>& y) noexcept; // constexpr since C++23 512*700637cbSDimitry Andric 513*700637cbSDimitry Andrictemplate <class T1, class D1, class T2, class D2> 514*700637cbSDimitry Andric constexpr bool operator==(const unique_ptr<T1, D1>& x, const unique_ptr<T2, D2>& y); // constexpr since C++23 515*700637cbSDimitry Andrictemplate <class T1, class D1, class T2, class D2> 516*700637cbSDimitry Andric bool operator!=(const unique_ptr<T1, D1>& x, const unique_ptr<T2, D2>& y); // removed in C++20 517*700637cbSDimitry Andrictemplate <class T1, class D1, class T2, class D2> 518*700637cbSDimitry Andric bool operator<(const unique_ptr<T1, D1>& x, const unique_ptr<T2, D2>& y); 519*700637cbSDimitry Andrictemplate <class T1, class D1, class T2, class D2> 520*700637cbSDimitry Andric bool operator<=(const unique_ptr<T1, D1>& x, const unique_ptr<T2, D2>& y); 521*700637cbSDimitry Andrictemplate <class T1, class D1, class T2, class D2> 522*700637cbSDimitry Andric bool operator>(const unique_ptr<T1, D1>& x, const unique_ptr<T2, D2>& y); 523*700637cbSDimitry Andrictemplate <class T1, class D1, class T2, class D2> 524*700637cbSDimitry Andric bool operator>=(const unique_ptr<T1, D1>& x, const unique_ptr<T2, D2>& y); 525*700637cbSDimitry Andrictemplate<class T1, class D1, class T2, class D2> 526*700637cbSDimitry Andric requires three_way_comparable_with<typename unique_ptr<T1, D1>::pointer, 527*700637cbSDimitry Andric typename unique_ptr<T2, D2>::pointer> 528*700637cbSDimitry Andric compare_three_way_result_t<typename unique_ptr<T1, D1>::pointer, 529*700637cbSDimitry Andric typename unique_ptr<T2, D2>::pointer> 530*700637cbSDimitry Andric operator<=>(const unique_ptr<T1, D1>& x, const unique_ptr<T2, D2>& y); // C++20 531*700637cbSDimitry Andric 532*700637cbSDimitry Andrictemplate <class T, class D> 533*700637cbSDimitry Andric constexpr bool operator==(const unique_ptr<T, D>& x, nullptr_t) noexcept; // constexpr since C++23 534*700637cbSDimitry Andrictemplate <class T, class D> 535*700637cbSDimitry Andric bool operator==(nullptr_t, const unique_ptr<T, D>& y) noexcept; // removed in C++20 536*700637cbSDimitry Andrictemplate <class T, class D> 537*700637cbSDimitry Andric bool operator!=(const unique_ptr<T, D>& x, nullptr_t) noexcept; // removed in C++20 538*700637cbSDimitry Andrictemplate <class T, class D> 539*700637cbSDimitry Andric bool operator!=(nullptr_t, const unique_ptr<T, D>& y) noexcept; // removed in C++20 540*700637cbSDimitry Andric 541*700637cbSDimitry Andrictemplate <class T, class D> 542*700637cbSDimitry Andric constexpr bool operator<(const unique_ptr<T, D>& x, nullptr_t); // constexpr since C++23 543*700637cbSDimitry Andrictemplate <class T, class D> 544*700637cbSDimitry Andric constexpr bool operator<(nullptr_t, const unique_ptr<T, D>& y); // constexpr since C++23 545*700637cbSDimitry Andrictemplate <class T, class D> 546*700637cbSDimitry Andric constexpr bool operator<=(const unique_ptr<T, D>& x, nullptr_t); // constexpr since C++23 547*700637cbSDimitry Andrictemplate <class T, class D> 548*700637cbSDimitry Andric constexpr bool operator<=(nullptr_t, const unique_ptr<T, D>& y); // constexpr since C++23 549*700637cbSDimitry Andrictemplate <class T, class D> 550*700637cbSDimitry Andric constexpr bool operator>(const unique_ptr<T, D>& x, nullptr_t); // constexpr since C++23 551*700637cbSDimitry Andrictemplate <class T, class D> 552*700637cbSDimitry Andric constexpr bool operator>(nullptr_t, const unique_ptr<T, D>& y); // constexpr since C++23 553*700637cbSDimitry Andrictemplate <class T, class D> 554*700637cbSDimitry Andric constexpr bool operator>=(const unique_ptr<T, D>& x, nullptr_t); // constexpr since C++23 555*700637cbSDimitry Andrictemplate <class T, class D> 556*700637cbSDimitry Andric constexpr bool operator>=(nullptr_t, const unique_ptr<T, D>& y); // constexpr since C++23 557*700637cbSDimitry Andrictemplate<class T, class D> 558*700637cbSDimitry Andric requires three_way_comparable<typename unique_ptr<T, D>::pointer> 559*700637cbSDimitry Andric compare_three_way_result_t<typename unique_ptr<T, D>::pointer> 560*700637cbSDimitry Andric constexpr operator<=>(const unique_ptr<T, D>& x, nullptr_t); // C++20, constexpr since C++23 561*700637cbSDimitry Andric 562*700637cbSDimitry Andricclass bad_weak_ptr 563*700637cbSDimitry Andric : public std::exception 564*700637cbSDimitry Andric{ 565*700637cbSDimitry Andric bad_weak_ptr() noexcept; 566*700637cbSDimitry Andric}; 567*700637cbSDimitry Andric 568*700637cbSDimitry Andrictemplate<class T, class... Args> 569*700637cbSDimitry Andricconstexpr unique_ptr<T> make_unique(Args&&... args); // C++14, constexpr since C++23 570*700637cbSDimitry Andrictemplate<class T> 571*700637cbSDimitry Andricconstexpr unique_ptr<T> make_unique(size_t n); // C++14, constexpr since C++23 572*700637cbSDimitry Andrictemplate<class T, class... Args> unspecified make_unique(Args&&...) = delete; // C++14, T == U[N] 573*700637cbSDimitry Andric 574*700637cbSDimitry Andrictemplate<class T> 575*700637cbSDimitry Andric constexpr unique_ptr<T> make_unique_for_overwrite(); // T is not array, C++20, constexpr since C++23 576*700637cbSDimitry Andrictemplate<class T> 577*700637cbSDimitry Andric constexpr unique_ptr<T> make_unique_for_overwrite(size_t n); // T is U[], C++20, constexpr since C++23 578*700637cbSDimitry Andrictemplate<class T, class... Args> 579*700637cbSDimitry Andric unspecified make_unique_for_overwrite(Args&&...) = delete; // T is U[N], C++20 580*700637cbSDimitry Andric 581*700637cbSDimitry Andrictemplate<class E, class T, class Y, class D> 582*700637cbSDimitry Andric basic_ostream<E, T>& operator<< (basic_ostream<E, T>& os, unique_ptr<Y, D> const& p); 583*700637cbSDimitry Andric 584*700637cbSDimitry Andrictemplate<class T> 585*700637cbSDimitry Andricclass shared_ptr 586*700637cbSDimitry Andric{ 587*700637cbSDimitry Andricpublic: 588*700637cbSDimitry Andric typedef T element_type; // until C++17 589*700637cbSDimitry Andric typedef remove_extent_t<T> element_type; // since C++17 590*700637cbSDimitry Andric typedef weak_ptr<T> weak_type; // C++17 591*700637cbSDimitry Andric 592*700637cbSDimitry Andric // constructors: 593*700637cbSDimitry Andric constexpr shared_ptr() noexcept; 594*700637cbSDimitry Andric template<class Y> explicit shared_ptr(Y* p); 595*700637cbSDimitry Andric template<class Y, class D> shared_ptr(Y* p, D d); 596*700637cbSDimitry Andric template<class Y, class D, class A> shared_ptr(Y* p, D d, A a); 597*700637cbSDimitry Andric template <class D> shared_ptr(nullptr_t p, D d); 598*700637cbSDimitry Andric template <class D, class A> shared_ptr(nullptr_t p, D d, A a); 599*700637cbSDimitry Andric template<class Y> shared_ptr(const shared_ptr<Y>& r, T *p) noexcept; 600*700637cbSDimitry Andric shared_ptr(const shared_ptr& r) noexcept; 601*700637cbSDimitry Andric template<class Y> shared_ptr(const shared_ptr<Y>& r) noexcept; 602*700637cbSDimitry Andric shared_ptr(shared_ptr&& r) noexcept; 603*700637cbSDimitry Andric template<class Y> shared_ptr(shared_ptr<Y>&& r) noexcept; 604*700637cbSDimitry Andric template<class Y> explicit shared_ptr(const weak_ptr<Y>& r); 605*700637cbSDimitry Andric template<class Y> shared_ptr(auto_ptr<Y>&& r); // removed in C++17 606*700637cbSDimitry Andric template <class Y, class D> shared_ptr(unique_ptr<Y, D>&& r); 607*700637cbSDimitry Andric shared_ptr(nullptr_t) : shared_ptr() { } 608*700637cbSDimitry Andric 609*700637cbSDimitry Andric // destructor: 610*700637cbSDimitry Andric ~shared_ptr(); 611*700637cbSDimitry Andric 612*700637cbSDimitry Andric // assignment: 613*700637cbSDimitry Andric shared_ptr& operator=(const shared_ptr& r) noexcept; 614*700637cbSDimitry Andric template<class Y> shared_ptr& operator=(const shared_ptr<Y>& r) noexcept; 615*700637cbSDimitry Andric shared_ptr& operator=(shared_ptr&& r) noexcept; 616*700637cbSDimitry Andric template<class Y> shared_ptr& operator=(shared_ptr<Y>&& r); 617*700637cbSDimitry Andric template<class Y> shared_ptr& operator=(auto_ptr<Y>&& r); // removed in C++17 618*700637cbSDimitry Andric template <class Y, class D> shared_ptr& operator=(unique_ptr<Y, D>&& r); 619*700637cbSDimitry Andric 620*700637cbSDimitry Andric // modifiers: 621*700637cbSDimitry Andric void swap(shared_ptr& r) noexcept; 622*700637cbSDimitry Andric void reset() noexcept; 623*700637cbSDimitry Andric template<class Y> void reset(Y* p); 624*700637cbSDimitry Andric template<class Y, class D> void reset(Y* p, D d); 625*700637cbSDimitry Andric template<class Y, class D, class A> void reset(Y* p, D d, A a); 626*700637cbSDimitry Andric 627*700637cbSDimitry Andric // observers: 628*700637cbSDimitry Andric T* get() const noexcept; 629*700637cbSDimitry Andric T& operator*() const noexcept; 630*700637cbSDimitry Andric T* operator->() const noexcept; 631*700637cbSDimitry Andric long use_count() const noexcept; 632*700637cbSDimitry Andric bool unique() const noexcept; // deprected in C++17, removed in C++20 633*700637cbSDimitry Andric explicit operator bool() const noexcept; 634*700637cbSDimitry Andric template<class U> bool owner_before(shared_ptr<U> const& b) const noexcept; 635*700637cbSDimitry Andric template<class U> bool owner_before(weak_ptr<U> const& b) const noexcept; 636*700637cbSDimitry Andric}; 637*700637cbSDimitry Andric 638*700637cbSDimitry Andrictemplate<class T> 639*700637cbSDimitry Andricshared_ptr(weak_ptr<T>) -> shared_ptr<T>; 640*700637cbSDimitry Andrictemplate<class T, class D> 641*700637cbSDimitry Andricshared_ptr(unique_ptr<T, D>) -> shared_ptr<T>; 642*700637cbSDimitry Andric 643*700637cbSDimitry Andric// shared_ptr comparisons: 644*700637cbSDimitry Andrictemplate<class T, class U> 645*700637cbSDimitry Andric bool operator==(shared_ptr<T> const& a, shared_ptr<U> const& b) noexcept; 646*700637cbSDimitry Andrictemplate<class T, class U> 647*700637cbSDimitry Andric bool operator!=(shared_ptr<T> const& a, shared_ptr<U> const& b) noexcept; // removed in C++20 648*700637cbSDimitry Andrictemplate<class T, class U> 649*700637cbSDimitry Andric bool operator<(shared_ptr<T> const& a, shared_ptr<U> const& b) noexcept; // removed in C++20 650*700637cbSDimitry Andrictemplate<class T, class U> 651*700637cbSDimitry Andric bool operator>(shared_ptr<T> const& a, shared_ptr<U> const& b) noexcept; // removed in C++20 652*700637cbSDimitry Andrictemplate<class T, class U> 653*700637cbSDimitry Andric bool operator<=(shared_ptr<T> const& a, shared_ptr<U> const& b) noexcept; // removed in C++20 654*700637cbSDimitry Andrictemplate<class T, class U> 655*700637cbSDimitry Andric bool operator>=(shared_ptr<T> const& a, shared_ptr<U> const& b) noexcept; // removed in C++20 656*700637cbSDimitry Andrictemplate<class T, class U> 657*700637cbSDimitry Andric strong_ordering operator<=>(shared_ptr<T> const& a, shared_ptr<U> const& b) noexcept; // C++20 658*700637cbSDimitry Andric 659*700637cbSDimitry Andrictemplate <class T> 660*700637cbSDimitry Andric bool operator==(const shared_ptr<T>& x, nullptr_t) noexcept; 661*700637cbSDimitry Andrictemplate <class T> 662*700637cbSDimitry Andric bool operator==(nullptr_t, const shared_ptr<T>& y) noexcept; // removed in C++20 663*700637cbSDimitry Andrictemplate <class T> 664*700637cbSDimitry Andric bool operator!=(const shared_ptr<T>& x, nullptr_t) noexcept; // removed in C++20 665*700637cbSDimitry Andrictemplate <class T> 666*700637cbSDimitry Andric bool operator!=(nullptr_t, const shared_ptr<T>& y) noexcept; // removed in C++20 667*700637cbSDimitry Andrictemplate <class T> 668*700637cbSDimitry Andric bool operator<(const shared_ptr<T>& x, nullptr_t) noexcept; // removed in C++20 669*700637cbSDimitry Andrictemplate <class T> 670*700637cbSDimitry Andric bool operator<(nullptr_t, const shared_ptr<T>& y) noexcept; // removed in C++20 671*700637cbSDimitry Andrictemplate <class T> 672*700637cbSDimitry Andric bool operator<=(const shared_ptr<T>& x, nullptr_t) noexcept; // removed in C++20 673*700637cbSDimitry Andrictemplate <class T> 674*700637cbSDimitry Andric bool operator<=(nullptr_t, const shared_ptr<T>& y) noexcept; // removed in C++20 675*700637cbSDimitry Andrictemplate <class T> 676*700637cbSDimitry Andric bool operator>(const shared_ptr<T>& x, nullptr_t) noexcept; // removed in C++20 677*700637cbSDimitry Andrictemplate <class T> 678*700637cbSDimitry Andric bool operator>(nullptr_t, const shared_ptr<T>& y) noexcept; // removed in C++20 679*700637cbSDimitry Andrictemplate <class T> 680*700637cbSDimitry Andric bool operator>=(const shared_ptr<T>& x, nullptr_t) noexcept; // removed in C++20 681*700637cbSDimitry Andrictemplate <class T> 682*700637cbSDimitry Andric bool operator>=(nullptr_t, const shared_ptr<T>& y) noexcept; // removed in C++20 683*700637cbSDimitry Andrictemplate<class T> 684*700637cbSDimitry Andric strong_ordering operator<=>(shared_ptr<T> const& x, nullptr_t) noexcept; // C++20 685*700637cbSDimitry Andric 686*700637cbSDimitry Andric// shared_ptr specialized algorithms: 687*700637cbSDimitry Andrictemplate<class T> void swap(shared_ptr<T>& a, shared_ptr<T>& b) noexcept; 688*700637cbSDimitry Andric 689*700637cbSDimitry Andric// shared_ptr casts: 690*700637cbSDimitry Andrictemplate<class T, class U> 691*700637cbSDimitry Andric shared_ptr<T> static_pointer_cast(shared_ptr<U> const& r) noexcept; 692*700637cbSDimitry Andrictemplate<class T, class U> 693*700637cbSDimitry Andric shared_ptr<T> dynamic_pointer_cast(shared_ptr<U> const& r) noexcept; 694*700637cbSDimitry Andrictemplate<class T, class U> 695*700637cbSDimitry Andric shared_ptr<T> const_pointer_cast(shared_ptr<U> const& r) noexcept; 696*700637cbSDimitry Andric 697*700637cbSDimitry Andric// shared_ptr I/O: 698*700637cbSDimitry Andrictemplate<class E, class T, class Y> 699*700637cbSDimitry Andric basic_ostream<E, T>& operator<< (basic_ostream<E, T>& os, shared_ptr<Y> const& p); 700*700637cbSDimitry Andric 701*700637cbSDimitry Andric// shared_ptr get_deleter: 702*700637cbSDimitry Andrictemplate<class D, class T> D* get_deleter(shared_ptr<T> const& p) noexcept; 703*700637cbSDimitry Andric 704*700637cbSDimitry Andrictemplate<class T, class... Args> 705*700637cbSDimitry Andric shared_ptr<T> make_shared(Args&&... args); // T is not an array 706*700637cbSDimitry Andrictemplate<class T, class A, class... Args> 707*700637cbSDimitry Andric shared_ptr<T> allocate_shared(const A& a, Args&&... args); // T is not an array 708*700637cbSDimitry Andric 709*700637cbSDimitry Andrictemplate<class T> 710*700637cbSDimitry Andric shared_ptr<T> make_shared(size_t N); // T is U[] (since C++20) 711*700637cbSDimitry Andrictemplate<class T, class A> 712*700637cbSDimitry Andric shared_ptr<T> allocate_shared(const A& a, size_t N); // T is U[] (since C++20) 713*700637cbSDimitry Andric 714*700637cbSDimitry Andrictemplate<class T> 715*700637cbSDimitry Andric shared_ptr<T> make_shared(); // T is U[N] (since C++20) 716*700637cbSDimitry Andrictemplate<class T, class A> 717*700637cbSDimitry Andric shared_ptr<T> allocate_shared(const A& a); // T is U[N] (since C++20) 718*700637cbSDimitry Andric 719*700637cbSDimitry Andrictemplate<class T> 720*700637cbSDimitry Andric shared_ptr<T> make_shared(size_t N, const remove_extent_t<T>& u); // T is U[] (since C++20) 721*700637cbSDimitry Andrictemplate<class T, class A> 722*700637cbSDimitry Andric shared_ptr<T> allocate_shared(const A& a, size_t N, const remove_extent_t<T>& u); // T is U[] (since C++20) 723*700637cbSDimitry Andric 724*700637cbSDimitry Andrictemplate<class T> shared_ptr<T> 725*700637cbSDimitry Andric make_shared(const remove_extent_t<T>& u); // T is U[N] (since C++20) 726*700637cbSDimitry Andrictemplate<class T, class A> 727*700637cbSDimitry Andric shared_ptr<T> allocate_shared(const A& a, const remove_extent_t<T>& u); // T is U[N] (since C++20) 728*700637cbSDimitry Andric 729*700637cbSDimitry Andrictemplate<class T> 730*700637cbSDimitry Andric shared_ptr<T> make_shared_for_overwrite(); // T is not U[], C++20 731*700637cbSDimitry Andrictemplate<class T, class A> 732*700637cbSDimitry Andric shared_ptr<T> allocate_shared_for_overwrite(const A& a); // T is not U[], C++20 733*700637cbSDimitry Andric 734*700637cbSDimitry Andrictemplate<class T> 735*700637cbSDimitry Andric shared_ptr<T> make_shared_for_overwrite(size_t N); // T is U[], C++20 736*700637cbSDimitry Andrictemplate<class T, class A> 737*700637cbSDimitry Andric shared_ptr<T> allocate_shared_for_overwrite(const A& a, size_t N); // T is U[], C++20 738*700637cbSDimitry Andric 739*700637cbSDimitry Andrictemplate<class T> 740*700637cbSDimitry Andricclass weak_ptr 741*700637cbSDimitry Andric{ 742*700637cbSDimitry Andricpublic: 743*700637cbSDimitry Andric typedef T element_type; // until C++17 744*700637cbSDimitry Andric typedef remove_extent_t<T> element_type; // since C++17 745*700637cbSDimitry Andric 746*700637cbSDimitry Andric // constructors 747*700637cbSDimitry Andric constexpr weak_ptr() noexcept; 748*700637cbSDimitry Andric template<class Y> weak_ptr(shared_ptr<Y> const& r) noexcept; 749*700637cbSDimitry Andric weak_ptr(weak_ptr const& r) noexcept; 750*700637cbSDimitry Andric template<class Y> weak_ptr(weak_ptr<Y> const& r) noexcept; 751*700637cbSDimitry Andric weak_ptr(weak_ptr&& r) noexcept; // C++14 752*700637cbSDimitry Andric template<class Y> weak_ptr(weak_ptr<Y>&& r) noexcept; // C++14 753*700637cbSDimitry Andric 754*700637cbSDimitry Andric // destructor 755*700637cbSDimitry Andric ~weak_ptr(); 756*700637cbSDimitry Andric 757*700637cbSDimitry Andric // assignment 758*700637cbSDimitry Andric weak_ptr& operator=(weak_ptr const& r) noexcept; 759*700637cbSDimitry Andric template<class Y> weak_ptr& operator=(weak_ptr<Y> const& r) noexcept; 760*700637cbSDimitry Andric template<class Y> weak_ptr& operator=(shared_ptr<Y> const& r) noexcept; 761*700637cbSDimitry Andric weak_ptr& operator=(weak_ptr&& r) noexcept; // C++14 762*700637cbSDimitry Andric template<class Y> weak_ptr& operator=(weak_ptr<Y>&& r) noexcept; // C++14 763*700637cbSDimitry Andric 764*700637cbSDimitry Andric // modifiers 765*700637cbSDimitry Andric void swap(weak_ptr& r) noexcept; 766*700637cbSDimitry Andric void reset() noexcept; 767*700637cbSDimitry Andric 768*700637cbSDimitry Andric // observers 769*700637cbSDimitry Andric long use_count() const noexcept; 770*700637cbSDimitry Andric bool expired() const noexcept; 771*700637cbSDimitry Andric shared_ptr<T> lock() const noexcept; 772*700637cbSDimitry Andric template<class U> bool owner_before(shared_ptr<U> const& b) const noexcept; 773*700637cbSDimitry Andric template<class U> bool owner_before(weak_ptr<U> const& b) const noexcept; 774*700637cbSDimitry Andric}; 775*700637cbSDimitry Andric 776*700637cbSDimitry Andrictemplate<class T> 777*700637cbSDimitry Andricweak_ptr(shared_ptr<T>) -> weak_ptr<T>; 778*700637cbSDimitry Andric 779*700637cbSDimitry Andric// weak_ptr specialized algorithms: 780*700637cbSDimitry Andrictemplate<class T> void swap(weak_ptr<T>& a, weak_ptr<T>& b) noexcept; 781*700637cbSDimitry Andric 782*700637cbSDimitry Andric// class owner_less: 783*700637cbSDimitry Andrictemplate<class T> struct owner_less; 784*700637cbSDimitry Andric 785*700637cbSDimitry Andrictemplate<class T> 786*700637cbSDimitry Andricstruct owner_less<shared_ptr<T> > 787*700637cbSDimitry Andric : binary_function<shared_ptr<T>, shared_ptr<T>, bool> 788*700637cbSDimitry Andric{ 789*700637cbSDimitry Andric typedef bool result_type; 790*700637cbSDimitry Andric bool operator()(shared_ptr<T> const&, shared_ptr<T> const&) const noexcept; 791*700637cbSDimitry Andric bool operator()(shared_ptr<T> const&, weak_ptr<T> const&) const noexcept; 792*700637cbSDimitry Andric bool operator()(weak_ptr<T> const&, shared_ptr<T> const&) const noexcept; 793*700637cbSDimitry Andric}; 794*700637cbSDimitry Andric 795*700637cbSDimitry Andrictemplate<class T> 796*700637cbSDimitry Andricstruct owner_less<weak_ptr<T> > 797*700637cbSDimitry Andric : binary_function<weak_ptr<T>, weak_ptr<T>, bool> 798*700637cbSDimitry Andric{ 799*700637cbSDimitry Andric typedef bool result_type; 800*700637cbSDimitry Andric bool operator()(weak_ptr<T> const&, weak_ptr<T> const&) const noexcept; 801*700637cbSDimitry Andric bool operator()(shared_ptr<T> const&, weak_ptr<T> const&) const noexcept; 802*700637cbSDimitry Andric bool operator()(weak_ptr<T> const&, shared_ptr<T> const&) const noexcept; 803*700637cbSDimitry Andric}; 804*700637cbSDimitry Andric 805*700637cbSDimitry Andrictemplate <> // Added in C++14 806*700637cbSDimitry Andricstruct owner_less<void> 807*700637cbSDimitry Andric{ 808*700637cbSDimitry Andric template <class _Tp, class _Up> 809*700637cbSDimitry Andric bool operator()( shared_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const noexcept; 810*700637cbSDimitry Andric template <class _Tp, class _Up> 811*700637cbSDimitry Andric bool operator()( shared_ptr<_Tp> const& __x, weak_ptr<_Up> const& __y) const noexcept; 812*700637cbSDimitry Andric template <class _Tp, class _Up> 813*700637cbSDimitry Andric bool operator()( weak_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const noexcept; 814*700637cbSDimitry Andric template <class _Tp, class _Up> 815*700637cbSDimitry Andric bool operator()( weak_ptr<_Tp> const& __x, weak_ptr<_Up> const& __y) const noexcept; 816*700637cbSDimitry Andric 817*700637cbSDimitry Andric typedef void is_transparent; 818*700637cbSDimitry Andric}; 819*700637cbSDimitry Andric 820*700637cbSDimitry Andrictemplate<class T> 821*700637cbSDimitry Andricclass enable_shared_from_this 822*700637cbSDimitry Andric{ 823*700637cbSDimitry Andricprotected: 824*700637cbSDimitry Andric constexpr enable_shared_from_this() noexcept; 825*700637cbSDimitry Andric enable_shared_from_this(enable_shared_from_this const&) noexcept; 826*700637cbSDimitry Andric enable_shared_from_this& operator=(enable_shared_from_this const&) noexcept; 827*700637cbSDimitry Andric ~enable_shared_from_this(); 828*700637cbSDimitry Andricpublic: 829*700637cbSDimitry Andric shared_ptr<T> shared_from_this(); 830*700637cbSDimitry Andric shared_ptr<T const> shared_from_this() const; 831*700637cbSDimitry Andric}; 832*700637cbSDimitry Andric 833*700637cbSDimitry Andrictemplate<class T> 834*700637cbSDimitry Andric bool atomic_is_lock_free(const shared_ptr<T>* p); 835*700637cbSDimitry Andrictemplate<class T> 836*700637cbSDimitry Andric shared_ptr<T> atomic_load(const shared_ptr<T>* p); 837*700637cbSDimitry Andrictemplate<class T> 838*700637cbSDimitry Andric shared_ptr<T> atomic_load_explicit(const shared_ptr<T>* p, memory_order mo); 839*700637cbSDimitry Andrictemplate<class T> 840*700637cbSDimitry Andric void atomic_store(shared_ptr<T>* p, shared_ptr<T> r); 841*700637cbSDimitry Andrictemplate<class T> 842*700637cbSDimitry Andric void atomic_store_explicit(shared_ptr<T>* p, shared_ptr<T> r, memory_order mo); 843*700637cbSDimitry Andrictemplate<class T> 844*700637cbSDimitry Andric shared_ptr<T> atomic_exchange(shared_ptr<T>* p, shared_ptr<T> r); 845*700637cbSDimitry Andrictemplate<class T> 846*700637cbSDimitry Andric shared_ptr<T> 847*700637cbSDimitry Andric atomic_exchange_explicit(shared_ptr<T>* p, shared_ptr<T> r, memory_order mo); 848*700637cbSDimitry Andrictemplate<class T> 849*700637cbSDimitry Andric bool 850*700637cbSDimitry Andric atomic_compare_exchange_weak(shared_ptr<T>* p, shared_ptr<T>* v, shared_ptr<T> w); 851*700637cbSDimitry Andrictemplate<class T> 852*700637cbSDimitry Andric bool 853*700637cbSDimitry Andric atomic_compare_exchange_strong( shared_ptr<T>* p, shared_ptr<T>* v, shared_ptr<T> w); 854*700637cbSDimitry Andrictemplate<class T> 855*700637cbSDimitry Andric bool 856*700637cbSDimitry Andric atomic_compare_exchange_weak_explicit(shared_ptr<T>* p, shared_ptr<T>* v, 857*700637cbSDimitry Andric shared_ptr<T> w, memory_order success, 858*700637cbSDimitry Andric memory_order failure); 859*700637cbSDimitry Andrictemplate<class T> 860*700637cbSDimitry Andric bool 861*700637cbSDimitry Andric atomic_compare_exchange_strong_explicit(shared_ptr<T>* p, shared_ptr<T>* v, 862*700637cbSDimitry Andric shared_ptr<T> w, memory_order success, 863*700637cbSDimitry Andric memory_order failure); 864*700637cbSDimitry Andric// Hash support 865*700637cbSDimitry Andrictemplate <class T> struct hash; 866*700637cbSDimitry Andrictemplate <class T, class D> struct hash<unique_ptr<T, D> >; 867*700637cbSDimitry Andrictemplate <class T> struct hash<shared_ptr<T> >; 868*700637cbSDimitry Andric 869*700637cbSDimitry Andrictemplate <class T, class Alloc> 870*700637cbSDimitry Andric inline constexpr bool uses_allocator_v = uses_allocator<T, Alloc>::value; 871*700637cbSDimitry Andric 872*700637cbSDimitry Andric// [allocator.uses.construction], uses-allocator construction 873*700637cbSDimitry Andrictemplate<class T, class Alloc, class... Args> 874*700637cbSDimitry Andric constexpr auto uses_allocator_construction_args(const Alloc& alloc, // since C++20 875*700637cbSDimitry Andric Args&&... args) noexcept; 876*700637cbSDimitry Andrictemplate<class T, class Alloc, class Tuple1, class Tuple2> 877*700637cbSDimitry Andric constexpr auto uses_allocator_construction_args(const Alloc& alloc, // since C++20 878*700637cbSDimitry Andric piecewise_construct_t, 879*700637cbSDimitry Andric Tuple1&& x, Tuple2&& y) noexcept; 880*700637cbSDimitry Andrictemplate<class T, class Alloc> 881*700637cbSDimitry Andric constexpr auto uses_allocator_construction_args(const Alloc& alloc) noexcept; // since C++20 882*700637cbSDimitry Andrictemplate<class T, class Alloc, class U, class V> 883*700637cbSDimitry Andric constexpr auto uses_allocator_construction_args(const Alloc& alloc, // since C++20 884*700637cbSDimitry Andric U&& u, V&& v) noexcept; 885*700637cbSDimitry Andrictemplate<class T, class Alloc, class U, class V> 886*700637cbSDimitry Andric constexpr auto uses_allocator_construction_args(const Alloc& alloc, // since C++23 887*700637cbSDimitry Andric pair<U, V>& pr) noexcept; 888*700637cbSDimitry Andrictemplate<class T, class Alloc, class U, class V> 889*700637cbSDimitry Andric constexpr auto uses_allocator_construction_args(const Alloc& alloc, // since C++20 890*700637cbSDimitry Andric const pair<U, V>& pr) noexcept; 891*700637cbSDimitry Andrictemplate<class T, class Alloc, class U, class V> 892*700637cbSDimitry Andric constexpr auto uses_allocator_construction_args(const Alloc& alloc, // since C++20 893*700637cbSDimitry Andric pair<U, V>&& pr) noexcept; 894*700637cbSDimitry Andrictemplate<class T, class Alloc, class U, class V> 895*700637cbSDimitry Andric constexpr auto uses_allocator_construction_args(const Alloc& alloc, // since C++23 896*700637cbSDimitry Andric const pair<U, V>&& pr) noexcept; 897*700637cbSDimitry Andrictemplate<class T, class Alloc, pair-like P> 898*700637cbSDimitry Andric constexpr auto uses_allocator_construction_args(const Alloc& alloc, // since C++20 899*700637cbSDimitry Andric P&& p) noexcept; 900*700637cbSDimitry Andrictemplate<class T, class Alloc, class U> 901*700637cbSDimitry Andric constexpr auto uses_allocator_construction_args(const Alloc& alloc, // since C++20 902*700637cbSDimitry Andric U&& u) noexcept; 903*700637cbSDimitry Andrictemplate<class T, class Alloc, class... Args> 904*700637cbSDimitry Andric constexpr T make_obj_using_allocator(const Alloc& alloc, Args&&... args); // since C++20 905*700637cbSDimitry Andrictemplate<class T, class Alloc, class... Args> 906*700637cbSDimitry Andric constexpr T* uninitialized_construct_using_allocator(T* p, // since C++20 907*700637cbSDimitry Andric const Alloc& alloc, Args&&... args); 908*700637cbSDimitry Andric 909*700637cbSDimitry Andric// [ptr.align] 910*700637cbSDimitry Andricvoid* align(size_t alignment, size_t size, void*& ptr, size_t& space); 911*700637cbSDimitry Andric 912*700637cbSDimitry Andrictemplate<size_t N, class T> 913*700637cbSDimitry Andric[[nodiscard]] constexpr T* assume_aligned(T* ptr); // since C++20 914*700637cbSDimitry Andric 915*700637cbSDimitry Andric// [out.ptr.t], class template out_ptr_t 916*700637cbSDimitry Andrictemplate<class Smart, class Pointer, class... Args> 917*700637cbSDimitry Andric class out_ptr_t; // since c++23 918*700637cbSDimitry Andric 919*700637cbSDimitry Andric// [out.ptr], function template out_ptr 920*700637cbSDimitry Andrictemplate<class Pointer = void, class Smart, class... Args> 921*700637cbSDimitry Andric auto out_ptr(Smart& s, Args&&... args); // since c++23 922*700637cbSDimitry Andric 923*700637cbSDimitry Andric// [inout.ptr.t], class template inout_ptr_t 924*700637cbSDimitry Andrictemplate<class Smart, class Pointer, class... Args> 925*700637cbSDimitry Andric class inout_ptr_t; // since c++23 926*700637cbSDimitry Andric 927*700637cbSDimitry Andric// [inout.ptr], function template inout_ptr 928*700637cbSDimitry Andrictemplate<class Pointer = void, class Smart, class... Args> 929*700637cbSDimitry Andric auto inout_ptr(Smart& s, Args&&... args); // since c++23 930*700637cbSDimitry Andric 931*700637cbSDimitry Andric} // std 932*700637cbSDimitry Andric 933*700637cbSDimitry Andric*/ 934*700637cbSDimitry Andric 935*700637cbSDimitry Andric// clang-format on 936*700637cbSDimitry Andric 937*700637cbSDimitry Andric#include <__cxx03/__config> 938*700637cbSDimitry Andric#include <__cxx03/__memory/addressof.h> 939*700637cbSDimitry Andric#include <__cxx03/__memory/align.h> 940*700637cbSDimitry Andric#include <__cxx03/__memory/allocator.h> 941*700637cbSDimitry Andric#include <__cxx03/__memory/allocator_arg_t.h> 942*700637cbSDimitry Andric#include <__cxx03/__memory/allocator_traits.h> 943*700637cbSDimitry Andric#include <__cxx03/__memory/auto_ptr.h> 944*700637cbSDimitry Andric#include <__cxx03/__memory/pointer_traits.h> 945*700637cbSDimitry Andric#include <__cxx03/__memory/raw_storage_iterator.h> 946*700637cbSDimitry Andric#include <__cxx03/__memory/shared_ptr.h> 947*700637cbSDimitry Andric#include <__cxx03/__memory/temporary_buffer.h> 948*700637cbSDimitry Andric#include <__cxx03/__memory/uninitialized_algorithms.h> 949*700637cbSDimitry Andric#include <__cxx03/__memory/unique_ptr.h> 950*700637cbSDimitry Andric#include <__cxx03/__memory/uses_allocator.h> 951*700637cbSDimitry Andric 952*700637cbSDimitry Andric#include <__cxx03/version> 953*700637cbSDimitry Andric 954*700637cbSDimitry Andric#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) 955*700637cbSDimitry Andric# pragma GCC system_header 956*700637cbSDimitry Andric#endif 957*700637cbSDimitry Andric 958*700637cbSDimitry Andric#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) 959*700637cbSDimitry Andric# include <__cxx03/atomic> 960*700637cbSDimitry Andric# include <__cxx03/cstddef> 961*700637cbSDimitry Andric# include <__cxx03/cstdint> 962*700637cbSDimitry Andric# include <__cxx03/cstdlib> 963*700637cbSDimitry Andric# include <__cxx03/cstring> 964*700637cbSDimitry Andric# include <__cxx03/iosfwd> 965*700637cbSDimitry Andric# include <__cxx03/iterator> 966*700637cbSDimitry Andric# include <__cxx03/new> 967*700637cbSDimitry Andric# include <__cxx03/stdexcept> 968*700637cbSDimitry Andric# include <__cxx03/type_traits> 969*700637cbSDimitry Andric# include <__cxx03/typeinfo> 970*700637cbSDimitry Andric# include <__cxx03/utility> 971*700637cbSDimitry Andric#endif 972*700637cbSDimitry Andric 973*700637cbSDimitry Andric#endif // _LIBCPP___CXX03_MEMORY 974