STLdoc
STLdocumentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Macros | Functions
xmemory File Reference
#include <xmemory0>

Macros

#define _XMEMORY_
 

Functions

template<class _Ty >
_STD_BEGIN pair< _Ty *, ptrdiff_tget_temporary_buffer (ptrdiff_t _Count) _NOEXCEPT
 
template<class _Ty >
void return_temporary_buffer (_Ty *_Pbuf)
 
template<class _InIt , class _FwdIt >
_FwdIt _Uninitialized_move_unchecked1 (_InIt _First, _InIt _Last, _FwdIt _Dest, _General_ptr_iterator_tag)
 
template<class _InIt , class _FwdIt >
_FwdIt _Uninitialized_move_unchecked1 (_InIt _First, _InIt _Last, _FwdIt _Dest, _Really_trivial_ptr_iterator_tag)
 
template<class _InIt , class _FwdIt >
_FwdIt _Uninitialized_move_unchecked (_InIt _First, _InIt _Last, _FwdIt _Dest)
 
template<class _InIt , class _FwdIt , class _Alloc >
_FwdIt _Uninitialized_copy_al_unchecked (_InIt _First, _InIt _Last, _FwdIt _Dest, _Wrap_alloc< _Alloc > &_Al, _General_ptr_iterator_tag, _Any_tag)
 
template<class _Ty1 , class _Ty2 , class _Alloc >
_Ty2 * _Uninitialized_copy_al_unchecked (_Ty1 *_First, _Ty1 *_Last, _Ty2 *_Dest, _Wrap_alloc< _Alloc > &, _Really_trivial_ptr_iterator_tag, true_type)
 
template<class _InIt , class _FwdIt , class _Alloc >
_FwdIt _Uninitialized_copy (_InIt _First, _InIt _Last, _FwdIt _Dest, _Wrap_alloc< _Alloc > &_Al)
 
template<class _InIt , class _FwdIt , class _Alloc >
_FwdIt _Uninitialized_move_al_unchecked (_InIt _First, _InIt _Last, _FwdIt _Dest, _Wrap_alloc< _Alloc > &_Al, _General_ptr_iterator_tag, _Any_tag)
 
template<class _Ty1 , class _Ty2 , class _Alloc >
_Ty2 * _Uninitialized_move_al_unchecked (_Ty1 *_First, _Ty1 *_Last, _Ty2 *_Dest, _Wrap_alloc< _Alloc > &, _Really_trivial_ptr_iterator_tag, true_type)
 
template<class _InIt , class _FwdIt , class _Alloc >
_FwdIt _Uninitialized_move (_InIt _First, _InIt _Last, _FwdIt _Dest, _Wrap_alloc< _Alloc > &_Al)
 
template<class _FwdIt , class _Diff , class _Alloc >
_FwdIt _Uninit_alloc_fill_n1 (_FwdIt _First, _Diff _Count, const _Iter_value_t< _FwdIt > &_Val, _Wrap_alloc< _Alloc > &_Al, false_type)
 
template<class _FwdIt , class _Diff , class _Alloc >
_FwdIt _Uninit_alloc_fill_n1 (_FwdIt _First, _Diff _Count, const _Iter_value_t< _FwdIt > &_Val, _Wrap_alloc< _Alloc > &, true_type)
 
template<class _FwdIt , class _Diff , class _Alloc >
_FwdIt _Uninitialized_fill_n (_FwdIt _First, _Diff _Count, const _Iter_value_t< _FwdIt > &_Val, _Wrap_alloc< _Alloc > &_Al)
 
template<class _FwdIt , class _Diff , class _Alloc >
_FwdIt _Uninitialized_default_fill_n1 (_FwdIt _First, _Diff _Count, _Wrap_alloc< _Alloc > &_Al, false_type)
 
template<class _FwdIt , class _Diff , class _Alloc >
_FwdIt _Uninitialized_default_fill_n1 (_FwdIt _First, _Diff _Count, _Wrap_alloc< _Alloc > &, true_type)
 
template<class _FwdIt , class _Diff , class _Alloc >
_FwdIt _Uninitialized_default_fill_n (_FwdIt _First, _Diff _Count, _Wrap_alloc< _Alloc > &_Al)
 

Macro Definition Documentation

#define _XMEMORY_

Function Documentation

template<class _FwdIt , class _Diff , class _Alloc >
_FwdIt _Uninit_alloc_fill_n1 ( _FwdIt  _First,
_Diff  _Count,
const _Iter_value_t< _FwdIt > &  _Val,
_Wrap_alloc< _Alloc > &  _Al,
false_type   
)
inline
184  { // copy _Count copies of _Val to raw _First, using _Al, no special optimization
185  _FwdIt _Next = _First;
186 
187  _TRY_BEGIN
188  for (; 0 < _Count; --_Count, (void)++_First)
189  {
190  _Al.construct(_Unfancy(_First), _Val);
191  }
192 
193  _CATCH_ALL
194  _Destroy_range(_Next, _First, _Al);
195  _RERAISE;
196  _CATCH_END
197 
198  return (_First);
199  }
void _Destroy_range(_Ptr _First, _Ptr _Last, _Wrap_alloc< _Alloc > &_Al)
Definition: xmemory0:1213
#define _TRY_BEGIN
Definition: xstddef:26
#define _CATCH_END
Definition: xstddef:29
void construct(_Ty *_Ptr, _Types &&..._Args)
Definition: xmemory0:1093
_CRT_BEGIN_C_HEADER typedef void(__CRTDECL *terminate_handler)()
#define _CATCH_ALL
Definition: xstddef:28
_Diff _Count
Definition: algorithm:1941
auto _Unfancy(_Ptrty _Ptr)
Definition: xstddef:635
#define _RERAISE
Definition: xstddef:32
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _FwdIt , class _Diff , class _Alloc >
_FwdIt _Uninit_alloc_fill_n1 ( _FwdIt  _First,
_Diff  _Count,
const _Iter_value_t< _FwdIt > &  _Val,
_Wrap_alloc< _Alloc > &  ,
true_type   
)
inline
206  { // copy _Count copies of _Val to raw _First, using default _Alloc construct, memset optimization
207  _CSTD memset(_First, _Val, _Count);
208  return (_First + _Count);
209  }
_Diff _Count
Definition: algorithm:1941
#define _CSTD
Definition: yvals.h:570
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _InIt , class _FwdIt , class _Alloc >
_FwdIt _Uninitialized_copy ( _InIt  _First,
_InIt  _Last,
_FwdIt  _Dest,
_Wrap_alloc< _Alloc > &  _Al 
)
inline
117  { // copy [_First, _Last) to raw _Dest, using _Al
118  // note: only called internally from elsewhere in the STL, debug checks
119  // and deprecation warnings omitted
120  const auto _UFirst = _Unchecked(_First);
121  const auto _ULast = _Unchecked(_Last);
122  const auto _UDest = _Unchecked(_Dest);
123  return (_Rechecked(_Dest,
124  _Uninitialized_copy_al_unchecked(_UFirst, _ULast, _UDest, _Al,
125  _Ptr_copy_cat(_UFirst, _UDest),
126  _Uses_default_construct_t<_Alloc, decltype(_Unfancy(_UDest)), decltype(*_UFirst)>())));
127  }
_Deque_const_iterator< _Mydeque > & _Rechecked(_Deque_const_iterator< _Mydeque > &_Iter, typename _Deque_const_iterator< _Mydeque >::_Unchecked_type _Right)
Definition: deque:527
unsigned _Dest
Definition: mbstring.h:107
_Iter_t _Unchecked(_Iter_t _Iter)
Definition: iterator:11
_FwdIt _Uninitialized_copy_al_unchecked(_InIt _First, _InIt _Last, _FwdIt _Dest, _Wrap_alloc< _Alloc > &_Al, _General_ptr_iterator_tag, _Any_tag)
Definition: xmemory:84
typename _Uses_default_construct< _Alloc, _Ptr, _Args...>::type _Uses_default_construct_t
Definition: xmemory0:579
auto _Unfancy(_Ptrty _Ptr)
Definition: xstddef:635
_General_ptr_iterator_tag _Ptr_copy_cat(const _Source &, const _Dest &)
Definition: xutility:864
_FwdIt _Last
Definition: algorithm:1936
template<class _InIt , class _FwdIt , class _Alloc >
_FwdIt _Uninitialized_copy_al_unchecked ( _InIt  _First,
_InIt  _Last,
_FwdIt  _Dest,
_Wrap_alloc< _Alloc > &  _Al,
_General_ptr_iterator_tag  ,
_Any_tag   
)
inline
86  { // copy [_First, _Last) to raw _Dest, using _Al, no special optimization
87  _FwdIt _Next = _Dest;
88 
90  for (; _First != _Last; ++_Dest, (void)++_First)
91  {
92  _Al.construct(_Unfancy(_Dest), *_First);
93  }
94 
96  _Destroy_range(_Next, _Dest, _Al);
97  _RERAISE;
99 
100  return (_Dest);
101  }
void _Destroy_range(_Ptr _First, _Ptr _Last, _Wrap_alloc< _Alloc > &_Al)
Definition: xmemory0:1213
unsigned _Dest
Definition: mbstring.h:107
#define _TRY_BEGIN
Definition: xstddef:26
#define _CATCH_END
Definition: xstddef:29
void construct(_Ty *_Ptr, _Types &&..._Args)
Definition: xmemory0:1093
_CRT_BEGIN_C_HEADER typedef void(__CRTDECL *terminate_handler)()
#define _CATCH_ALL
Definition: xstddef:28
auto _Unfancy(_Ptrty _Ptr)
Definition: xstddef:635
#define _RERAISE
Definition: xstddef:32
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty1 , class _Ty2 , class _Alloc >
_Ty2* _Uninitialized_copy_al_unchecked ( _Ty1 *  _First,
_Ty1 *  _Last,
_Ty2 *  _Dest,
_Wrap_alloc< _Alloc > &  ,
_Really_trivial_ptr_iterator_tag  ,
true_type   
)
inline
108  { // copy [_First, _Last) to raw _Dest, using default _Alloc construct, memmove optimization
109  return (_Copy_memmove(_First, _Last, _Dest));
110  }
unsigned _Dest
Definition: mbstring.h:107
_OutIt _Copy_memmove(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2293
_FwdIt _Last
Definition: algorithm:1936
template<class _FwdIt , class _Diff , class _Alloc >
_FwdIt _Uninitialized_default_fill_n ( _FwdIt  _First,
_Diff  _Count,
_Wrap_alloc< _Alloc > &  _Al 
)
inline
260  { // value-initialize _Count objects to raw _First, using _Al
261  typedef _Iter_value_t<_FwdIt> _Ty;
262  return (_Uninitialized_default_fill_n1(_First, _Count, _Al,
268  _Uses_default_construct<_Alloc, decltype(_Unfancy(_First))>>()));
269  }
Definition: type_traits:1159
_FwdIt _Uninitialized_default_fill_n1(_FwdIt _First, _Diff _Count, _Wrap_alloc< _Alloc > &_Al, false_type)
Definition: xmemory:226
typename conjunction< _Traits...>::type _Conjunction_t
Definition: type_traits:1118
Definition: type_traits:1171
Definition: type_traits:436
Definition: type_traits:444
typename iterator_traits< _Iter >::value_type _Iter_value_t
Definition: xutility:649
_Diff _Count
Definition: algorithm:1941
Definition: type_traits:366
auto _Unfancy(_Ptrty _Ptr)
Definition: xstddef:635
Definition: type_traits:468
template<class _FwdIt , class _Diff , class _Alloc >
_FwdIt _Uninitialized_default_fill_n1 ( _FwdIt  _First,
_Diff  _Count,
_Wrap_alloc< _Alloc > &  _Al,
false_type   
)
inline
228  { // value-initialize _Count objects to raw _First, using _Al, no special optimization
229  _FwdIt _Next = _First;
230 
231  _TRY_BEGIN
232  for (; 0 < _Count; --_Count, (void)++_First)
233  {
234  _Al.construct(_Unfancy(_First));
235  }
236 
237  _CATCH_ALL
238  _Destroy_range(_Next, _First, _Al);
239  _RERAISE;
240  _CATCH_END
241 
242  return (_First);
243  }
void _Destroy_range(_Ptr _First, _Ptr _Last, _Wrap_alloc< _Alloc > &_Al)
Definition: xmemory0:1213
#define _TRY_BEGIN
Definition: xstddef:26
#define _CATCH_END
Definition: xstddef:29
void construct(_Ty *_Ptr, _Types &&..._Args)
Definition: xmemory0:1093
_CRT_BEGIN_C_HEADER typedef void(__CRTDECL *terminate_handler)()
#define _CATCH_ALL
Definition: xstddef:28
_Diff _Count
Definition: algorithm:1941
auto _Unfancy(_Ptrty _Ptr)
Definition: xstddef:635
#define _RERAISE
Definition: xstddef:32
template<class _FwdIt , class _Diff , class _Alloc >
_FwdIt _Uninitialized_default_fill_n1 ( _FwdIt  _First,
_Diff  _Count,
_Wrap_alloc< _Alloc > &  ,
true_type   
)
inline
250  { // value-initialize _Count objects to raw _First, using default _Alloc construct, all-bits-zero type
251  _CSTD memset(_First, 0, _Count * sizeof(_Iter_value_t<_FwdIt>));
252  return (_First + _Count);
253  }
typename iterator_traits< _Iter >::value_type _Iter_value_t
Definition: xutility:649
_Diff _Count
Definition: algorithm:1941
#define _CSTD
Definition: yvals.h:570
template<class _FwdIt , class _Diff , class _Alloc >
_FwdIt _Uninitialized_fill_n ( _FwdIt  _First,
_Diff  _Count,
const _Iter_value_t< _FwdIt > &  _Val,
_Wrap_alloc< _Alloc > &  _Al 
)
inline
216  { // copy _Count copies of _Val to raw _First, using _Al
217  return (_Uninit_alloc_fill_n1(_First, _Count, _Val, _Al,
218  _Conjunction_t<decltype(_Fill_memset_is_safe(_First, _Val)),
219  _Uses_default_construct<_Alloc, decltype(_Unfancy(_First)), decltype(_Val)>>()));
220  }
Definition: type_traits:1159
typename conjunction< _Traits...>::type _Conjunction_t
Definition: type_traits:1118
_Fill_memset_is_safe_helper< _FwdIt, _Ty >::type _Fill_memset_is_safe(const _FwdIt &, const _Ty &)
Definition: xutility:2680
_FwdIt _Uninit_alloc_fill_n1(_FwdIt _First, _Diff _Count, const _Iter_value_t< _FwdIt > &_Val, _Wrap_alloc< _Alloc > &_Al, false_type)
Definition: xmemory:182
_Diff _Count
Definition: algorithm:1941
auto _Unfancy(_Ptrty _Ptr)
Definition: xstddef:635
_FwdIt const _Ty _Val
Definition: algorithm:1938
template<class _InIt , class _FwdIt , class _Alloc >
_FwdIt _Uninitialized_move ( _InIt  _First,
_InIt  _Last,
_FwdIt  _Dest,
_Wrap_alloc< _Alloc > &  _Al 
)
inline
166  { // move [_First, _Last) to raw _Dest, using _Al
167  // note: only called internally from elsewhere in the STL, debug checks
168  // and deprecation warnings omitted
169  const auto _UFirst = _Unchecked(_First);
170  const auto _ULast = _Unchecked(_Last);
171  const auto _UDest = _Unchecked(_Dest);
172  return (_Rechecked(_Dest,
173  _Uninitialized_move_al_unchecked(_UFirst, _ULast, _UDest, _Al,
174  _Ptr_move_cat(_UFirst, _UDest),
175  _Uses_default_construct_t<_Alloc, decltype(_Unfancy(_UDest)), decltype(_STD move(*_UFirst))>())));
176  }
_Deque_const_iterator< _Mydeque > & _Rechecked(_Deque_const_iterator< _Mydeque > &_Iter, typename _Deque_const_iterator< _Mydeque >::_Unchecked_type _Right)
Definition: deque:527
unsigned _Dest
Definition: mbstring.h:107
_Iter_t _Unchecked(_Iter_t _Iter)
Definition: iterator:11
typename _Uses_default_construct< _Alloc, _Ptr, _Args...>::type _Uses_default_construct_t
Definition: xmemory0:579
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
_General_ptr_iterator_tag _Ptr_move_cat(const _Source &, const _Dest &)
Definition: xutility:881
auto _Unfancy(_Ptrty _Ptr)
Definition: xstddef:635
_FwdIt _Uninitialized_move_al_unchecked(_InIt _First, _InIt _Last, _FwdIt _Dest, _Wrap_alloc< _Alloc > &_Al, _General_ptr_iterator_tag, _Any_tag)
Definition: xmemory:133
_FwdIt _Last
Definition: algorithm:1936
template<class _InIt , class _FwdIt , class _Alloc >
_FwdIt _Uninitialized_move_al_unchecked ( _InIt  _First,
_InIt  _Last,
_FwdIt  _Dest,
_Wrap_alloc< _Alloc > &  _Al,
_General_ptr_iterator_tag  ,
_Any_tag   
)
inline
135  { // move [_First, _Last) to raw _Dest, using _Al, no special optimization
136  _FwdIt _Next = _Dest;
137 
138  _TRY_BEGIN
139  for (; _First != _Last; ++_Dest, (void)++_First)
140  {
141  _Al.construct(_Unfancy(_Dest), _STD move(*_First));
142  }
143 
144  _CATCH_ALL
145  _Destroy_range(_Next, _Dest, _Al);
146  _RERAISE;
147  _CATCH_END
148 
149  return (_Dest);
150  }
void _Destroy_range(_Ptr _First, _Ptr _Last, _Wrap_alloc< _Alloc > &_Al)
Definition: xmemory0:1213
unsigned _Dest
Definition: mbstring.h:107
#define _TRY_BEGIN
Definition: xstddef:26
#define _CATCH_END
Definition: xstddef:29
void construct(_Ty *_Ptr, _Types &&..._Args)
Definition: xmemory0:1093
_CRT_BEGIN_C_HEADER typedef void(__CRTDECL *terminate_handler)()
#define _CATCH_ALL
Definition: xstddef:28
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
auto _Unfancy(_Ptrty _Ptr)
Definition: xstddef:635
#define _RERAISE
Definition: xstddef:32
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty1 , class _Ty2 , class _Alloc >
_Ty2* _Uninitialized_move_al_unchecked ( _Ty1 *  _First,
_Ty1 *  _Last,
_Ty2 *  _Dest,
_Wrap_alloc< _Alloc > &  ,
_Really_trivial_ptr_iterator_tag  ,
true_type   
)
inline
157  { // move [_First, _Last) to raw _Dest, using default _Alloc construct, memmove optimization
158  return (_Copy_memmove(_First, _Last, _Dest));
159  }
unsigned _Dest
Definition: mbstring.h:107
_OutIt _Copy_memmove(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2293
_FwdIt _Last
Definition: algorithm:1936
template<class _InIt , class _FwdIt >
_FwdIt _Uninitialized_move_unchecked ( _InIt  _First,
_InIt  _Last,
_FwdIt  _Dest 
)
inline
75  { // move [_First, _Last) to raw [_Dest, ...), choose optimization
76  return (_Uninitialized_move_unchecked1(_First, _Last, _Dest, _Ptr_move_cat(_First, _Dest)));
77  }
unsigned _Dest
Definition: mbstring.h:107
_FwdIt _Uninitialized_move_unchecked1(_InIt _First, _InIt _Last, _FwdIt _Dest, _General_ptr_iterator_tag)
Definition: xmemory:44
_General_ptr_iterator_tag _Ptr_move_cat(const _Source &, const _Dest &)
Definition: xutility:881
_FwdIt _Last
Definition: algorithm:1936
template<class _InIt , class _FwdIt >
_FwdIt _Uninitialized_move_unchecked1 ( _InIt  _First,
_InIt  _Last,
_FwdIt  _Dest,
_General_ptr_iterator_tag   
)
inline
46  { // move [_First, _Last) to raw [_Dest, ...), no special optimization
47  _FwdIt _Next = _Dest;
48 
50  for (; _First != _Last; ++_Dest, (void)++_First)
51  {
52  _Construct_in_place(*_Dest, _STD move(*_First));
53  }
54 
56  _Destroy_range(_Next, _Dest);
57  _RERAISE;
59 
60  return (_Dest);
61  }
void _Destroy_range(_Ptr _First, _Ptr _Last, _Wrap_alloc< _Alloc > &_Al)
Definition: xmemory0:1213
void _Construct_in_place(_Ty &_Obj, _Types &&..._Args)
Definition: xmemory0:146
unsigned _Dest
Definition: mbstring.h:107
#define _TRY_BEGIN
Definition: xstddef:26
#define _CATCH_END
Definition: xstddef:29
_CRT_BEGIN_C_HEADER typedef void(__CRTDECL *terminate_handler)()
#define _CATCH_ALL
Definition: xstddef:28
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
#define _RERAISE
Definition: xstddef:32
_FwdIt _Last
Definition: algorithm:1936
template<class _InIt , class _FwdIt >
_FwdIt _Uninitialized_move_unchecked1 ( _InIt  _First,
_InIt  _Last,
_FwdIt  _Dest,
_Really_trivial_ptr_iterator_tag   
)
inline
67  { // move [_First, _Last) to raw [_Dest, ...), memmove optimization
68  return (_Copy_memmove(_First, _Last, _Dest));
69  }
unsigned _Dest
Definition: mbstring.h:107
_OutIt _Copy_memmove(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2293
_FwdIt _Last
Definition: algorithm:1936
template<class _Ty >
_STD_BEGIN pair<_Ty *, ptrdiff_t> get_temporary_buffer ( ptrdiff_t  _Count)
inline
18  { // get raw temporary buffer of up to _Count elements
19  if (static_cast<size_t>(_Count) <= static_cast<size_t>(-1) / sizeof(_Ty))
20  {
21  for (; 0 < _Count; _Count /= 2)
22  {
23  _Ty * _Pbuf = static_cast<_Ty *>(::operator new(static_cast<size_t>(_Count) * sizeof(_Ty), nothrow));
24  if (_Pbuf)
25  {
26  return {_Pbuf, _Count};
27  }
28  }
29  }
30 
31  return {nullptr_t{}, 0};
32  }
_Diff _Count
Definition: algorithm:1941
template<class _Ty >
void return_temporary_buffer ( _Ty *  _Pbuf)
inline
37  { // delete raw temporary buffer
38  ::operator delete(_Pbuf);
39  }