Import libc++ trunk r165949. Among other improvements and bug fixes,
this has many visibility problems fixed, which should help with compiling certain ports that exercise C++11 mode (i.e. Firefox). Also, belatedly add the LICENSE.TXT and accompanying CREDITS.TXT files, which are referred to in all the source files. MFC after: 1 month
This commit is contained in:
commit
936e943916
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=241903
76
contrib/libc++/CREDITS.TXT
Normal file
76
contrib/libc++/CREDITS.TXT
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
This file is a partial list of people who have contributed to the LLVM/libc++
|
||||||
|
project. If you have contributed a patch or made some other contribution to
|
||||||
|
LLVM/libc++, please submit a patch to this file to add yourself, and it will be
|
||||||
|
done!
|
||||||
|
|
||||||
|
The list is sorted by surname and formatted to allow easy grepping and
|
||||||
|
beautification by scripts. The fields are: name (N), email (E), web-address
|
||||||
|
(W), PGP key ID and fingerprint (P), description (D), and snail-mail address
|
||||||
|
(S).
|
||||||
|
|
||||||
|
N: Howard Hinnant
|
||||||
|
E: hhinnant@apple.com
|
||||||
|
D: Architect and primary author of libc++
|
||||||
|
|
||||||
|
N: Marshall Clow
|
||||||
|
E: mclow.lists@gmail.com
|
||||||
|
E: marshall@idio.com
|
||||||
|
D: Minor patches and bug fixes.
|
||||||
|
|
||||||
|
N: Bjorn Reese
|
||||||
|
E: breese@users.sourceforge.net
|
||||||
|
D: Initial regex prototype
|
||||||
|
|
||||||
|
N: David Chisnall
|
||||||
|
E: theraven at theravensnest dot org
|
||||||
|
D: FreeBSD and Solaris ports, libcxxrt support, some atomics work.
|
||||||
|
|
||||||
|
N: Ruben Van Boxem
|
||||||
|
E: vanboxem dot ruben at gmail dot com
|
||||||
|
D: Initial Windows patches.
|
||||||
|
|
||||||
|
N: Arvid Picciani
|
||||||
|
E: aep at exys dot org
|
||||||
|
D: Minor patches and musl port.
|
||||||
|
|
||||||
|
N: Craig Silverstein
|
||||||
|
E: csilvers@google.com
|
||||||
|
D: Implemented Cityhash as the string hash function on 64-bit machines
|
||||||
|
|
||||||
|
N: Google Inc.
|
||||||
|
D: Copyright owner and contributor of the CityHash algorithm
|
||||||
|
|
||||||
|
N: Jeffrey Yasskin
|
||||||
|
E: jyasskin@gmail.com
|
||||||
|
E: jyasskin@google.com
|
||||||
|
D: Linux fixes.
|
||||||
|
|
||||||
|
N: Jonathan Sauer
|
||||||
|
D: Minor patches, mostly related to constexpr
|
||||||
|
|
||||||
|
N: Richard Smith
|
||||||
|
D: Minor patches.
|
||||||
|
|
||||||
|
N: Andrew Morrow
|
||||||
|
E: andrew.c.morrow@gmail.com
|
||||||
|
D: Minor patches and Linux fixes.
|
||||||
|
|
||||||
|
N: Hyeon-bin Jeong
|
||||||
|
E: tuhertz@gmail.com
|
||||||
|
D: Minor patches and bug fixes.
|
||||||
|
|
||||||
|
N: Michel Morin
|
||||||
|
E: mimomorin@gmail.com
|
||||||
|
D: Minor patches to is_convertible.
|
||||||
|
|
||||||
|
N: Dimitry Andric
|
||||||
|
E: dimitry@andric.com
|
||||||
|
D: Visibility fixes, minor FreeBSD portability patches.
|
||||||
|
|
||||||
|
N: Holger Arnold
|
||||||
|
E: holgerar@gmail.com
|
||||||
|
D: Minor fix.
|
||||||
|
|
||||||
|
N: Argyrios Kyrtzidis
|
||||||
|
E: kyrtzidis@apple.com
|
||||||
|
D: Bug fixes.
|
76
contrib/libc++/LICENSE.TXT
Normal file
76
contrib/libc++/LICENSE.TXT
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
==============================================================================
|
||||||
|
libc++ License
|
||||||
|
==============================================================================
|
||||||
|
|
||||||
|
The libc++ library is dual licensed under both the University of Illinois
|
||||||
|
"BSD-Like" license and the MIT license. As a user of this code you may choose
|
||||||
|
to use it under either license. As a contributor, you agree to allow your code
|
||||||
|
to be used under both.
|
||||||
|
|
||||||
|
Full text of the relevant licenses is included below.
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
|
||||||
|
University of Illinois/NCSA
|
||||||
|
Open Source License
|
||||||
|
|
||||||
|
Copyright (c) 2009-2012 by the contributors listed in CREDITS.TXT
|
||||||
|
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Developed by:
|
||||||
|
|
||||||
|
LLVM Team
|
||||||
|
|
||||||
|
University of Illinois at Urbana-Champaign
|
||||||
|
|
||||||
|
http://llvm.org
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal with
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||||
|
of the Software, and to permit persons to whom the Software is furnished to do
|
||||||
|
so, subject to the following conditions:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimers.
|
||||||
|
|
||||||
|
* Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimers in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
* Neither the names of the LLVM Team, University of Illinois at
|
||||||
|
Urbana-Champaign, nor the names of its contributors may be used to
|
||||||
|
endorse or promote products derived from this Software without specific
|
||||||
|
prior written permission.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
|
||||||
|
SOFTWARE.
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
|
||||||
|
Copyright (c) 2009-2012 by the contributors listed in CREDITS.TXT
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
template <class _Cp, bool _IsConst> class __bit_iterator;
|
template <class _Cp, bool _IsConst, typename _Cp::__storage_type = 0> class __bit_iterator;
|
||||||
template <class _Cp> class __bit_const_reference;
|
template <class _Cp> class __bit_const_reference;
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
@ -131,13 +131,14 @@ public:
|
|||||||
__bit_const_reference(const __bit_reference<_Cp>& __x) _NOEXCEPT
|
__bit_const_reference(const __bit_reference<_Cp>& __x) _NOEXCEPT
|
||||||
: __seg_(__x.__seg_), __mask_(__x.__mask_) {}
|
: __seg_(__x.__seg_), __mask_(__x.__mask_) {}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY operator bool() const _NOEXCEPT
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR operator bool() const _NOEXCEPT
|
||||||
{return static_cast<bool>(*__seg_ & __mask_);}
|
{return static_cast<bool>(*__seg_ & __mask_);}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY __bit_iterator<_Cp, true> operator&() const _NOEXCEPT
|
_LIBCPP_INLINE_VISIBILITY __bit_iterator<_Cp, true> operator&() const _NOEXCEPT
|
||||||
{return __bit_iterator<_Cp, true>(__seg_, static_cast<unsigned>(__ctz(__mask_)));}
|
{return __bit_iterator<_Cp, true>(__seg_, static_cast<unsigned>(__ctz(__mask_)));}
|
||||||
private:
|
private:
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
__bit_const_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT
|
__bit_const_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT
|
||||||
: __seg_(__s), __mask_(__m) {}
|
: __seg_(__s), __mask_(__m) {}
|
||||||
|
|
||||||
@ -146,11 +147,11 @@ private:
|
|||||||
|
|
||||||
// find
|
// find
|
||||||
|
|
||||||
template <class _Cp>
|
template <class _Cp, bool _IsConst>
|
||||||
__bit_iterator<_Cp, false>
|
__bit_iterator<_Cp, _IsConst>
|
||||||
__find_bool_true(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n)
|
__find_bool_true(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n)
|
||||||
{
|
{
|
||||||
typedef __bit_iterator<_Cp, false> _It;
|
typedef __bit_iterator<_Cp, _IsConst> _It;
|
||||||
typedef typename _It::__storage_type __storage_type;
|
typedef typename _It::__storage_type __storage_type;
|
||||||
static const unsigned __bits_per_word = _It::__bits_per_word;
|
static const unsigned __bits_per_word = _It::__bits_per_word;
|
||||||
// do first partial word
|
// do first partial word
|
||||||
@ -180,11 +181,11 @@ __find_bool_true(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n
|
|||||||
return _It(__first.__seg_, static_cast<unsigned>(__n));
|
return _It(__first.__seg_, static_cast<unsigned>(__n));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _Cp>
|
template <class _Cp, bool _IsConst>
|
||||||
__bit_iterator<_Cp, false>
|
__bit_iterator<_Cp, _IsConst>
|
||||||
__find_bool_false(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n)
|
__find_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n)
|
||||||
{
|
{
|
||||||
typedef __bit_iterator<_Cp, false> _It;
|
typedef __bit_iterator<_Cp, _IsConst> _It;
|
||||||
typedef typename _It::__storage_type __storage_type;
|
typedef typename _It::__storage_type __storage_type;
|
||||||
static const unsigned __bits_per_word = _It::__bits_per_word;
|
static const unsigned __bits_per_word = _It::__bits_per_word;
|
||||||
// do first partial word
|
// do first partial word
|
||||||
@ -193,7 +194,7 @@ __find_bool_false(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __
|
|||||||
__storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
|
__storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
|
||||||
__storage_type __dn = _VSTD::min(__clz_f, __n);
|
__storage_type __dn = _VSTD::min(__clz_f, __n);
|
||||||
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
||||||
__storage_type __b = ~(*__first.__seg_ & __m);
|
__storage_type __b = ~*__first.__seg_ & __m;
|
||||||
if (__b)
|
if (__b)
|
||||||
return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b)));
|
return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b)));
|
||||||
__n -= __dn;
|
__n -= __dn;
|
||||||
@ -210,17 +211,17 @@ __find_bool_false(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __
|
|||||||
if (__n > 0)
|
if (__n > 0)
|
||||||
{
|
{
|
||||||
__storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
|
__storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
|
||||||
__storage_type __b = ~(*__first.__seg_ & __m);
|
__storage_type __b = ~*__first.__seg_ & __m;
|
||||||
if (__b)
|
if (__b)
|
||||||
return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b)));
|
return _It(__first.__seg_, static_cast<unsigned>(_VSTD::__ctz(__b)));
|
||||||
}
|
}
|
||||||
return _It(__first.__seg_, static_cast<unsigned>(__n));
|
return _It(__first.__seg_, static_cast<unsigned>(__n));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _Cp, class _Tp>
|
template <class _Cp, bool _IsConst, class _Tp>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
__bit_iterator<_Cp, false>
|
__bit_iterator<_Cp, _IsConst>
|
||||||
find(__bit_iterator<_Cp, false> __first, __bit_iterator<_Cp, false> __last, const _Tp& __value_)
|
find(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value_)
|
||||||
{
|
{
|
||||||
if (static_cast<bool>(__value_))
|
if (static_cast<bool>(__value_))
|
||||||
return __find_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first));
|
return __find_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first));
|
||||||
@ -229,11 +230,11 @@ find(__bit_iterator<_Cp, false> __first, __bit_iterator<_Cp, false> __last, cons
|
|||||||
|
|
||||||
// count
|
// count
|
||||||
|
|
||||||
template <class _Cp>
|
template <class _Cp, bool _IsConst>
|
||||||
typename __bit_iterator<_Cp, false>::difference_type
|
typename __bit_iterator<_Cp, _IsConst>::difference_type
|
||||||
__count_bool_true(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n)
|
__count_bool_true(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n)
|
||||||
{
|
{
|
||||||
typedef __bit_iterator<_Cp, false> _It;
|
typedef __bit_iterator<_Cp, _IsConst> _It;
|
||||||
typedef typename _It::__storage_type __storage_type;
|
typedef typename _It::__storage_type __storage_type;
|
||||||
typedef typename _It::difference_type difference_type;
|
typedef typename _It::difference_type difference_type;
|
||||||
static const unsigned __bits_per_word = _It::__bits_per_word;
|
static const unsigned __bits_per_word = _It::__bits_per_word;
|
||||||
@ -260,11 +261,11 @@ __count_bool_true(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __
|
|||||||
return __r;
|
return __r;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _Cp>
|
template <class _Cp, bool _IsConst>
|
||||||
typename __bit_iterator<_Cp, false>::difference_type
|
typename __bit_iterator<_Cp, _IsConst>::difference_type
|
||||||
__count_bool_false(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n)
|
__count_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n)
|
||||||
{
|
{
|
||||||
typedef __bit_iterator<_Cp, false> _It;
|
typedef __bit_iterator<_Cp, _IsConst> _It;
|
||||||
typedef typename _It::__storage_type __storage_type;
|
typedef typename _It::__storage_type __storage_type;
|
||||||
typedef typename _It::difference_type difference_type;
|
typedef typename _It::difference_type difference_type;
|
||||||
static const unsigned __bits_per_word = _It::__bits_per_word;
|
static const unsigned __bits_per_word = _It::__bits_per_word;
|
||||||
@ -275,7 +276,7 @@ __count_bool_false(__bit_iterator<_Cp, false> __first, typename _Cp::size_type _
|
|||||||
__storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
|
__storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_);
|
||||||
__storage_type __dn = _VSTD::min(__clz_f, __n);
|
__storage_type __dn = _VSTD::min(__clz_f, __n);
|
||||||
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
__storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn));
|
||||||
__r = _VSTD::__pop_count(~(*__first.__seg_ & __m));
|
__r = _VSTD::__pop_count(~*__first.__seg_ & __m);
|
||||||
__n -= __dn;
|
__n -= __dn;
|
||||||
++__first.__seg_;
|
++__first.__seg_;
|
||||||
}
|
}
|
||||||
@ -286,15 +287,15 @@ __count_bool_false(__bit_iterator<_Cp, false> __first, typename _Cp::size_type _
|
|||||||
if (__n > 0)
|
if (__n > 0)
|
||||||
{
|
{
|
||||||
__storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
|
__storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
|
||||||
__r += _VSTD::__pop_count(~(*__first.__seg_ & __m));
|
__r += _VSTD::__pop_count(~*__first.__seg_ & __m);
|
||||||
}
|
}
|
||||||
return __r;
|
return __r;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _Cp, class _Tp>
|
template <class _Cp, bool _IsConst, class _Tp>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
typename __bit_iterator<_Cp, false>::difference_type
|
typename __bit_iterator<_Cp, _IsConst>::difference_type
|
||||||
count(__bit_iterator<_Cp, false> __first, __bit_iterator<_Cp, false> __last, const _Tp& __value_)
|
count(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value_)
|
||||||
{
|
{
|
||||||
if (static_cast<bool>(__value_))
|
if (static_cast<bool>(__value_))
|
||||||
return __count_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first));
|
return __count_bool_true(__first, static_cast<typename _Cp::size_type>(__last - __first));
|
||||||
@ -926,12 +927,12 @@ rotate(__bit_iterator<_Cp, false> __first, __bit_iterator<_Cp, false> __middle,
|
|||||||
|
|
||||||
// equal
|
// equal
|
||||||
|
|
||||||
template <class _Cp>
|
template <class _Cp, bool _IC1, bool _IC2>
|
||||||
bool
|
bool
|
||||||
__equal_unaligned(__bit_iterator<_Cp, true> __first1, __bit_iterator<_Cp, true> __last1,
|
__equal_unaligned(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __last1,
|
||||||
__bit_iterator<_Cp, true> __first2)
|
__bit_iterator<_Cp, _IC2> __first2)
|
||||||
{
|
{
|
||||||
typedef __bit_iterator<_Cp, true> _It;
|
typedef __bit_iterator<_Cp, _IC1> _It;
|
||||||
typedef typename _It::difference_type difference_type;
|
typedef typename _It::difference_type difference_type;
|
||||||
typedef typename _It::__storage_type __storage_type;
|
typedef typename _It::__storage_type __storage_type;
|
||||||
static const unsigned __bits_per_word = _It::__bits_per_word;
|
static const unsigned __bits_per_word = _It::__bits_per_word;
|
||||||
@ -1008,12 +1009,12 @@ __equal_unaligned(__bit_iterator<_Cp, true> __first1, __bit_iterator<_Cp, true>
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _Cp>
|
template <class _Cp, bool _IC1, bool _IC2>
|
||||||
bool
|
bool
|
||||||
__equal_aligned(__bit_iterator<_Cp, true> __first1, __bit_iterator<_Cp, true> __last1,
|
__equal_aligned(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __last1,
|
||||||
__bit_iterator<_Cp, true> __first2)
|
__bit_iterator<_Cp, _IC2> __first2)
|
||||||
{
|
{
|
||||||
typedef __bit_iterator<_Cp, true> _It;
|
typedef __bit_iterator<_Cp, _IC1> _It;
|
||||||
typedef typename _It::difference_type difference_type;
|
typedef typename _It::difference_type difference_type;
|
||||||
typedef typename _It::__storage_type __storage_type;
|
typedef typename _It::__storage_type __storage_type;
|
||||||
static const unsigned __bits_per_word = _It::__bits_per_word;
|
static const unsigned __bits_per_word = _It::__bits_per_word;
|
||||||
@ -1061,7 +1062,8 @@ equal(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __last1, __b
|
|||||||
return __equal_unaligned(__first1, __last1, __first2);
|
return __equal_unaligned(__first1, __last1, __first2);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _Cp, bool _IsConst>
|
template <class _Cp, bool _IsConst,
|
||||||
|
typename _Cp::__storage_type>
|
||||||
class __bit_iterator
|
class __bit_iterator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -1232,19 +1234,23 @@ private:
|
|||||||
template <class _Dp> friend __bit_iterator<_Dp, false> rotate(__bit_iterator<_Dp, false>,
|
template <class _Dp> friend __bit_iterator<_Dp, false> rotate(__bit_iterator<_Dp, false>,
|
||||||
__bit_iterator<_Dp, false>,
|
__bit_iterator<_Dp, false>,
|
||||||
__bit_iterator<_Dp, false>);
|
__bit_iterator<_Dp, false>);
|
||||||
template <class _Dp> friend bool __equal_aligned(__bit_iterator<_Dp, true>,
|
template <class _Dp, bool _IC1, bool _IC2> friend bool __equal_aligned(__bit_iterator<_Dp, _IC1>,
|
||||||
__bit_iterator<_Dp, true>,
|
__bit_iterator<_Dp, _IC1>,
|
||||||
__bit_iterator<_Dp, true>);
|
__bit_iterator<_Dp, _IC2>);
|
||||||
template <class _Dp> friend bool __equal_unaligned(__bit_iterator<_Dp, true>,
|
template <class _Dp, bool _IC1, bool _IC2> friend bool __equal_unaligned(__bit_iterator<_Dp, _IC1>,
|
||||||
__bit_iterator<_Dp, true>,
|
__bit_iterator<_Dp, _IC1>,
|
||||||
__bit_iterator<_Dp, true>);
|
__bit_iterator<_Dp, _IC2>);
|
||||||
template <class _Dp, bool _IC1, bool _IC2> friend bool equal(__bit_iterator<_Dp, _IC1>,
|
template <class _Dp, bool _IC1, bool _IC2> friend bool equal(__bit_iterator<_Dp, _IC1>,
|
||||||
__bit_iterator<_Dp, _IC1>,
|
__bit_iterator<_Dp, _IC1>,
|
||||||
__bit_iterator<_Dp, _IC2>);
|
__bit_iterator<_Dp, _IC2>);
|
||||||
template <class _Dp> friend __bit_iterator<_Dp, false> __find_bool_true(__bit_iterator<_Dp, false>,
|
template <class _Dp, bool _IC> friend __bit_iterator<_Dp, _IC> __find_bool_true(__bit_iterator<_Dp, _IC>,
|
||||||
typename _Dp::size_type);
|
typename _Dp::size_type);
|
||||||
template <class _Dp> friend __bit_iterator<_Dp, false> __find_bool_false(__bit_iterator<_Dp, false>,
|
template <class _Dp, bool _IC> friend __bit_iterator<_Dp, _IC> __find_bool_false(__bit_iterator<_Dp, _IC>,
|
||||||
typename _Dp::size_type);
|
typename _Dp::size_type);
|
||||||
|
template <class _Dp, bool _IC> friend typename __bit_iterator<_Dp, _IC>::difference_type
|
||||||
|
__count_bool_true(__bit_iterator<_Dp, _IC>, typename _Dp::size_type);
|
||||||
|
template <class _Dp, bool _IC> friend typename __bit_iterator<_Dp, _IC>::difference_type
|
||||||
|
__count_bool_false(__bit_iterator<_Dp, _IC>, typename _Dp::size_type);
|
||||||
};
|
};
|
||||||
|
|
||||||
_LIBCPP_END_NAMESPACE_STD
|
_LIBCPP_END_NAMESPACE_STD
|
||||||
|
@ -15,7 +15,11 @@
|
|||||||
#pragma GCC system_header
|
#pragma GCC system_header
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define _LIBCPP_VERSION 1001
|
#ifdef __GNUC__
|
||||||
|
#define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define _LIBCPP_VERSION 1101
|
||||||
|
|
||||||
#define _LIBCPP_ABI_VERSION 1
|
#define _LIBCPP_ABI_VERSION 1
|
||||||
|
|
||||||
@ -53,7 +57,8 @@
|
|||||||
# define _LIBCPP_LITTLE_ENDIAN 1
|
# define _LIBCPP_LITTLE_ENDIAN 1
|
||||||
# define _LIBCPP_BIG_ENDIAN 0
|
# define _LIBCPP_BIG_ENDIAN 0
|
||||||
// Compiler intrinsics (GCC or MSVC)
|
// Compiler intrinsics (GCC or MSVC)
|
||||||
# if (defined(_MSC_VER) && _MSC_VER >= 1400) || (__GNUC__ >= 4 && __GNUC_MINOR__ > 3)
|
# if (defined(_MSC_VER) && _MSC_VER >= 1400) \
|
||||||
|
|| (defined(__GNUC__) && _GNUC_VER > 403)
|
||||||
# define _LIBCP_HAS_IS_BASE_OF
|
# define _LIBCP_HAS_IS_BASE_OF
|
||||||
# endif
|
# endif
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
@ -145,8 +150,10 @@
|
|||||||
#if defined(__clang__)
|
#if defined(__clang__)
|
||||||
|
|
||||||
#if __has_feature(cxx_alignas)
|
#if __has_feature(cxx_alignas)
|
||||||
|
# define _ALIGNAS_TYPE(x) alignas(x)
|
||||||
# define _ALIGNAS(x) alignas(x)
|
# define _ALIGNAS(x) alignas(x)
|
||||||
#else
|
#else
|
||||||
|
# define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x))))
|
||||||
# define _ALIGNAS(x) __attribute__((__aligned__(x)))
|
# define _ALIGNAS(x) __attribute__((__aligned__(x)))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -180,9 +187,9 @@ typedef __char32_t char32_t;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if __has_feature(cxx_attributes)
|
#if __has_feature(cxx_attributes)
|
||||||
# define _ATTRIBUTE(x) [[x]]
|
# define _LIBCPP_NORETURN [[noreturn]]
|
||||||
#else
|
#else
|
||||||
# define _ATTRIBUTE(x) __attribute__ ((x))
|
# define _LIBCPP_NORETURN __attribute__ ((noreturn))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||||
@ -245,8 +252,9 @@ typedef __char32_t char32_t;
|
|||||||
#define _LIBCPP_HAS_NO_CONSTEXPR
|
#define _LIBCPP_HAS_NO_CONSTEXPR
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if __FreeBSD__
|
#if __FreeBSD__ && (__ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L)
|
||||||
#define _LIBCPP_HAS_QUICK_EXIT
|
#define _LIBCPP_HAS_QUICK_EXIT
|
||||||
|
#define _LIBCPP_HAS_C11_FEATURES
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (__has_feature(cxx_noexcept))
|
#if (__has_feature(cxx_noexcept))
|
||||||
@ -274,8 +282,9 @@ namespace std {
|
|||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
|
|
||||||
#define _ALIGNAS(x) __attribute__((__aligned__(x)))
|
#define _ALIGNAS(x) __attribute__((__aligned__(x)))
|
||||||
|
#define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x))))
|
||||||
|
|
||||||
#define _ATTRIBUTE(x) __attribute__((x))
|
#define _LIBCPP_NORETURN __attribute__((noreturn))
|
||||||
|
|
||||||
#if !__EXCEPTIONS
|
#if !__EXCEPTIONS
|
||||||
#define _LIBCPP_NO_EXCEPTIONS
|
#define _LIBCPP_NO_EXCEPTIONS
|
||||||
@ -305,15 +314,15 @@ namespace std {
|
|||||||
#define _LIBCPP_HAS_NO_TRAILING_RETURN
|
#define _LIBCPP_HAS_NO_TRAILING_RETURN
|
||||||
#define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
|
#define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
|
||||||
|
|
||||||
#if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 3)
|
#if _GNUC_VER < 403
|
||||||
#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 3)
|
#if _GNUC_VER < 403
|
||||||
#define _LIBCPP_HAS_NO_STATIC_ASSERT
|
#define _LIBCPP_HAS_NO_STATIC_ASSERT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
|
#if _GNUC_VER < 404
|
||||||
#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
||||||
#define _LIBCPP_HAS_NO_DECLTYPE
|
#define _LIBCPP_HAS_NO_DECLTYPE
|
||||||
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||||
@ -321,9 +330,9 @@ namespace std {
|
|||||||
#define _LIBCPP_HAS_NO_UNICODE_CHARS
|
#define _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||||
#define _LIBCPP_HAS_NO_VARIADICS
|
#define _LIBCPP_HAS_NO_VARIADICS
|
||||||
#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||||
#endif // !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
|
#endif // _GNUC_VER < 404
|
||||||
|
|
||||||
#if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 6)
|
#if _GNUC_VER < 406
|
||||||
#define _LIBCPP_HAS_NO_NULLPTR
|
#define _LIBCPP_HAS_NO_NULLPTR
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -347,7 +356,7 @@ using namespace _LIBCPP_NAMESPACE __attribute__((__strong__));
|
|||||||
#define _LIBCPP_HAS_NO_UNICODE_CHARS
|
#define _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||||
#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
|
#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
|
||||||
#define __alignof__ __alignof
|
#define __alignof__ __alignof
|
||||||
#define _ATTRIBUTE __declspec
|
#define _LIBCPP_NORETURN __declspec(noreturn)
|
||||||
#define _ALIGNAS(x) __declspec(align(x))
|
#define _ALIGNAS(x) __declspec(align(x))
|
||||||
#define _LIBCPP_HAS_NO_VARIADICS
|
#define _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
@ -389,6 +398,12 @@ template <unsigned> struct __static_assert_check {};
|
|||||||
#define _LIBCPP_CONSTEXPR constexpr
|
#define _LIBCPP_CONSTEXPR constexpr
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#define _NOALIAS __attribute__((malloc))
|
||||||
|
#else
|
||||||
|
#define _NOALIAS
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __has_feature
|
#ifndef __has_feature
|
||||||
#define __has_feature(__x) 0
|
#define __has_feature(__x) 0
|
||||||
#endif
|
#endif
|
||||||
@ -404,6 +419,7 @@ template <unsigned> struct __static_assert_check {};
|
|||||||
#define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \
|
#define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \
|
||||||
_ __v_; \
|
_ __v_; \
|
||||||
_LIBCPP_ALWAYS_INLINE x(_ __v) : __v_(__v) {} \
|
_LIBCPP_ALWAYS_INLINE x(_ __v) : __v_(__v) {} \
|
||||||
|
_LIBCPP_ALWAYS_INLINE explicit x(int __v) : __v_(static_cast<_>(__v)) {} \
|
||||||
_LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \
|
_LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \
|
||||||
};
|
};
|
||||||
#else // _LIBCPP_HAS_NO_STRONG_ENUMS
|
#else // _LIBCPP_HAS_NO_STRONG_ENUMS
|
||||||
|
@ -58,10 +58,31 @@ struct __hash_node
|
|||||||
value_type __value_;
|
value_type __value_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
bool
|
||||||
|
__is_power2(size_t __bc)
|
||||||
|
{
|
||||||
|
return __bc > 2 && !(__bc & (__bc - 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
size_t
|
||||||
|
__constrain_hash(size_t __h, size_t __bc)
|
||||||
|
{
|
||||||
|
return !(__bc & (__bc - 1)) ? __h & (__bc - 1) : __h % __bc;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
size_t
|
||||||
|
__next_pow2(size_t __n)
|
||||||
|
{
|
||||||
|
return size_t(1) << (std::numeric_limits<size_t>::digits - __clz(__n-1));
|
||||||
|
}
|
||||||
|
|
||||||
template <class _Tp, class _Hash, class _Equal, class _Alloc> class __hash_table;
|
template <class _Tp, class _Hash, class _Equal, class _Alloc> class __hash_table;
|
||||||
template <class _ConstNodePtr> class __hash_const_iterator;
|
template <class _ConstNodePtr> class _LIBCPP_VISIBLE __hash_const_iterator;
|
||||||
template <class _HashIterator> class __hash_map_iterator;
|
template <class _HashIterator> class _LIBCPP_VISIBLE __hash_map_iterator;
|
||||||
template <class _HashIterator> class __hash_map_const_iterator;
|
template <class _HashIterator> class _LIBCPP_VISIBLE __hash_map_const_iterator;
|
||||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||||
class _LIBCPP_VISIBLE unordered_map;
|
class _LIBCPP_VISIBLE unordered_map;
|
||||||
|
|
||||||
@ -240,7 +261,7 @@ public:
|
|||||||
__hash_local_iterator& operator++()
|
__hash_local_iterator& operator++()
|
||||||
{
|
{
|
||||||
__node_ = __node_->__next_;
|
__node_ = __node_->__next_;
|
||||||
if (__node_ != nullptr && __node_->__hash_ % __bucket_count_ != __bucket_)
|
if (__node_ != nullptr && __constrain_hash(__node_->__hash_, __bucket_count_) != __bucket_)
|
||||||
__node_ = nullptr;
|
__node_ = nullptr;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@ -330,7 +351,7 @@ public:
|
|||||||
__hash_const_local_iterator& operator++()
|
__hash_const_local_iterator& operator++()
|
||||||
{
|
{
|
||||||
__node_ = __node_->__next_;
|
__node_ = __node_->__next_;
|
||||||
if (__node_ != nullptr && __node_->__hash_ % __bucket_count_ != __bucket_)
|
if (__node_ != nullptr && __constrain_hash(__node_->__hash_, __bucket_count_) != __bucket_)
|
||||||
__node_ = nullptr;
|
__node_ = nullptr;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@ -637,7 +658,7 @@ public:
|
|||||||
template <class _Key>
|
template <class _Key>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
size_type bucket(const _Key& __k) const
|
size_type bucket(const _Key& __k) const
|
||||||
{return hash_function()(__k) % bucket_count();}
|
{return __constrain_hash(hash_function()(__k), bucket_count());}
|
||||||
|
|
||||||
template <class _Key>
|
template <class _Key>
|
||||||
iterator find(const _Key& __x);
|
iterator find(const _Key& __x);
|
||||||
@ -871,7 +892,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u)
|
|||||||
{
|
{
|
||||||
if (size() > 0)
|
if (size() > 0)
|
||||||
{
|
{
|
||||||
__bucket_list_[__p1_.first().__next_->__hash_ % bucket_count()] =
|
__bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] =
|
||||||
static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
|
static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
|
||||||
__u.__p1_.first().__next_ = nullptr;
|
__u.__p1_.first().__next_ = nullptr;
|
||||||
__u.size() = 0;
|
__u.size() = 0;
|
||||||
@ -895,7 +916,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u,
|
|||||||
{
|
{
|
||||||
__p1_.first().__next_ = __u.__p1_.first().__next_;
|
__p1_.first().__next_ = __u.__p1_.first().__next_;
|
||||||
__u.__p1_.first().__next_ = nullptr;
|
__u.__p1_.first().__next_ = nullptr;
|
||||||
__bucket_list_[__p1_.first().__next_->__hash_ % bucket_count()] =
|
__bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] =
|
||||||
static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
|
static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
|
||||||
size() = __u.size();
|
size() = __u.size();
|
||||||
__u.size() = 0;
|
__u.size() = 0;
|
||||||
@ -992,7 +1013,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(
|
|||||||
__p1_.first().__next_ = __u.__p1_.first().__next_;
|
__p1_.first().__next_ = __u.__p1_.first().__next_;
|
||||||
if (size() > 0)
|
if (size() > 0)
|
||||||
{
|
{
|
||||||
__bucket_list_[__p1_.first().__next_->__hash_ % bucket_count()] =
|
__bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] =
|
||||||
static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
|
static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
|
||||||
__u.__p1_.first().__next_ = nullptr;
|
__u.__p1_.first().__next_ = nullptr;
|
||||||
__u.size() = 0;
|
__u.size() = 0;
|
||||||
@ -1190,12 +1211,12 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_unique(__node_pointer __
|
|||||||
size_t __chash;
|
size_t __chash;
|
||||||
if (__bc != 0)
|
if (__bc != 0)
|
||||||
{
|
{
|
||||||
__chash = __nd->__hash_ % __bc;
|
__chash = __constrain_hash(__nd->__hash_, __bc);
|
||||||
__ndptr = __bucket_list_[__chash];
|
__ndptr = __bucket_list_[__chash];
|
||||||
if (__ndptr != nullptr)
|
if (__ndptr != nullptr)
|
||||||
{
|
{
|
||||||
for (__ndptr = __ndptr->__next_; __ndptr != nullptr &&
|
for (__ndptr = __ndptr->__next_; __ndptr != nullptr &&
|
||||||
__ndptr->__hash_ % __bc == __chash;
|
__constrain_hash(__ndptr->__hash_, __bc) == __chash;
|
||||||
__ndptr = __ndptr->__next_)
|
__ndptr = __ndptr->__next_)
|
||||||
{
|
{
|
||||||
if (key_eq()(__ndptr->__value_, __nd->__value_))
|
if (key_eq()(__ndptr->__value_, __nd->__value_))
|
||||||
@ -1206,10 +1227,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_unique(__node_pointer __
|
|||||||
{
|
{
|
||||||
if (size()+1 > __bc * max_load_factor() || __bc == 0)
|
if (size()+1 > __bc * max_load_factor() || __bc == 0)
|
||||||
{
|
{
|
||||||
rehash(_VSTD::max<size_type>(2 * __bc + 1,
|
rehash(_VSTD::max<size_type>(2 * __bc + !__is_power2(__bc),
|
||||||
size_type(ceil(float(size() + 1) / max_load_factor()))));
|
size_type(ceil(float(size() + 1) / max_load_factor()))));
|
||||||
__bc = bucket_count();
|
__bc = bucket_count();
|
||||||
__chash = __nd->__hash_ % __bc;
|
__chash = __constrain_hash(__nd->__hash_, __bc);
|
||||||
}
|
}
|
||||||
// insert_after __bucket_list_[__chash], or __first_node if bucket is null
|
// insert_after __bucket_list_[__chash], or __first_node if bucket is null
|
||||||
__node_pointer __pn = __bucket_list_[__chash];
|
__node_pointer __pn = __bucket_list_[__chash];
|
||||||
@ -1221,7 +1242,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_unique(__node_pointer __
|
|||||||
// fix up __bucket_list_
|
// fix up __bucket_list_
|
||||||
__bucket_list_[__chash] = __pn;
|
__bucket_list_[__chash] = __pn;
|
||||||
if (__nd->__next_ != nullptr)
|
if (__nd->__next_ != nullptr)
|
||||||
__bucket_list_[__nd->__next_->__hash_ % __bc] = __nd;
|
__bucket_list_[__constrain_hash(__nd->__next_->__hash_, __bc)] = __nd;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1245,11 +1266,11 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(__node_pointer __c
|
|||||||
size_type __bc = bucket_count();
|
size_type __bc = bucket_count();
|
||||||
if (size()+1 > __bc * max_load_factor() || __bc == 0)
|
if (size()+1 > __bc * max_load_factor() || __bc == 0)
|
||||||
{
|
{
|
||||||
rehash(_VSTD::max<size_type>(2 * __bc + 1,
|
rehash(_VSTD::max<size_type>(2 * __bc + !__is_power2(__bc),
|
||||||
size_type(ceil(float(size() + 1) / max_load_factor()))));
|
size_type(ceil(float(size() + 1) / max_load_factor()))));
|
||||||
__bc = bucket_count();
|
__bc = bucket_count();
|
||||||
}
|
}
|
||||||
size_t __chash = __cp->__hash_ % __bc;
|
size_t __chash = __constrain_hash(__cp->__hash_, __bc);
|
||||||
__node_pointer __pn = __bucket_list_[__chash];
|
__node_pointer __pn = __bucket_list_[__chash];
|
||||||
if (__pn == nullptr)
|
if (__pn == nullptr)
|
||||||
{
|
{
|
||||||
@ -1259,12 +1280,12 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(__node_pointer __c
|
|||||||
// fix up __bucket_list_
|
// fix up __bucket_list_
|
||||||
__bucket_list_[__chash] = __pn;
|
__bucket_list_[__chash] = __pn;
|
||||||
if (__cp->__next_ != nullptr)
|
if (__cp->__next_ != nullptr)
|
||||||
__bucket_list_[__cp->__next_->__hash_ % __bc] = __cp;
|
__bucket_list_[__constrain_hash(__cp->__next_->__hash_, __bc)] = __cp;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (bool __found = false; __pn->__next_ != nullptr &&
|
for (bool __found = false; __pn->__next_ != nullptr &&
|
||||||
__pn->__next_->__hash_ % __bc == __chash;
|
__constrain_hash(__pn->__next_->__hash_, __bc) == __chash;
|
||||||
__pn = __pn->__next_)
|
__pn = __pn->__next_)
|
||||||
{
|
{
|
||||||
// __found key_eq() action
|
// __found key_eq() action
|
||||||
@ -1285,7 +1306,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(__node_pointer __c
|
|||||||
__pn->__next_ = __cp;
|
__pn->__next_ = __cp;
|
||||||
if (__cp->__next_ != nullptr)
|
if (__cp->__next_ != nullptr)
|
||||||
{
|
{
|
||||||
size_t __nhash = __cp->__next_->__hash_ % __bc;
|
size_t __nhash = __constrain_hash(__cp->__next_->__hash_, __bc);
|
||||||
if (__nhash != __chash)
|
if (__nhash != __chash)
|
||||||
__bucket_list_[__nhash] = __cp;
|
__bucket_list_[__nhash] = __cp;
|
||||||
}
|
}
|
||||||
@ -1306,11 +1327,11 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_multi(
|
|||||||
size_type __bc = bucket_count();
|
size_type __bc = bucket_count();
|
||||||
if (size()+1 > __bc * max_load_factor() || __bc == 0)
|
if (size()+1 > __bc * max_load_factor() || __bc == 0)
|
||||||
{
|
{
|
||||||
rehash(_VSTD::max<size_type>(2 * __bc + 1,
|
rehash(_VSTD::max<size_type>(2 * __bc + !__is_power2(__bc),
|
||||||
size_type(ceil(float(size() + 1) / max_load_factor()))));
|
size_type(ceil(float(size() + 1) / max_load_factor()))));
|
||||||
__bc = bucket_count();
|
__bc = bucket_count();
|
||||||
}
|
}
|
||||||
size_t __chash = __cp->__hash_ % __bc;
|
size_t __chash = __constrain_hash(__cp->__hash_, __bc);
|
||||||
__node_pointer __pp = __bucket_list_[__chash];
|
__node_pointer __pp = __bucket_list_[__chash];
|
||||||
while (__pp->__next_ != __np)
|
while (__pp->__next_ != __np)
|
||||||
__pp = __pp->__next_;
|
__pp = __pp->__next_;
|
||||||
@ -1333,12 +1354,12 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique(const value_type& __x)
|
|||||||
size_t __chash;
|
size_t __chash;
|
||||||
if (__bc != 0)
|
if (__bc != 0)
|
||||||
{
|
{
|
||||||
__chash = __hash % __bc;
|
__chash = __constrain_hash(__hash, __bc);
|
||||||
__nd = __bucket_list_[__chash];
|
__nd = __bucket_list_[__chash];
|
||||||
if (__nd != nullptr)
|
if (__nd != nullptr)
|
||||||
{
|
{
|
||||||
for (__nd = __nd->__next_; __nd != nullptr &&
|
for (__nd = __nd->__next_; __nd != nullptr &&
|
||||||
__nd->__hash_ % __bc == __chash;
|
__constrain_hash(__nd->__hash_, __bc) == __chash;
|
||||||
__nd = __nd->__next_)
|
__nd = __nd->__next_)
|
||||||
{
|
{
|
||||||
if (key_eq()(__nd->__value_, __x))
|
if (key_eq()(__nd->__value_, __x))
|
||||||
@ -1350,10 +1371,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique(const value_type& __x)
|
|||||||
__node_holder __h = __construct_node(__x, __hash);
|
__node_holder __h = __construct_node(__x, __hash);
|
||||||
if (size()+1 > __bc * max_load_factor() || __bc == 0)
|
if (size()+1 > __bc * max_load_factor() || __bc == 0)
|
||||||
{
|
{
|
||||||
rehash(_VSTD::max<size_type>(2 * __bc + 1,
|
rehash(_VSTD::max<size_type>(2 * __bc + !__is_power2(__bc),
|
||||||
size_type(ceil(float(size() + 1) / max_load_factor()))));
|
size_type(ceil(float(size() + 1) / max_load_factor()))));
|
||||||
__bc = bucket_count();
|
__bc = bucket_count();
|
||||||
__chash = __hash % __bc;
|
__chash = __constrain_hash(__hash, __bc);
|
||||||
}
|
}
|
||||||
// insert_after __bucket_list_[__chash], or __first_node if bucket is null
|
// insert_after __bucket_list_[__chash], or __first_node if bucket is null
|
||||||
__node_pointer __pn = __bucket_list_[__chash];
|
__node_pointer __pn = __bucket_list_[__chash];
|
||||||
@ -1365,7 +1386,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique(const value_type& __x)
|
|||||||
// fix up __bucket_list_
|
// fix up __bucket_list_
|
||||||
__bucket_list_[__chash] = __pn;
|
__bucket_list_[__chash] = __pn;
|
||||||
if (__h->__next_ != nullptr)
|
if (__h->__next_ != nullptr)
|
||||||
__bucket_list_[__h->__next_->__hash_ % __bc] = __h.get();
|
__bucket_list_[__constrain_hash(__h->__next_->__hash_, __bc)] = __h.get();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1489,16 +1510,20 @@ template <class _Tp, class _Hash, class _Equal, class _Alloc>
|
|||||||
void
|
void
|
||||||
__hash_table<_Tp, _Hash, _Equal, _Alloc>::rehash(size_type __n)
|
__hash_table<_Tp, _Hash, _Equal, _Alloc>::rehash(size_type __n)
|
||||||
{
|
{
|
||||||
__n = __next_prime(_VSTD::max<size_type>(__n, size() > 0));
|
if (__n == 1)
|
||||||
|
__n = 2;
|
||||||
|
else if (__n & (__n - 1))
|
||||||
|
__n = __next_prime(__n);
|
||||||
size_type __bc = bucket_count();
|
size_type __bc = bucket_count();
|
||||||
if (__n > __bc)
|
if (__n > __bc)
|
||||||
__rehash(__n);
|
__rehash(__n);
|
||||||
else
|
else if (__n < __bc)
|
||||||
{
|
{
|
||||||
__n = _VSTD::max<size_type>
|
__n = _VSTD::max<size_type>
|
||||||
(
|
(
|
||||||
__n,
|
__n,
|
||||||
__next_prime(size_t(ceil(float(size()) / max_load_factor())))
|
__is_power2(__bc) ? __next_pow2(size_t(ceil(float(size()) / max_load_factor()))) :
|
||||||
|
__next_prime(size_t(ceil(float(size()) / max_load_factor())))
|
||||||
);
|
);
|
||||||
if (__n < __bc)
|
if (__n < __bc)
|
||||||
__rehash(__n);
|
__rehash(__n);
|
||||||
@ -1521,13 +1546,13 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::__rehash(size_type __nbc)
|
|||||||
__node_pointer __cp = __pp->__next_;
|
__node_pointer __cp = __pp->__next_;
|
||||||
if (__cp != nullptr)
|
if (__cp != nullptr)
|
||||||
{
|
{
|
||||||
size_type __chash = __cp->__hash_ % __nbc;
|
size_type __chash = __constrain_hash(__cp->__hash_, __nbc);
|
||||||
__bucket_list_[__chash] = __pp;
|
__bucket_list_[__chash] = __pp;
|
||||||
size_type __phash = __chash;
|
size_type __phash = __chash;
|
||||||
for (__pp = __cp, __cp = __cp->__next_; __cp != nullptr;
|
for (__pp = __cp, __cp = __cp->__next_; __cp != nullptr;
|
||||||
__cp = __pp->__next_)
|
__cp = __pp->__next_)
|
||||||
{
|
{
|
||||||
__chash = __cp->__hash_ % __nbc;
|
__chash = __constrain_hash(__cp->__hash_, __nbc);
|
||||||
if (__chash == __phash)
|
if (__chash == __phash)
|
||||||
__pp = __cp;
|
__pp = __cp;
|
||||||
else
|
else
|
||||||
@ -1565,12 +1590,12 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::find(const _Key& __k)
|
|||||||
size_type __bc = bucket_count();
|
size_type __bc = bucket_count();
|
||||||
if (__bc != 0)
|
if (__bc != 0)
|
||||||
{
|
{
|
||||||
size_t __chash = __hash % __bc;
|
size_t __chash = __constrain_hash(__hash, __bc);
|
||||||
__node_pointer __nd = __bucket_list_[__chash];
|
__node_pointer __nd = __bucket_list_[__chash];
|
||||||
if (__nd != nullptr)
|
if (__nd != nullptr)
|
||||||
{
|
{
|
||||||
for (__nd = __nd->__next_; __nd != nullptr &&
|
for (__nd = __nd->__next_; __nd != nullptr &&
|
||||||
__nd->__hash_ % __bc == __chash;
|
__constrain_hash(__nd->__hash_, __bc) == __chash;
|
||||||
__nd = __nd->__next_)
|
__nd = __nd->__next_)
|
||||||
{
|
{
|
||||||
if (key_eq()(__nd->__value_, __k))
|
if (key_eq()(__nd->__value_, __k))
|
||||||
@ -1590,12 +1615,12 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::find(const _Key& __k) const
|
|||||||
size_type __bc = bucket_count();
|
size_type __bc = bucket_count();
|
||||||
if (__bc != 0)
|
if (__bc != 0)
|
||||||
{
|
{
|
||||||
size_t __chash = __hash % __bc;
|
size_t __chash = __constrain_hash(__hash, __bc);
|
||||||
__node_const_pointer __nd = __bucket_list_[__chash];
|
__node_const_pointer __nd = __bucket_list_[__chash];
|
||||||
if (__nd != nullptr)
|
if (__nd != nullptr)
|
||||||
{
|
{
|
||||||
for (__nd = __nd->__next_; __nd != nullptr &&
|
for (__nd = __nd->__next_; __nd != nullptr &&
|
||||||
__nd->__hash_ % __bc == __chash;
|
__constrain_hash(__nd->__hash_, __bc) == __chash;
|
||||||
__nd = __nd->__next_)
|
__nd = __nd->__next_)
|
||||||
{
|
{
|
||||||
if (key_eq()(__nd->__value_, __k))
|
if (key_eq()(__nd->__value_, __k))
|
||||||
@ -1734,7 +1759,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::remove(const_iterator __p) _NOEXCEPT
|
|||||||
// current node
|
// current node
|
||||||
__node_pointer __cn = const_cast<__node_pointer>(__p.__node_);
|
__node_pointer __cn = const_cast<__node_pointer>(__p.__node_);
|
||||||
size_type __bc = bucket_count();
|
size_type __bc = bucket_count();
|
||||||
size_t __chash = __cn->__hash_ % __bc;
|
size_t __chash = __constrain_hash(__cn->__hash_, __bc);
|
||||||
// find previous node
|
// find previous node
|
||||||
__node_pointer __pn = __bucket_list_[__chash];
|
__node_pointer __pn = __bucket_list_[__chash];
|
||||||
for (; __pn->__next_ != __cn; __pn = __pn->__next_)
|
for (; __pn->__next_ != __cn; __pn = __pn->__next_)
|
||||||
@ -1742,15 +1767,15 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::remove(const_iterator __p) _NOEXCEPT
|
|||||||
// Fix up __bucket_list_
|
// Fix up __bucket_list_
|
||||||
// if __pn is not in same bucket (before begin is not in same bucket) &&
|
// if __pn is not in same bucket (before begin is not in same bucket) &&
|
||||||
// if __cn->__next_ is not in same bucket (nullptr is not in same bucket)
|
// if __cn->__next_ is not in same bucket (nullptr is not in same bucket)
|
||||||
if (__pn == _VSTD::addressof(__p1_.first()) || __pn->__hash_ % __bc != __chash)
|
if (__pn == _VSTD::addressof(__p1_.first()) || __constrain_hash(__pn->__hash_, __bc) != __chash)
|
||||||
{
|
{
|
||||||
if (__cn->__next_ == nullptr || __cn->__next_->__hash_ % __bc != __chash)
|
if (__cn->__next_ == nullptr || __constrain_hash(__cn->__next_->__hash_, __bc) != __chash)
|
||||||
__bucket_list_[__chash] = nullptr;
|
__bucket_list_[__chash] = nullptr;
|
||||||
}
|
}
|
||||||
// if __cn->__next_ is not in same bucket (nullptr is in same bucket)
|
// if __cn->__next_ is not in same bucket (nullptr is in same bucket)
|
||||||
if (__cn->__next_ != nullptr)
|
if (__cn->__next_ != nullptr)
|
||||||
{
|
{
|
||||||
size_t __nhash = __cn->__next_->__hash_ % __bc;
|
size_t __nhash = __constrain_hash(__cn->__next_->__hash_, __bc);
|
||||||
if (__nhash != __chash)
|
if (__nhash != __chash)
|
||||||
__bucket_list_[__nhash] = __pn;
|
__bucket_list_[__nhash] = __pn;
|
||||||
}
|
}
|
||||||
@ -1881,10 +1906,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u)
|
|||||||
__p2_.swap(__u.__p2_);
|
__p2_.swap(__u.__p2_);
|
||||||
__p3_.swap(__u.__p3_);
|
__p3_.swap(__u.__p3_);
|
||||||
if (size() > 0)
|
if (size() > 0)
|
||||||
__bucket_list_[__p1_.first().__next_->__hash_ % bucket_count()] =
|
__bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] =
|
||||||
static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
|
static_cast<__node_pointer>(_VSTD::addressof(__p1_.first()));
|
||||||
if (__u.size() > 0)
|
if (__u.size() > 0)
|
||||||
__u.__bucket_list_[__u.__p1_.first().__next_->__hash_ % __u.bucket_count()] =
|
__u.__bucket_list_[__constrain_hash(__u.__p1_.first().__next_->__hash_, __u.bucket_count())] =
|
||||||
static_cast<__node_pointer>(_VSTD::addressof(__u.__p1_.first()));
|
static_cast<__node_pointer>(_VSTD::addressof(__u.__p1_.first()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1898,7 +1923,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>::bucket_size(size_type __n) const
|
|||||||
if (__np != nullptr)
|
if (__np != nullptr)
|
||||||
{
|
{
|
||||||
for (__np = __np->__next_; __np != nullptr &&
|
for (__np = __np->__next_; __np != nullptr &&
|
||||||
__np->__hash_ % __bc == __n;
|
__constrain_hash(__np->__hash_, __bc) == __n;
|
||||||
__np = __np->__next_, ++__r)
|
__np = __np->__next_, ++__r)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
@ -31,17 +31,24 @@
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
class locale;
|
class _LIBCPP_VISIBLE locale;
|
||||||
|
|
||||||
template <class _Facet> bool has_facet(const locale&) _NOEXCEPT;
|
template <class _Facet>
|
||||||
template <class _Facet> const _Facet& use_facet(const locale&);
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
bool
|
||||||
|
has_facet(const locale&) _NOEXCEPT;
|
||||||
|
|
||||||
|
template <class _Facet>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
const _Facet&
|
||||||
|
use_facet(const locale&);
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE locale
|
class _LIBCPP_VISIBLE locale
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// types:
|
// types:
|
||||||
class facet;
|
class _LIBCPP_VISIBLE facet;
|
||||||
class id;
|
class _LIBCPP_VISIBLE id;
|
||||||
|
|
||||||
typedef int category;
|
typedef int category;
|
||||||
static const category // values assigned here are for exposition only
|
static const category // values assigned here are for exposition only
|
||||||
@ -119,7 +126,7 @@ class _LIBCPP_VISIBLE locale::id
|
|||||||
|
|
||||||
static int32_t __next_id;
|
static int32_t __next_id;
|
||||||
public:
|
public:
|
||||||
_LIBCPP_INLINE_VISIBILITY id() {}
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR id() :__id_(0) {}
|
||||||
private:
|
private:
|
||||||
void __init();
|
void __init();
|
||||||
void operator=(const id&); // = delete;
|
void operator=(const id&); // = delete;
|
||||||
|
@ -38,7 +38,11 @@ class _LIBCPP_VISIBLE mutex
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
mutex() {__m_ = (pthread_mutex_t)PTHREAD_MUTEX_INITIALIZER;}
|
#ifndef _LIBCPP_HAS_NO_CONSTEXPR
|
||||||
|
constexpr mutex() _NOEXCEPT : __m_(PTHREAD_MUTEX_INITIALIZER) {}
|
||||||
|
#else
|
||||||
|
mutex() _NOEXCEPT {__m_ = (pthread_mutex_t)PTHREAD_MUTEX_INITIALIZER;}
|
||||||
|
#endif
|
||||||
~mutex();
|
~mutex();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -47,8 +51,8 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
void lock();
|
void lock();
|
||||||
bool try_lock();
|
bool try_lock() _NOEXCEPT;
|
||||||
void unlock();
|
void unlock() _NOEXCEPT;
|
||||||
|
|
||||||
typedef pthread_mutex_t* native_handle_type;
|
typedef pthread_mutex_t* native_handle_type;
|
||||||
_LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__m_;}
|
_LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__m_;}
|
||||||
@ -58,17 +62,19 @@ struct _LIBCPP_VISIBLE defer_lock_t {};
|
|||||||
struct _LIBCPP_VISIBLE try_to_lock_t {};
|
struct _LIBCPP_VISIBLE try_to_lock_t {};
|
||||||
struct _LIBCPP_VISIBLE adopt_lock_t {};
|
struct _LIBCPP_VISIBLE adopt_lock_t {};
|
||||||
|
|
||||||
//constexpr
|
#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_MUTEX)
|
||||||
extern const
|
|
||||||
defer_lock_t defer_lock;
|
|
||||||
|
|
||||||
//constexpr
|
extern const defer_lock_t defer_lock;
|
||||||
extern const
|
extern const try_to_lock_t try_to_lock;
|
||||||
try_to_lock_t try_to_lock;
|
extern const adopt_lock_t adopt_lock;
|
||||||
|
|
||||||
//constexpr
|
#else
|
||||||
extern const
|
|
||||||
adopt_lock_t adopt_lock;
|
constexpr defer_lock_t defer_lock = defer_lock_t();
|
||||||
|
constexpr try_to_lock_t try_to_lock = try_to_lock_t();
|
||||||
|
constexpr adopt_lock_t adopt_lock = adopt_lock_t();
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
template <class _Mutex>
|
template <class _Mutex>
|
||||||
class _LIBCPP_VISIBLE lock_guard
|
class _LIBCPP_VISIBLE lock_guard
|
||||||
@ -106,12 +112,12 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
unique_lock() : __m_(nullptr), __owns_(false) {}
|
unique_lock() _NOEXCEPT : __m_(nullptr), __owns_(false) {}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
explicit unique_lock(mutex_type& __m)
|
explicit unique_lock(mutex_type& __m)
|
||||||
: __m_(&__m), __owns_(true) {__m_->lock();}
|
: __m_(&__m), __owns_(true) {__m_->lock();}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
unique_lock(mutex_type& __m, defer_lock_t)
|
unique_lock(mutex_type& __m, defer_lock_t) _NOEXCEPT
|
||||||
: __m_(&__m), __owns_(false) {}
|
: __m_(&__m), __owns_(false) {}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
unique_lock(mutex_type& __m, try_to_lock_t)
|
unique_lock(mutex_type& __m, try_to_lock_t)
|
||||||
@ -141,11 +147,11 @@ private:
|
|||||||
public:
|
public:
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
unique_lock(unique_lock&& __u)
|
unique_lock(unique_lock&& __u) _NOEXCEPT
|
||||||
: __m_(__u.__m_), __owns_(__u.__owns_)
|
: __m_(__u.__m_), __owns_(__u.__owns_)
|
||||||
{__u.__m_ = nullptr; __u.__owns_ = false;}
|
{__u.__m_ = nullptr; __u.__owns_ = false;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
unique_lock& operator=(unique_lock&& __u)
|
unique_lock& operator=(unique_lock&& __u) _NOEXCEPT
|
||||||
{
|
{
|
||||||
if (__owns_)
|
if (__owns_)
|
||||||
__m_->unlock();
|
__m_->unlock();
|
||||||
@ -190,13 +196,13 @@ public:
|
|||||||
void unlock();
|
void unlock();
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void swap(unique_lock& __u)
|
void swap(unique_lock& __u) _NOEXCEPT
|
||||||
{
|
{
|
||||||
_VSTD::swap(__m_, __u.__m_);
|
_VSTD::swap(__m_, __u.__m_);
|
||||||
_VSTD::swap(__owns_, __u.__owns_);
|
_VSTD::swap(__owns_, __u.__owns_);
|
||||||
}
|
}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
mutex_type* release()
|
mutex_type* release() _NOEXCEPT
|
||||||
{
|
{
|
||||||
mutex_type* __m = __m_;
|
mutex_type* __m = __m_;
|
||||||
__m_ = nullptr;
|
__m_ = nullptr;
|
||||||
@ -205,12 +211,12 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool owns_lock() const {return __owns_;}
|
bool owns_lock() const _NOEXCEPT {return __owns_;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
_LIBCPP_EXPLICIT
|
_LIBCPP_EXPLICIT
|
||||||
operator bool () const {return __owns_;}
|
operator bool () const _NOEXCEPT {return __owns_;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
mutex_type* mutex() const {return __m_;}
|
mutex_type* mutex() const _NOEXCEPT {return __m_;}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Mutex>
|
template <class _Mutex>
|
||||||
@ -276,7 +282,8 @@ unique_lock<_Mutex>::unlock()
|
|||||||
template <class _Mutex>
|
template <class _Mutex>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
void
|
void
|
||||||
swap(unique_lock<_Mutex>& __x, unique_lock<_Mutex>& __y) {__x.swap(__y);}
|
swap(unique_lock<_Mutex>& __x, unique_lock<_Mutex>& __y) _NOEXCEPT
|
||||||
|
{__x.swap(__y);}
|
||||||
|
|
||||||
struct _LIBCPP_VISIBLE cv_status
|
struct _LIBCPP_VISIBLE cv_status
|
||||||
{
|
{
|
||||||
@ -297,7 +304,11 @@ class _LIBCPP_VISIBLE condition_variable
|
|||||||
pthread_cond_t __cv_;
|
pthread_cond_t __cv_;
|
||||||
public:
|
public:
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
#ifndef _LIBCPP_HAS_NO_CONSTEXPR
|
||||||
|
constexpr condition_variable() : __cv_(PTHREAD_COND_INITIALIZER) {}
|
||||||
|
#else
|
||||||
condition_variable() {__cv_ = (pthread_cond_t)PTHREAD_COND_INITIALIZER;}
|
condition_variable() {__cv_ = (pthread_cond_t)PTHREAD_COND_INITIALIZER;}
|
||||||
|
#endif
|
||||||
~condition_variable();
|
~condition_variable();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -305,18 +316,13 @@ private:
|
|||||||
condition_variable& operator=(const condition_variable&); // = delete;
|
condition_variable& operator=(const condition_variable&); // = delete;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void notify_one();
|
void notify_one() _NOEXCEPT;
|
||||||
void notify_all();
|
void notify_all() _NOEXCEPT;
|
||||||
|
|
||||||
void wait(unique_lock<mutex>& __lk);
|
void wait(unique_lock<mutex>& __lk);
|
||||||
template <class _Predicate>
|
template <class _Predicate>
|
||||||
void wait(unique_lock<mutex>& __lk, _Predicate __pred);
|
void wait(unique_lock<mutex>& __lk, _Predicate __pred);
|
||||||
|
|
||||||
template <class _Duration>
|
|
||||||
cv_status
|
|
||||||
wait_until(unique_lock<mutex>& __lk,
|
|
||||||
const chrono::time_point<chrono::system_clock, _Duration>& __t);
|
|
||||||
|
|
||||||
template <class _Clock, class _Duration>
|
template <class _Clock, class _Duration>
|
||||||
cv_status
|
cv_status
|
||||||
wait_until(unique_lock<mutex>& __lk,
|
wait_until(unique_lock<mutex>& __lk,
|
||||||
@ -371,28 +377,13 @@ condition_variable::wait(unique_lock<mutex>& __lk, _Predicate __pred)
|
|||||||
wait(__lk);
|
wait(__lk);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _Duration>
|
|
||||||
cv_status
|
|
||||||
condition_variable::wait_until(unique_lock<mutex>& __lk,
|
|
||||||
const chrono::time_point<chrono::system_clock, _Duration>& __t)
|
|
||||||
{
|
|
||||||
using namespace chrono;
|
|
||||||
typedef time_point<system_clock, nanoseconds> __nano_sys_tmpt;
|
|
||||||
__do_timed_wait(__lk,
|
|
||||||
__nano_sys_tmpt(__ceil<nanoseconds>(__t.time_since_epoch())));
|
|
||||||
return system_clock::now() < __t ? cv_status::no_timeout :
|
|
||||||
cv_status::timeout;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class _Clock, class _Duration>
|
template <class _Clock, class _Duration>
|
||||||
cv_status
|
cv_status
|
||||||
condition_variable::wait_until(unique_lock<mutex>& __lk,
|
condition_variable::wait_until(unique_lock<mutex>& __lk,
|
||||||
const chrono::time_point<_Clock, _Duration>& __t)
|
const chrono::time_point<_Clock, _Duration>& __t)
|
||||||
{
|
{
|
||||||
using namespace chrono;
|
using namespace chrono;
|
||||||
system_clock::time_point __s_now = system_clock::now();
|
wait_for(__lk, __t - _Clock::now());
|
||||||
typename _Clock::time_point __c_now = _Clock::now();
|
|
||||||
__do_timed_wait(__lk, __s_now + __ceil<nanoseconds>(__t - __c_now));
|
|
||||||
return _Clock::now() < __t ? cv_status::no_timeout : cv_status::timeout;
|
return _Clock::now() < __t ? cv_status::no_timeout : cv_status::timeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -416,9 +407,17 @@ condition_variable::wait_for(unique_lock<mutex>& __lk,
|
|||||||
const chrono::duration<_Rep, _Period>& __d)
|
const chrono::duration<_Rep, _Period>& __d)
|
||||||
{
|
{
|
||||||
using namespace chrono;
|
using namespace chrono;
|
||||||
|
if (__d <= __d.zero())
|
||||||
|
return cv_status::timeout;
|
||||||
|
typedef time_point<system_clock, duration<long double, nano> > __sys_tpf;
|
||||||
|
typedef time_point<system_clock, nanoseconds> __sys_tpi;
|
||||||
|
__sys_tpf _Max = __sys_tpi::max();
|
||||||
system_clock::time_point __s_now = system_clock::now();
|
system_clock::time_point __s_now = system_clock::now();
|
||||||
steady_clock::time_point __c_now = steady_clock::now();
|
steady_clock::time_point __c_now = steady_clock::now();
|
||||||
__do_timed_wait(__lk, __s_now + __ceil<nanoseconds>(__d));
|
if (_Max - __d > __s_now)
|
||||||
|
__do_timed_wait(__lk, __s_now + __ceil<nanoseconds>(__d));
|
||||||
|
else
|
||||||
|
__do_timed_wait(__lk, __sys_tpi::max());
|
||||||
return steady_clock::now() - __c_now < __d ? cv_status::no_timeout :
|
return steady_clock::now() - __c_now < __d ? cv_status::no_timeout :
|
||||||
cv_status::timeout;
|
cv_status::timeout;
|
||||||
}
|
}
|
||||||
|
@ -614,8 +614,8 @@ public:
|
|||||||
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _TreeIterator> class __map_iterator;
|
template <class _TreeIterator> class _LIBCPP_VISIBLE __map_iterator;
|
||||||
template <class _TreeIterator> class __map_const_iterator;
|
template <class _TreeIterator> class _LIBCPP_VISIBLE __map_const_iterator;
|
||||||
|
|
||||||
template <class _Tp, class _NodePtr, class _DiffType>
|
template <class _Tp, class _NodePtr, class _DiffType>
|
||||||
class _LIBCPP_VISIBLE __tree_iterator
|
class _LIBCPP_VISIBLE __tree_iterator
|
||||||
|
@ -79,38 +79,47 @@ template <class _T1, class _T2> struct __tuple_like<pair<_T1, _T2> > : true_type
|
|||||||
template <class _Tp, size_t _Size> struct __tuple_like<array<_Tp, _Size> > : true_type {};
|
template <class _Tp, size_t _Size> struct __tuple_like<array<_Tp, _Size> > : true_type {};
|
||||||
|
|
||||||
template <size_t _Ip, class ..._Tp>
|
template <size_t _Ip, class ..._Tp>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
typename tuple_element<_Ip, tuple<_Tp...> >::type&
|
typename tuple_element<_Ip, tuple<_Tp...> >::type&
|
||||||
get(tuple<_Tp...>&) _NOEXCEPT;
|
get(tuple<_Tp...>&) _NOEXCEPT;
|
||||||
|
|
||||||
template <size_t _Ip, class ..._Tp>
|
template <size_t _Ip, class ..._Tp>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
const typename tuple_element<_Ip, tuple<_Tp...> >::type&
|
const typename tuple_element<_Ip, tuple<_Tp...> >::type&
|
||||||
get(const tuple<_Tp...>&) _NOEXCEPT;
|
get(const tuple<_Tp...>&) _NOEXCEPT;
|
||||||
|
|
||||||
template <size_t _Ip, class ..._Tp>
|
template <size_t _Ip, class ..._Tp>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
typename tuple_element<_Ip, tuple<_Tp...> >::type&&
|
typename tuple_element<_Ip, tuple<_Tp...> >::type&&
|
||||||
get(tuple<_Tp...>&&) _NOEXCEPT;
|
get(tuple<_Tp...>&&) _NOEXCEPT;
|
||||||
|
|
||||||
template <size_t _Ip, class _T1, class _T2>
|
template <size_t _Ip, class _T1, class _T2>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
typename tuple_element<_Ip, pair<_T1, _T2> >::type&
|
typename tuple_element<_Ip, pair<_T1, _T2> >::type&
|
||||||
get(pair<_T1, _T2>&) _NOEXCEPT;
|
get(pair<_T1, _T2>&) _NOEXCEPT;
|
||||||
|
|
||||||
template <size_t _Ip, class _T1, class _T2>
|
template <size_t _Ip, class _T1, class _T2>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
const typename tuple_element<_Ip, pair<_T1, _T2> >::type&
|
const typename tuple_element<_Ip, pair<_T1, _T2> >::type&
|
||||||
get(const pair<_T1, _T2>&) _NOEXCEPT;
|
get(const pair<_T1, _T2>&) _NOEXCEPT;
|
||||||
|
|
||||||
template <size_t _Ip, class _T1, class _T2>
|
template <size_t _Ip, class _T1, class _T2>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
|
typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
|
||||||
get(pair<_T1, _T2>&&) _NOEXCEPT;
|
get(pair<_T1, _T2>&&) _NOEXCEPT;
|
||||||
|
|
||||||
template <size_t _Ip, class _Tp, size_t _Size>
|
template <size_t _Ip, class _Tp, size_t _Size>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
_Tp&
|
_Tp&
|
||||||
get(array<_Tp, _Size>&) _NOEXCEPT;
|
get(array<_Tp, _Size>&) _NOEXCEPT;
|
||||||
|
|
||||||
template <size_t _Ip, class _Tp, size_t _Size>
|
template <size_t _Ip, class _Tp, size_t _Size>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
const _Tp&
|
const _Tp&
|
||||||
get(const array<_Tp, _Size>&) _NOEXCEPT;
|
get(const array<_Tp, _Size>&) _NOEXCEPT;
|
||||||
|
|
||||||
template <size_t _Ip, class _Tp, size_t _Size>
|
template <size_t _Ip, class _Tp, size_t _Size>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
_Tp&&
|
_Tp&&
|
||||||
get(array<_Tp, _Size>&&) _NOEXCEPT;
|
get(array<_Tp, _Size>&&) _NOEXCEPT;
|
||||||
|
|
||||||
|
@ -9,11 +9,11 @@
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#ifdef min
|
#ifdef min
|
||||||
#warning: macro min is incompatible with C++. #undef'ing min
|
#warning: macro min is incompatible with C++. #undefing min
|
||||||
#undef min
|
#undef min
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef max
|
#ifdef max
|
||||||
#warning: macro max is incompatible with C++. #undef'ing max
|
#warning: macro max is incompatible with C++. #undefing max
|
||||||
#undef max
|
#undef max
|
||||||
#endif
|
#endif
|
||||||
|
@ -593,7 +593,7 @@ template <class BidirectionalIterator, class Compare>
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <cstdlib>
|
#include <cstddef>
|
||||||
|
|
||||||
#include <__undef_min_max>
|
#include <__undef_min_max>
|
||||||
|
|
||||||
@ -2103,12 +2103,31 @@ reverse_copy(_BidirectionalIterator __first, _BidirectionalIterator __last, _Out
|
|||||||
|
|
||||||
template <class _ForwardIterator>
|
template <class _ForwardIterator>
|
||||||
_ForwardIterator
|
_ForwardIterator
|
||||||
__rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last, false_type)
|
__rotate_left(_ForwardIterator __first, _ForwardIterator __last)
|
||||||
|
{
|
||||||
|
typedef typename iterator_traits<_ForwardIterator>::value_type value_type;
|
||||||
|
value_type __tmp = _VSTD::move(*__first);
|
||||||
|
_ForwardIterator __lm1 = _VSTD::move(_VSTD::next(__first), __last, __first);
|
||||||
|
*__lm1 = _VSTD::move(__tmp);
|
||||||
|
return __lm1;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class _BidirectionalIterator>
|
||||||
|
_BidirectionalIterator
|
||||||
|
__rotate_right(_BidirectionalIterator __first, _BidirectionalIterator __last)
|
||||||
|
{
|
||||||
|
typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
|
||||||
|
_BidirectionalIterator __lm1 = _VSTD::prev(__last);
|
||||||
|
value_type __tmp = _VSTD::move(*__lm1);
|
||||||
|
_BidirectionalIterator __fp1 = _VSTD::move_backward(__first, __lm1, __last);
|
||||||
|
*__first = _VSTD::move(__tmp);
|
||||||
|
return __fp1;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class _ForwardIterator>
|
||||||
|
_ForwardIterator
|
||||||
|
__rotate_forward(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last)
|
||||||
{
|
{
|
||||||
if (__first == __middle)
|
|
||||||
return __last;
|
|
||||||
if (__middle == __last)
|
|
||||||
return __first;
|
|
||||||
_ForwardIterator __i = __middle;
|
_ForwardIterator __i = __middle;
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
@ -2156,15 +2175,11 @@ __gcd(_Integral __x, _Integral __y)
|
|||||||
|
|
||||||
template<typename _RandomAccessIterator>
|
template<typename _RandomAccessIterator>
|
||||||
_RandomAccessIterator
|
_RandomAccessIterator
|
||||||
__rotate(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last, true_type)
|
__rotate_gcd(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last)
|
||||||
{
|
{
|
||||||
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
|
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
|
||||||
typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
|
typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
|
||||||
|
|
||||||
if (__first == __middle)
|
|
||||||
return __last;
|
|
||||||
if (__middle == __last)
|
|
||||||
return __first;
|
|
||||||
const difference_type __m1 = __middle - __first;
|
const difference_type __m1 = __middle - __first;
|
||||||
const difference_type __m2 = __last - __middle;
|
const difference_type __m2 = __last - __middle;
|
||||||
if (__m1 == __m2)
|
if (__m1 == __m2)
|
||||||
@ -2172,15 +2187,15 @@ __rotate(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomA
|
|||||||
_VSTD::swap_ranges(__first, __middle, __middle);
|
_VSTD::swap_ranges(__first, __middle, __middle);
|
||||||
return __middle;
|
return __middle;
|
||||||
}
|
}
|
||||||
const difference_type __g = __gcd(__m1, __m2);
|
const difference_type __g = _VSTD::__gcd(__m1, __m2);
|
||||||
for (_RandomAccessIterator __p = __first + __g; __p != __first;)
|
for (_RandomAccessIterator __p = __first + __g; __p != __first;)
|
||||||
{
|
{
|
||||||
value_type __t(*--__p);
|
value_type __t(_VSTD::move(*--__p));
|
||||||
_RandomAccessIterator __p1 = __p;
|
_RandomAccessIterator __p1 = __p;
|
||||||
_RandomAccessIterator __p2 = __p1 + __m1;
|
_RandomAccessIterator __p2 = __p1 + __m1;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
*__p1 = *__p2;
|
*__p1 = _VSTD::move(*__p2);
|
||||||
__p1 = __p2;
|
__p1 = __p2;
|
||||||
const difference_type __d = __last - __p2;
|
const difference_type __d = __last - __p2;
|
||||||
if (__m1 < __d)
|
if (__m1 < __d)
|
||||||
@ -2188,30 +2203,72 @@ __rotate(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomA
|
|||||||
else
|
else
|
||||||
__p2 = __first + (__m1 - __d);
|
__p2 = __first + (__m1 - __d);
|
||||||
} while (__p2 != __p);
|
} while (__p2 != __p);
|
||||||
*__p1 = __t;
|
*__p1 = _VSTD::move(__t);
|
||||||
}
|
}
|
||||||
return __first + __m2;
|
return __first + __m2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <class _ForwardIterator>
|
||||||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_ForwardIterator
|
||||||
|
__rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last,
|
||||||
|
_VSTD::forward_iterator_tag)
|
||||||
|
{
|
||||||
|
typedef typename _VSTD::iterator_traits<_ForwardIterator>::value_type value_type;
|
||||||
|
if (_VSTD::is_trivially_move_assignable<value_type>::value)
|
||||||
|
{
|
||||||
|
if (_VSTD::next(__first) == __middle)
|
||||||
|
return _VSTD::__rotate_left(__first, __last);
|
||||||
|
}
|
||||||
|
return _VSTD::__rotate_forward(__first, __middle, __last);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class _BidirectionalIterator>
|
||||||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_BidirectionalIterator
|
||||||
|
__rotate(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,
|
||||||
|
_VSTD::bidirectional_iterator_tag)
|
||||||
|
{
|
||||||
|
typedef typename _VSTD::iterator_traits<_BidirectionalIterator>::value_type value_type;
|
||||||
|
if (_VSTD::is_trivially_move_assignable<value_type>::value)
|
||||||
|
{
|
||||||
|
if (_VSTD::next(__first) == __middle)
|
||||||
|
return _VSTD::__rotate_left(__first, __last);
|
||||||
|
if (_VSTD::next(__middle) == __last)
|
||||||
|
return _VSTD::__rotate_right(__first, __last);
|
||||||
|
}
|
||||||
|
return _VSTD::__rotate_forward(__first, __middle, __last);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class _RandomAccessIterator>
|
||||||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_RandomAccessIterator
|
||||||
|
__rotate(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last,
|
||||||
|
_VSTD::random_access_iterator_tag)
|
||||||
|
{
|
||||||
|
typedef typename _VSTD::iterator_traits<_RandomAccessIterator>::value_type value_type;
|
||||||
|
if (_VSTD::is_trivially_move_assignable<value_type>::value)
|
||||||
|
{
|
||||||
|
if (_VSTD::next(__first) == __middle)
|
||||||
|
return _VSTD::__rotate_left(__first, __last);
|
||||||
|
if (_VSTD::next(__middle) == __last)
|
||||||
|
return _VSTD::__rotate_right(__first, __last);
|
||||||
|
return _VSTD::__rotate_gcd(__first, __middle, __last);
|
||||||
|
}
|
||||||
|
return _VSTD::__rotate_forward(__first, __middle, __last);
|
||||||
|
}
|
||||||
|
|
||||||
template <class _ForwardIterator>
|
template <class _ForwardIterator>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
_ForwardIterator
|
_ForwardIterator
|
||||||
rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last)
|
rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last)
|
||||||
{
|
{
|
||||||
|
if (__first == __middle)
|
||||||
|
return __last;
|
||||||
|
if (__middle == __last)
|
||||||
|
return __first;
|
||||||
return _VSTD::__rotate(__first, __middle, __last,
|
return _VSTD::__rotate(__first, __middle, __last,
|
||||||
integral_constant
|
typename _VSTD::iterator_traits<_ForwardIterator>::iterator_category());
|
||||||
<
|
|
||||||
bool,
|
|
||||||
is_convertible
|
|
||||||
<
|
|
||||||
typename iterator_traits<_ForwardIterator>::iterator_category,
|
|
||||||
random_access_iterator_tag
|
|
||||||
>::value &&
|
|
||||||
is_trivially_copy_assignable
|
|
||||||
<
|
|
||||||
typename iterator_traits<_ForwardIterator>::value_type
|
|
||||||
>::value
|
|
||||||
>());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// rotate_copy
|
// rotate_copy
|
||||||
|
@ -55,7 +55,7 @@ struct array
|
|||||||
// capacity:
|
// capacity:
|
||||||
constexpr size_type size() const noexcept;
|
constexpr size_type size() const noexcept;
|
||||||
constexpr size_type max_size() const noexcept;
|
constexpr size_type max_size() const noexcept;
|
||||||
bool empty() const noexcept;
|
constexpr bool empty() const noexcept;
|
||||||
|
|
||||||
// element access:
|
// element access:
|
||||||
reference operator[](size_type n);
|
reference operator[](size_type n);
|
||||||
@ -173,11 +173,11 @@ struct _LIBCPP_VISIBLE array
|
|||||||
|
|
||||||
// capacity:
|
// capacity:
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
/*constexpr*/ size_type size() const _NOEXCEPT {return _Size;}
|
_LIBCPP_CONSTEXPR size_type size() const _NOEXCEPT {return _Size;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
/*constexpr*/ size_type max_size() const _NOEXCEPT {return _Size;}
|
_LIBCPP_CONSTEXPR size_type max_size() const _NOEXCEPT {return _Size;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool empty() const _NOEXCEPT {return _Size == 0;}
|
_LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT {return _Size == 0;}
|
||||||
|
|
||||||
// element access:
|
// element access:
|
||||||
_LIBCPP_INLINE_VISIBILITY reference operator[](size_type __n) {return __elems_[__n];}
|
_LIBCPP_INLINE_VISIBILITY reference operator[](size_type __n) {return __elems_[__n];}
|
||||||
|
@ -555,7 +555,7 @@ kill_dependency(_Tp __y) _NOEXCEPT
|
|||||||
template <class _Tp, bool = is_integral<_Tp>::value && !is_same<_Tp, bool>::value>
|
template <class _Tp, bool = is_integral<_Tp>::value && !is_same<_Tp, bool>::value>
|
||||||
struct __atomic_base // false
|
struct __atomic_base // false
|
||||||
{
|
{
|
||||||
_Atomic(_Tp) __a_;
|
mutable _Atomic(_Tp) __a_;
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool is_lock_free() const volatile _NOEXCEPT
|
bool is_lock_free() const volatile _NOEXCEPT
|
||||||
|
@ -148,9 +148,9 @@ class __bitset
|
|||||||
public:
|
public:
|
||||||
typedef ptrdiff_t difference_type;
|
typedef ptrdiff_t difference_type;
|
||||||
typedef size_t size_type;
|
typedef size_t size_type;
|
||||||
|
typedef size_type __storage_type;
|
||||||
protected:
|
protected:
|
||||||
typedef __bitset __self;
|
typedef __bitset __self;
|
||||||
typedef size_type __storage_type;
|
|
||||||
typedef __storage_type* __storage_pointer;
|
typedef __storage_type* __storage_pointer;
|
||||||
typedef const __storage_type* __const_storage_pointer;
|
typedef const __storage_type* __const_storage_pointer;
|
||||||
static const unsigned __bits_per_word = static_cast<unsigned>(sizeof(__storage_type) * CHAR_BIT);
|
static const unsigned __bits_per_word = static_cast<unsigned>(sizeof(__storage_type) * CHAR_BIT);
|
||||||
@ -159,7 +159,7 @@ protected:
|
|||||||
friend class __bit_const_reference<__bitset>;
|
friend class __bit_const_reference<__bitset>;
|
||||||
friend class __bit_iterator<__bitset, false>;
|
friend class __bit_iterator<__bitset, false>;
|
||||||
friend class __bit_iterator<__bitset, true>;
|
friend class __bit_iterator<__bitset, true>;
|
||||||
friend class __bit_array<__bitset>;
|
friend struct __bit_array<__bitset>;
|
||||||
|
|
||||||
__storage_type __first_[_N_words];
|
__storage_type __first_[_N_words];
|
||||||
|
|
||||||
@ -168,12 +168,12 @@ protected:
|
|||||||
typedef __bit_iterator<__bitset, false> iterator;
|
typedef __bit_iterator<__bitset, false> iterator;
|
||||||
typedef __bit_iterator<__bitset, true> const_iterator;
|
typedef __bit_iterator<__bitset, true> const_iterator;
|
||||||
|
|
||||||
__bitset() _NOEXCEPT;
|
_LIBCPP_CONSTEXPR __bitset() _NOEXCEPT;
|
||||||
explicit __bitset(unsigned long long __v) _NOEXCEPT;
|
explicit _LIBCPP_CONSTEXPR __bitset(unsigned long long __v) _NOEXCEPT;
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t __pos) _NOEXCEPT
|
_LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t __pos) _NOEXCEPT
|
||||||
{return reference(__first_ + __pos / __bits_per_word, __storage_type(1) << __pos % __bits_per_word);}
|
{return reference(__first_ + __pos / __bits_per_word, __storage_type(1) << __pos % __bits_per_word);}
|
||||||
_LIBCPP_INLINE_VISIBILITY const_reference __make_ref(size_t __pos) const _NOEXCEPT
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR const_reference __make_ref(size_t __pos) const _NOEXCEPT
|
||||||
{return const_reference(__first_ + __pos / __bits_per_word, __storage_type(1) << __pos % __bits_per_word);}
|
{return const_reference(__first_ + __pos / __bits_per_word, __storage_type(1) << __pos % __bits_per_word);}
|
||||||
_LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t __pos) _NOEXCEPT
|
_LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t __pos) _NOEXCEPT
|
||||||
{return iterator(__first_ + __pos / __bits_per_word, __pos % __bits_per_word);}
|
{return iterator(__first_ + __pos / __bits_per_word, __pos % __bits_per_word);}
|
||||||
@ -194,8 +194,10 @@ protected:
|
|||||||
bool any() const _NOEXCEPT;
|
bool any() const _NOEXCEPT;
|
||||||
size_t __hash_code() const _NOEXCEPT;
|
size_t __hash_code() const _NOEXCEPT;
|
||||||
private:
|
private:
|
||||||
|
#ifdef _LIBCPP_HAS_NO_CONSTEXPR
|
||||||
void __init(unsigned long long __v, false_type) _NOEXCEPT;
|
void __init(unsigned long long __v, false_type) _NOEXCEPT;
|
||||||
void __init(unsigned long long __v, true_type) _NOEXCEPT;
|
void __init(unsigned long long __v, true_type) _NOEXCEPT;
|
||||||
|
#endif // _LIBCPP_HAS_NO_CONSTEXPR
|
||||||
unsigned long to_ulong(false_type) const;
|
unsigned long to_ulong(false_type) const;
|
||||||
unsigned long to_ulong(true_type) const;
|
unsigned long to_ulong(true_type) const;
|
||||||
unsigned long long to_ullong(false_type) const;
|
unsigned long long to_ullong(false_type) const;
|
||||||
@ -206,11 +208,19 @@ private:
|
|||||||
|
|
||||||
template <size_t _N_words, size_t _Size>
|
template <size_t _N_words, size_t _Size>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
__bitset<_N_words, _Size>::__bitset() _NOEXCEPT
|
__bitset<_N_words, _Size>::__bitset() _NOEXCEPT
|
||||||
|
#ifndef _LIBCPP_HAS_NO_CONSTEXPR
|
||||||
|
: __first_{0}
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
|
#ifdef _LIBCPP_HAS_NO_CONSTEXPR
|
||||||
_VSTD::fill_n(__first_, _N_words, __storage_type(0));
|
_VSTD::fill_n(__first_, _N_words, __storage_type(0));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _LIBCPP_HAS_NO_CONSTEXPR
|
||||||
|
|
||||||
template <size_t _N_words, size_t _Size>
|
template <size_t _N_words, size_t _Size>
|
||||||
void
|
void
|
||||||
__bitset<_N_words, _Size>::__init(unsigned long long __v, false_type) _NOEXCEPT
|
__bitset<_N_words, _Size>::__init(unsigned long long __v, false_type) _NOEXCEPT
|
||||||
@ -232,11 +242,19 @@ __bitset<_N_words, _Size>::__init(unsigned long long __v, true_type) _NOEXCEPT
|
|||||||
_VSTD::fill(__first_ + 1, __first_ + sizeof(__first_)/sizeof(__first_[0]), __storage_type(0));
|
_VSTD::fill(__first_ + 1, __first_ + sizeof(__first_)/sizeof(__first_[0]), __storage_type(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // _LIBCPP_HAS_NO_CONSTEXPR
|
||||||
|
|
||||||
template <size_t _N_words, size_t _Size>
|
template <size_t _N_words, size_t _Size>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
__bitset<_N_words, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
|
__bitset<_N_words, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
|
||||||
|
#ifndef _LIBCPP_HAS_NO_CONSTEXPR
|
||||||
|
: __first_{__v}
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
|
#ifdef _LIBCPP_HAS_NO_CONSTEXPR
|
||||||
__init(__v, integral_constant<bool, sizeof(unsigned long long) == sizeof(__storage_type)>());
|
__init(__v, integral_constant<bool, sizeof(unsigned long long) == sizeof(__storage_type)>());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
template <size_t _N_words, size_t _Size>
|
template <size_t _N_words, size_t _Size>
|
||||||
@ -406,9 +424,9 @@ class __bitset<1, _Size>
|
|||||||
public:
|
public:
|
||||||
typedef ptrdiff_t difference_type;
|
typedef ptrdiff_t difference_type;
|
||||||
typedef size_t size_type;
|
typedef size_t size_type;
|
||||||
|
typedef size_type __storage_type;
|
||||||
protected:
|
protected:
|
||||||
typedef __bitset __self;
|
typedef __bitset __self;
|
||||||
typedef size_type __storage_type;
|
|
||||||
typedef __storage_type* __storage_pointer;
|
typedef __storage_type* __storage_pointer;
|
||||||
typedef const __storage_type* __const_storage_pointer;
|
typedef const __storage_type* __const_storage_pointer;
|
||||||
static const unsigned __bits_per_word = static_cast<unsigned>(sizeof(__storage_type) * CHAR_BIT);
|
static const unsigned __bits_per_word = static_cast<unsigned>(sizeof(__storage_type) * CHAR_BIT);
|
||||||
@ -417,7 +435,7 @@ protected:
|
|||||||
friend class __bit_const_reference<__bitset>;
|
friend class __bit_const_reference<__bitset>;
|
||||||
friend class __bit_iterator<__bitset, false>;
|
friend class __bit_iterator<__bitset, false>;
|
||||||
friend class __bit_iterator<__bitset, true>;
|
friend class __bit_iterator<__bitset, true>;
|
||||||
friend class __bit_array<__bitset>;
|
friend struct __bit_array<__bitset>;
|
||||||
|
|
||||||
__storage_type __first_;
|
__storage_type __first_;
|
||||||
|
|
||||||
@ -426,12 +444,12 @@ protected:
|
|||||||
typedef __bit_iterator<__bitset, false> iterator;
|
typedef __bit_iterator<__bitset, false> iterator;
|
||||||
typedef __bit_iterator<__bitset, true> const_iterator;
|
typedef __bit_iterator<__bitset, true> const_iterator;
|
||||||
|
|
||||||
__bitset() _NOEXCEPT;
|
_LIBCPP_CONSTEXPR __bitset() _NOEXCEPT;
|
||||||
explicit __bitset(unsigned long long __v) _NOEXCEPT;
|
explicit _LIBCPP_CONSTEXPR __bitset(unsigned long long __v) _NOEXCEPT;
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t __pos) _NOEXCEPT
|
_LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t __pos) _NOEXCEPT
|
||||||
{return reference(&__first_, __storage_type(1) << __pos);}
|
{return reference(&__first_, __storage_type(1) << __pos);}
|
||||||
_LIBCPP_INLINE_VISIBILITY const_reference __make_ref(size_t __pos) const _NOEXCEPT
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR const_reference __make_ref(size_t __pos) const _NOEXCEPT
|
||||||
{return const_reference(&__first_, __storage_type(1) << __pos);}
|
{return const_reference(&__first_, __storage_type(1) << __pos);}
|
||||||
_LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t __pos) _NOEXCEPT
|
_LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t __pos) _NOEXCEPT
|
||||||
{return iterator(&__first_ + __pos / __bits_per_word, __pos % __bits_per_word);}
|
{return iterator(&__first_ + __pos / __bits_per_word, __pos % __bits_per_word);}
|
||||||
@ -455,6 +473,7 @@ protected:
|
|||||||
|
|
||||||
template <size_t _Size>
|
template <size_t _Size>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
__bitset<1, _Size>::__bitset() _NOEXCEPT
|
__bitset<1, _Size>::__bitset() _NOEXCEPT
|
||||||
: __first_(0)
|
: __first_(0)
|
||||||
{
|
{
|
||||||
@ -462,6 +481,7 @@ __bitset<1, _Size>::__bitset() _NOEXCEPT
|
|||||||
|
|
||||||
template <size_t _Size>
|
template <size_t _Size>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
__bitset<1, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
|
__bitset<1, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
|
||||||
: __first_(static_cast<__storage_type>(__v))
|
: __first_(static_cast<__storage_type>(__v))
|
||||||
{
|
{
|
||||||
@ -549,9 +569,9 @@ class __bitset<0, 0>
|
|||||||
public:
|
public:
|
||||||
typedef ptrdiff_t difference_type;
|
typedef ptrdiff_t difference_type;
|
||||||
typedef size_t size_type;
|
typedef size_t size_type;
|
||||||
|
typedef size_type __storage_type;
|
||||||
protected:
|
protected:
|
||||||
typedef __bitset __self;
|
typedef __bitset __self;
|
||||||
typedef size_type __storage_type;
|
|
||||||
typedef __storage_type* __storage_pointer;
|
typedef __storage_type* __storage_pointer;
|
||||||
typedef const __storage_type* __const_storage_pointer;
|
typedef const __storage_type* __const_storage_pointer;
|
||||||
static const unsigned __bits_per_word = static_cast<unsigned>(sizeof(__storage_type) * CHAR_BIT);
|
static const unsigned __bits_per_word = static_cast<unsigned>(sizeof(__storage_type) * CHAR_BIT);
|
||||||
@ -567,12 +587,12 @@ protected:
|
|||||||
typedef __bit_iterator<__bitset, false> iterator;
|
typedef __bit_iterator<__bitset, false> iterator;
|
||||||
typedef __bit_iterator<__bitset, true> const_iterator;
|
typedef __bit_iterator<__bitset, true> const_iterator;
|
||||||
|
|
||||||
__bitset() _NOEXCEPT;
|
_LIBCPP_CONSTEXPR __bitset() _NOEXCEPT;
|
||||||
explicit __bitset(unsigned long long) _NOEXCEPT;
|
explicit _LIBCPP_CONSTEXPR __bitset(unsigned long long) _NOEXCEPT;
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t) _NOEXCEPT
|
_LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t) _NOEXCEPT
|
||||||
{return reference(0, 1);}
|
{return reference(0, 1);}
|
||||||
_LIBCPP_INLINE_VISIBILITY const_reference __make_ref(size_t) const _NOEXCEPT
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR const_reference __make_ref(size_t) const _NOEXCEPT
|
||||||
{return const_reference(0, 1);}
|
{return const_reference(0, 1);}
|
||||||
_LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t) _NOEXCEPT
|
_LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t) _NOEXCEPT
|
||||||
{return iterator(0, 0);}
|
{return iterator(0, 0);}
|
||||||
@ -595,16 +615,18 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
__bitset<0, 0>::__bitset() _NOEXCEPT
|
__bitset<0, 0>::__bitset() _NOEXCEPT
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
__bitset<0, 0>::__bitset(unsigned long long) _NOEXCEPT
|
__bitset<0, 0>::__bitset(unsigned long long) _NOEXCEPT
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
template <size_t _Size> class bitset;
|
template <size_t _Size> class _LIBCPP_VISIBLE bitset;
|
||||||
template <size_t _Size> struct hash<bitset<_Size> >;
|
template <size_t _Size> struct hash<bitset<_Size> >;
|
||||||
|
|
||||||
template <size_t _Size>
|
template <size_t _Size>
|
||||||
@ -619,8 +641,9 @@ public:
|
|||||||
typedef typename base::const_reference const_reference;
|
typedef typename base::const_reference const_reference;
|
||||||
|
|
||||||
// 23.3.5.1 constructors:
|
// 23.3.5.1 constructors:
|
||||||
/*constexpr*/ _LIBCPP_INLINE_VISIBILITY bitset() _NOEXCEPT {}
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR bitset() _NOEXCEPT {}
|
||||||
/*constexpr*/ _LIBCPP_INLINE_VISIBILITY bitset(unsigned long long __v) _NOEXCEPT : base(__v) {}
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||||
|
bitset(unsigned long long __v) _NOEXCEPT : base(__v) {}
|
||||||
template<class _CharT>
|
template<class _CharT>
|
||||||
explicit bitset(const _CharT* __str,
|
explicit bitset(const _CharT* __str,
|
||||||
typename basic_string<_CharT>::size_type __n = basic_string<_CharT>::npos,
|
typename basic_string<_CharT>::size_type __n = basic_string<_CharT>::npos,
|
||||||
@ -647,7 +670,8 @@ public:
|
|||||||
bitset& flip(size_t __pos);
|
bitset& flip(size_t __pos);
|
||||||
|
|
||||||
// element access:
|
// element access:
|
||||||
_LIBCPP_INLINE_VISIBILITY const_reference operator[](size_t __p) const {return base::__make_ref(__p);}
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||||
|
const_reference operator[](size_t __p) const {return base::__make_ref(__p);}
|
||||||
_LIBCPP_INLINE_VISIBILITY reference operator[](size_t __p) {return base::__make_ref(__p);}
|
_LIBCPP_INLINE_VISIBILITY reference operator[](size_t __p) {return base::__make_ref(__p);}
|
||||||
unsigned long to_ulong() const;
|
unsigned long to_ulong() const;
|
||||||
unsigned long long to_ullong() const;
|
unsigned long long to_ullong() const;
|
||||||
@ -663,7 +687,7 @@ public:
|
|||||||
basic_string<char, char_traits<char>, allocator<char> > to_string(char __zero = '0',
|
basic_string<char, char_traits<char>, allocator<char> > to_string(char __zero = '0',
|
||||||
char __one = '1') const;
|
char __one = '1') const;
|
||||||
size_t count() const _NOEXCEPT;
|
size_t count() const _NOEXCEPT;
|
||||||
/*constexpr*/ _LIBCPP_INLINE_VISIBILITY size_t size() const _NOEXCEPT {return _Size;}
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR size_t size() const _NOEXCEPT {return _Size;}
|
||||||
bool operator==(const bitset& __rhs) const _NOEXCEPT;
|
bool operator==(const bitset& __rhs) const _NOEXCEPT;
|
||||||
bool operator!=(const bitset& __rhs) const _NOEXCEPT;
|
bool operator!=(const bitset& __rhs) const _NOEXCEPT;
|
||||||
bool test(size_t __pos) const;
|
bool test(size_t __pos) const;
|
||||||
|
@ -20,6 +20,7 @@ namespace chrono
|
|||||||
{
|
{
|
||||||
|
|
||||||
template <class ToDuration, class Rep, class Period>
|
template <class ToDuration, class Rep, class Period>
|
||||||
|
constexpr
|
||||||
ToDuration
|
ToDuration
|
||||||
duration_cast(const duration<Rep, Period>& fd);
|
duration_cast(const duration<Rep, Period>& fd);
|
||||||
|
|
||||||
@ -29,9 +30,9 @@ template <class Rep>
|
|||||||
struct duration_values
|
struct duration_values
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static Rep zero();
|
static constexpr Rep zero();
|
||||||
static Rep max();
|
static constexpr Rep max();
|
||||||
static Rep min();
|
static constexpr Rep min();
|
||||||
};
|
};
|
||||||
|
|
||||||
// duration
|
// duration
|
||||||
@ -46,9 +47,9 @@ public:
|
|||||||
typedef Rep rep;
|
typedef Rep rep;
|
||||||
typedef Period period;
|
typedef Period period;
|
||||||
|
|
||||||
duration() = default;
|
constexpr duration() = default;
|
||||||
template <class Rep2>
|
template <class Rep2>
|
||||||
explicit duration(const Rep2& r,
|
constexpr explicit duration(const Rep2& r,
|
||||||
typename enable_if
|
typename enable_if
|
||||||
<
|
<
|
||||||
is_convertible<Rep2, rep>::value &&
|
is_convertible<Rep2, rep>::value &&
|
||||||
@ -58,7 +59,7 @@ public:
|
|||||||
|
|
||||||
// conversions
|
// conversions
|
||||||
template <class Rep2, class Period2>
|
template <class Rep2, class Period2>
|
||||||
duration(const duration<Rep2, Period2>& d,
|
constexpr duration(const duration<Rep2, Period2>& d,
|
||||||
typename enable_if
|
typename enable_if
|
||||||
<
|
<
|
||||||
treat_as_floating_point<rep>::value ||
|
treat_as_floating_point<rep>::value ||
|
||||||
@ -67,12 +68,12 @@ public:
|
|||||||
|
|
||||||
// observer
|
// observer
|
||||||
|
|
||||||
rep count() const;
|
constexpr rep count() const;
|
||||||
|
|
||||||
// arithmetic
|
// arithmetic
|
||||||
|
|
||||||
duration operator+() const;
|
constexpr duration operator+() const;
|
||||||
duration operator-() const;
|
constexpr duration operator-() const;
|
||||||
duration& operator++();
|
duration& operator++();
|
||||||
duration operator++(int);
|
duration operator++(int);
|
||||||
duration& operator--();
|
duration& operator--();
|
||||||
@ -86,9 +87,9 @@ public:
|
|||||||
|
|
||||||
// special values
|
// special values
|
||||||
|
|
||||||
static duration zero();
|
static constexpr duration zero();
|
||||||
static duration min();
|
static constexpr duration min();
|
||||||
static duration max();
|
static constexpr duration max();
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef duration<long long, nano> nanoseconds;
|
typedef duration<long long, nano> nanoseconds;
|
||||||
@ -145,36 +146,48 @@ namespace chrono {
|
|||||||
|
|
||||||
// duration arithmetic
|
// duration arithmetic
|
||||||
template <class Rep1, class Period1, class Rep2, class Period2>
|
template <class Rep1, class Period1, class Rep2, class Period2>
|
||||||
|
constexpr
|
||||||
typename common_type<duration<Rep1, Period1>, duration<Rep2, Period2>>::type
|
typename common_type<duration<Rep1, Period1>, duration<Rep2, Period2>>::type
|
||||||
operator+(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
|
operator+(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
|
||||||
template <class Rep1, class Period1, class Rep2, class Period2>
|
template <class Rep1, class Period1, class Rep2, class Period2>
|
||||||
|
constexpr
|
||||||
typename common_type<duration<Rep1, Period1>, duration<Rep2, Period2>>::type
|
typename common_type<duration<Rep1, Period1>, duration<Rep2, Period2>>::type
|
||||||
operator-(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
|
operator-(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
|
||||||
template <class Rep1, class Period, class Rep2>
|
template <class Rep1, class Period, class Rep2>
|
||||||
|
constexpr
|
||||||
duration<typename common_type<Rep1, Rep2>::type, Period>
|
duration<typename common_type<Rep1, Rep2>::type, Period>
|
||||||
operator*(const duration<Rep1, Period>& d, const Rep2& s);
|
operator*(const duration<Rep1, Period>& d, const Rep2& s);
|
||||||
template <class Rep1, class Period, class Rep2>
|
template <class Rep1, class Period, class Rep2>
|
||||||
|
constexpr
|
||||||
duration<typename common_type<Rep1, Rep2>::type, Period>
|
duration<typename common_type<Rep1, Rep2>::type, Period>
|
||||||
operator*(const Rep1& s, const duration<Rep2, Period>& d);
|
operator*(const Rep1& s, const duration<Rep2, Period>& d);
|
||||||
template <class Rep1, class Period, class Rep2>
|
template <class Rep1, class Period, class Rep2>
|
||||||
|
constexpr
|
||||||
duration<typename common_type<Rep1, Rep2>::type, Period>
|
duration<typename common_type<Rep1, Rep2>::type, Period>
|
||||||
operator/(const duration<Rep1, Period>& d, const Rep2& s);
|
operator/(const duration<Rep1, Period>& d, const Rep2& s);
|
||||||
template <class Rep1, class Period1, class Rep2, class Period2>
|
template <class Rep1, class Period1, class Rep2, class Period2>
|
||||||
|
constexpr
|
||||||
typename common_type<Rep1, Rep2>::type
|
typename common_type<Rep1, Rep2>::type
|
||||||
operator/(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
|
operator/(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
|
||||||
|
|
||||||
// duration comparisons
|
// duration comparisons
|
||||||
template <class Rep1, class Period1, class Rep2, class Period2>
|
template <class Rep1, class Period1, class Rep2, class Period2>
|
||||||
|
constexpr
|
||||||
bool operator==(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
|
bool operator==(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
|
||||||
template <class Rep1, class Period1, class Rep2, class Period2>
|
template <class Rep1, class Period1, class Rep2, class Period2>
|
||||||
|
constexpr
|
||||||
bool operator!=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
|
bool operator!=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
|
||||||
template <class Rep1, class Period1, class Rep2, class Period2>
|
template <class Rep1, class Period1, class Rep2, class Period2>
|
||||||
|
constexpr
|
||||||
bool operator< (const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
|
bool operator< (const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
|
||||||
template <class Rep1, class Period1, class Rep2, class Period2>
|
template <class Rep1, class Period1, class Rep2, class Period2>
|
||||||
|
constexpr
|
||||||
bool operator<=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
|
bool operator<=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
|
||||||
template <class Rep1, class Period1, class Rep2, class Period2>
|
template <class Rep1, class Period1, class Rep2, class Period2>
|
||||||
|
constexpr
|
||||||
bool operator> (const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
|
bool operator> (const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
|
||||||
template <class Rep1, class Period1, class Rep2, class Period2>
|
template <class Rep1, class Period1, class Rep2, class Period2>
|
||||||
|
constexpr
|
||||||
bool operator>=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
|
bool operator>=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs);
|
||||||
|
|
||||||
// duration_cast
|
// duration_cast
|
||||||
@ -306,7 +319,7 @@ struct __duration_cast;
|
|||||||
template <class _FromDuration, class _ToDuration, class _Period>
|
template <class _FromDuration, class _ToDuration, class _Period>
|
||||||
struct __duration_cast<_FromDuration, _ToDuration, _Period, true, true>
|
struct __duration_cast<_FromDuration, _ToDuration, _Period, true, true>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||||
_ToDuration operator()(const _FromDuration& __fd) const
|
_ToDuration operator()(const _FromDuration& __fd) const
|
||||||
{
|
{
|
||||||
return _ToDuration(static_cast<typename _ToDuration::rep>(__fd.count()));
|
return _ToDuration(static_cast<typename _ToDuration::rep>(__fd.count()));
|
||||||
@ -316,7 +329,7 @@ struct __duration_cast<_FromDuration, _ToDuration, _Period, true, true>
|
|||||||
template <class _FromDuration, class _ToDuration, class _Period>
|
template <class _FromDuration, class _ToDuration, class _Period>
|
||||||
struct __duration_cast<_FromDuration, _ToDuration, _Period, true, false>
|
struct __duration_cast<_FromDuration, _ToDuration, _Period, true, false>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||||
_ToDuration operator()(const _FromDuration& __fd) const
|
_ToDuration operator()(const _FromDuration& __fd) const
|
||||||
{
|
{
|
||||||
typedef typename common_type<typename _ToDuration::rep, typename _FromDuration::rep, intmax_t>::type _Ct;
|
typedef typename common_type<typename _ToDuration::rep, typename _FromDuration::rep, intmax_t>::type _Ct;
|
||||||
@ -328,7 +341,7 @@ struct __duration_cast<_FromDuration, _ToDuration, _Period, true, false>
|
|||||||
template <class _FromDuration, class _ToDuration, class _Period>
|
template <class _FromDuration, class _ToDuration, class _Period>
|
||||||
struct __duration_cast<_FromDuration, _ToDuration, _Period, false, true>
|
struct __duration_cast<_FromDuration, _ToDuration, _Period, false, true>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||||
_ToDuration operator()(const _FromDuration& __fd) const
|
_ToDuration operator()(const _FromDuration& __fd) const
|
||||||
{
|
{
|
||||||
typedef typename common_type<typename _ToDuration::rep, typename _FromDuration::rep, intmax_t>::type _Ct;
|
typedef typename common_type<typename _ToDuration::rep, typename _FromDuration::rep, intmax_t>::type _Ct;
|
||||||
@ -340,7 +353,7 @@ struct __duration_cast<_FromDuration, _ToDuration, _Period, false, true>
|
|||||||
template <class _FromDuration, class _ToDuration, class _Period>
|
template <class _FromDuration, class _ToDuration, class _Period>
|
||||||
struct __duration_cast<_FromDuration, _ToDuration, _Period, false, false>
|
struct __duration_cast<_FromDuration, _ToDuration, _Period, false, false>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||||
_ToDuration operator()(const _FromDuration& __fd) const
|
_ToDuration operator()(const _FromDuration& __fd) const
|
||||||
{
|
{
|
||||||
typedef typename common_type<typename _ToDuration::rep, typename _FromDuration::rep, intmax_t>::type _Ct;
|
typedef typename common_type<typename _ToDuration::rep, typename _FromDuration::rep, intmax_t>::type _Ct;
|
||||||
@ -352,6 +365,7 @@ struct __duration_cast<_FromDuration, _ToDuration, _Period, false, false>
|
|||||||
|
|
||||||
template <class _ToDuration, class _Rep, class _Period>
|
template <class _ToDuration, class _Rep, class _Period>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
typename enable_if
|
typename enable_if
|
||||||
<
|
<
|
||||||
__is_duration<_ToDuration>::value,
|
__is_duration<_ToDuration>::value,
|
||||||
@ -369,9 +383,9 @@ template <class _Rep>
|
|||||||
struct _LIBCPP_VISIBLE duration_values
|
struct _LIBCPP_VISIBLE duration_values
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
_LIBCPP_INLINE_VISIBILITY static _Rep zero() {return _Rep(0);}
|
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR _Rep zero() {return _Rep(0);}
|
||||||
_LIBCPP_INLINE_VISIBILITY static _Rep max() {return numeric_limits<_Rep>::max();}
|
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR _Rep max() {return numeric_limits<_Rep>::max();}
|
||||||
_LIBCPP_INLINE_VISIBILITY static _Rep min() {return numeric_limits<_Rep>::lowest();}
|
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR _Rep min() {return numeric_limits<_Rep>::lowest();}
|
||||||
};
|
};
|
||||||
|
|
||||||
// duration
|
// duration
|
||||||
@ -389,9 +403,9 @@ private:
|
|||||||
rep __rep_;
|
rep __rep_;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY duration() {} // = default;
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR duration() {} // = default;
|
||||||
template <class _Rep2>
|
template <class _Rep2>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||||
explicit duration(const _Rep2& __r,
|
explicit duration(const _Rep2& __r,
|
||||||
typename enable_if
|
typename enable_if
|
||||||
<
|
<
|
||||||
@ -403,7 +417,7 @@ public:
|
|||||||
|
|
||||||
// conversions
|
// conversions
|
||||||
template <class _Rep2, class _Period2>
|
template <class _Rep2, class _Period2>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||||
duration(const duration<_Rep2, _Period2>& __d,
|
duration(const duration<_Rep2, _Period2>& __d,
|
||||||
typename enable_if
|
typename enable_if
|
||||||
<
|
<
|
||||||
@ -415,12 +429,12 @@ public:
|
|||||||
|
|
||||||
// observer
|
// observer
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY rep count() const {return __rep_;}
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR rep count() const {return __rep_;}
|
||||||
|
|
||||||
// arithmetic
|
// arithmetic
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY duration operator+() const {return *this;}
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR duration operator+() const {return *this;}
|
||||||
_LIBCPP_INLINE_VISIBILITY duration operator-() const {return duration(-__rep_);}
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR duration operator-() const {return duration(-__rep_);}
|
||||||
_LIBCPP_INLINE_VISIBILITY duration& operator++() {++__rep_; return *this;}
|
_LIBCPP_INLINE_VISIBILITY duration& operator++() {++__rep_; return *this;}
|
||||||
_LIBCPP_INLINE_VISIBILITY duration operator++(int) {return duration(__rep_++);}
|
_LIBCPP_INLINE_VISIBILITY duration operator++(int) {return duration(__rep_++);}
|
||||||
_LIBCPP_INLINE_VISIBILITY duration& operator--() {--__rep_; return *this;}
|
_LIBCPP_INLINE_VISIBILITY duration& operator--() {--__rep_; return *this;}
|
||||||
@ -436,9 +450,9 @@ public:
|
|||||||
|
|
||||||
// special values
|
// special values
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY static duration zero() {return duration(duration_values<rep>::zero());}
|
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR duration zero() {return duration(duration_values<rep>::zero());}
|
||||||
_LIBCPP_INLINE_VISIBILITY static duration min() {return duration(duration_values<rep>::min());}
|
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR duration min() {return duration(duration_values<rep>::min());}
|
||||||
_LIBCPP_INLINE_VISIBILITY static duration max() {return duration(duration_values<rep>::max());}
|
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR duration max() {return duration(duration_values<rep>::max());}
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef duration<long long, nano> nanoseconds;
|
typedef duration<long long, nano> nanoseconds;
|
||||||
@ -453,7 +467,7 @@ typedef duration< long, ratio<3600> > hours;
|
|||||||
template <class _LhsDuration, class _RhsDuration>
|
template <class _LhsDuration, class _RhsDuration>
|
||||||
struct __duration_eq
|
struct __duration_eq
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||||
bool operator()(const _LhsDuration& __lhs, const _RhsDuration& __rhs)
|
bool operator()(const _LhsDuration& __lhs, const _RhsDuration& __rhs)
|
||||||
{
|
{
|
||||||
typedef typename common_type<_LhsDuration, _RhsDuration>::type _Ct;
|
typedef typename common_type<_LhsDuration, _RhsDuration>::type _Ct;
|
||||||
@ -464,13 +478,14 @@ struct __duration_eq
|
|||||||
template <class _LhsDuration>
|
template <class _LhsDuration>
|
||||||
struct __duration_eq<_LhsDuration, _LhsDuration>
|
struct __duration_eq<_LhsDuration, _LhsDuration>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||||
bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs)
|
bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs)
|
||||||
{return __lhs.count() == __rhs.count();}
|
{return __lhs.count() == __rhs.count();}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
|
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
bool
|
bool
|
||||||
operator==(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
|
operator==(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
|
||||||
{
|
{
|
||||||
@ -481,6 +496,7 @@ operator==(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period
|
|||||||
|
|
||||||
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
|
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
bool
|
bool
|
||||||
operator!=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
|
operator!=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
|
||||||
{
|
{
|
||||||
@ -492,7 +508,7 @@ operator!=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period
|
|||||||
template <class _LhsDuration, class _RhsDuration>
|
template <class _LhsDuration, class _RhsDuration>
|
||||||
struct __duration_lt
|
struct __duration_lt
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||||
bool operator()(const _LhsDuration& __lhs, const _RhsDuration& __rhs)
|
bool operator()(const _LhsDuration& __lhs, const _RhsDuration& __rhs)
|
||||||
{
|
{
|
||||||
typedef typename common_type<_LhsDuration, _RhsDuration>::type _Ct;
|
typedef typename common_type<_LhsDuration, _RhsDuration>::type _Ct;
|
||||||
@ -503,13 +519,14 @@ struct __duration_lt
|
|||||||
template <class _LhsDuration>
|
template <class _LhsDuration>
|
||||||
struct __duration_lt<_LhsDuration, _LhsDuration>
|
struct __duration_lt<_LhsDuration, _LhsDuration>
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||||
bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs)
|
bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs)
|
||||||
{return __lhs.count() < __rhs.count();}
|
{return __lhs.count() < __rhs.count();}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
|
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
bool
|
bool
|
||||||
operator< (const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
|
operator< (const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
|
||||||
{
|
{
|
||||||
@ -520,6 +537,7 @@ operator< (const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period
|
|||||||
|
|
||||||
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
|
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
bool
|
bool
|
||||||
operator> (const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
|
operator> (const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
|
||||||
{
|
{
|
||||||
@ -530,6 +548,7 @@ operator> (const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period
|
|||||||
|
|
||||||
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
|
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
bool
|
bool
|
||||||
operator<=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
|
operator<=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
|
||||||
{
|
{
|
||||||
@ -540,6 +559,7 @@ operator<=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period
|
|||||||
|
|
||||||
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
|
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
bool
|
bool
|
||||||
operator>=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
|
operator>=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
|
||||||
{
|
{
|
||||||
@ -550,30 +570,31 @@ operator>=(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period
|
|||||||
|
|
||||||
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
|
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type
|
typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type
|
||||||
operator+(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
|
operator+(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
|
||||||
{
|
{
|
||||||
typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type __r = __lhs;
|
typedef typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _Cd;
|
||||||
__r += __rhs;
|
return _Cd(_Cd(__lhs).count() + _Cd(__rhs).count());
|
||||||
return __r;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Duration -
|
// Duration -
|
||||||
|
|
||||||
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
|
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type
|
typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type
|
||||||
operator-(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
|
operator-(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
|
||||||
{
|
{
|
||||||
typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type __r = __lhs;
|
typedef typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _Cd;
|
||||||
__r -= __rhs;
|
return _Cd(_Cd(__lhs).count() - _Cd(__rhs).count());
|
||||||
return __r;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Duration *
|
// Duration *
|
||||||
|
|
||||||
template <class _Rep1, class _Period, class _Rep2>
|
template <class _Rep1, class _Period, class _Rep2>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
typename enable_if
|
typename enable_if
|
||||||
<
|
<
|
||||||
is_convertible<_Rep2, typename common_type<_Rep1, _Rep2>::type>::value,
|
is_convertible<_Rep2, typename common_type<_Rep1, _Rep2>::type>::value,
|
||||||
@ -582,13 +603,13 @@ typename enable_if
|
|||||||
operator*(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
|
operator*(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
|
||||||
{
|
{
|
||||||
typedef typename common_type<_Rep1, _Rep2>::type _Cr;
|
typedef typename common_type<_Rep1, _Rep2>::type _Cr;
|
||||||
duration<_Cr, _Period> __r = __d;
|
typedef duration<_Cr, _Period> _Cd;
|
||||||
__r *= static_cast<_Cr>(__s);
|
return _Cd(_Cd(__d).count() * static_cast<_Cr>(__s));
|
||||||
return __r;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _Rep1, class _Period, class _Rep2>
|
template <class _Rep1, class _Period, class _Rep2>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
typename enable_if
|
typename enable_if
|
||||||
<
|
<
|
||||||
is_convertible<_Rep1, typename common_type<_Rep1, _Rep2>::type>::value,
|
is_convertible<_Rep1, typename common_type<_Rep1, _Rep2>::type>::value,
|
||||||
@ -627,17 +648,18 @@ struct __duration_divide_result<duration<_Rep1, _Period>, _Rep2, false>
|
|||||||
|
|
||||||
template <class _Rep1, class _Period, class _Rep2>
|
template <class _Rep1, class _Period, class _Rep2>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
typename __duration_divide_result<duration<_Rep1, _Period>, _Rep2>::type
|
typename __duration_divide_result<duration<_Rep1, _Period>, _Rep2>::type
|
||||||
operator/(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
|
operator/(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
|
||||||
{
|
{
|
||||||
typedef typename common_type<_Rep1, _Rep2>::type _Cr;
|
typedef typename common_type<_Rep1, _Rep2>::type _Cr;
|
||||||
duration<_Cr, _Period> __r = __d;
|
typedef duration<_Cr, _Period> _Cd;
|
||||||
__r /= static_cast<_Cr>(__s);
|
return _Cd(_Cd(__d).count() / static_cast<_Cr>(__s));
|
||||||
return __r;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
|
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
typename common_type<_Rep1, _Rep2>::type
|
typename common_type<_Rep1, _Rep2>::type
|
||||||
operator/(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
|
operator/(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
|
||||||
{
|
{
|
||||||
@ -649,23 +671,24 @@ operator/(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2
|
|||||||
|
|
||||||
template <class _Rep1, class _Period, class _Rep2>
|
template <class _Rep1, class _Period, class _Rep2>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
typename __duration_divide_result<duration<_Rep1, _Period>, _Rep2>::type
|
typename __duration_divide_result<duration<_Rep1, _Period>, _Rep2>::type
|
||||||
operator%(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
|
operator%(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
|
||||||
{
|
{
|
||||||
typedef typename common_type<_Rep1, _Rep2>::type _Cr;
|
typedef typename common_type<_Rep1, _Rep2>::type _Cr;
|
||||||
duration<_Cr, _Period> __r = __d;
|
typedef duration<_Cr, _Period> _Cd;
|
||||||
__r %= static_cast<_Cr>(__s);
|
return _Cd(_Cd(__d).count() % static_cast<_Cr>(__s));
|
||||||
return __r;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
|
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type
|
typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type
|
||||||
operator%(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
|
operator%(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
|
||||||
{
|
{
|
||||||
typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type __r = __lhs;
|
typedef typename common_type<_Rep1, _Rep2>::type _Cr;
|
||||||
__r %= __rhs;
|
typedef typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _Cd;
|
||||||
return __r;
|
return _Cd(static_cast<_Cr>(_Cd(__lhs).count()) % static_cast<_Cr>(_Cd(__rhs).count()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////
|
||||||
@ -705,13 +728,13 @@ public:
|
|||||||
|
|
||||||
// arithmetic
|
// arithmetic
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY time_point& operator+=(const duration& __d) {__d_ += __d;}
|
_LIBCPP_INLINE_VISIBILITY time_point& operator+=(const duration& __d) {__d_ += __d; return *this;}
|
||||||
_LIBCPP_INLINE_VISIBILITY time_point& operator-=(const duration& __d) {__d_ -= __d;}
|
_LIBCPP_INLINE_VISIBILITY time_point& operator-=(const duration& __d) {__d_ -= __d; return *this;}
|
||||||
|
|
||||||
// special values
|
// special values
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY static time_point min() {return time_point(duration::min());}
|
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR time_point min() {return time_point(duration::min());}
|
||||||
_LIBCPP_INLINE_VISIBILITY static time_point max() {return time_point(duration::max());}
|
_LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR time_point max() {return time_point(duration::max());}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // chrono
|
} // chrono
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -330,13 +330,13 @@ class _LIBCPP_VISIBLE complex<float>
|
|||||||
public:
|
public:
|
||||||
typedef float value_type;
|
typedef float value_type;
|
||||||
|
|
||||||
/*constexpr*/ _LIBCPP_INLINE_VISIBILITY complex(float __re = 0.0f, float __im = 0.0f)
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR complex(float __re = 0.0f, float __im = 0.0f)
|
||||||
: __re_(__re), __im_(__im) {}
|
: __re_(__re), __im_(__im) {}
|
||||||
explicit /*constexpr*/ complex(const complex<double>& __c);
|
explicit _LIBCPP_CONSTEXPR complex(const complex<double>& __c);
|
||||||
explicit /*constexpr*/ complex(const complex<long double>& __c);
|
explicit _LIBCPP_CONSTEXPR complex(const complex<long double>& __c);
|
||||||
|
|
||||||
/*constexpr*/ _LIBCPP_INLINE_VISIBILITY float real() const {return __re_;}
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR float real() const {return __re_;}
|
||||||
/*constexpr*/ _LIBCPP_INLINE_VISIBILITY float imag() const {return __im_;}
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR float imag() const {return __im_;}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY void real(value_type __re) {__re_ = __re;}
|
_LIBCPP_INLINE_VISIBILITY void real(value_type __re) {__re_ = __re;}
|
||||||
_LIBCPP_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;}
|
_LIBCPP_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;}
|
||||||
@ -386,13 +386,13 @@ class _LIBCPP_VISIBLE complex<double>
|
|||||||
public:
|
public:
|
||||||
typedef double value_type;
|
typedef double value_type;
|
||||||
|
|
||||||
/*constexpr*/ _LIBCPP_INLINE_VISIBILITY complex(double __re = 0.0, double __im = 0.0)
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR complex(double __re = 0.0, double __im = 0.0)
|
||||||
: __re_(__re), __im_(__im) {}
|
: __re_(__re), __im_(__im) {}
|
||||||
/*constexpr*/ complex(const complex<float>& __c);
|
_LIBCPP_CONSTEXPR complex(const complex<float>& __c);
|
||||||
explicit /*constexpr*/ complex(const complex<long double>& __c);
|
explicit _LIBCPP_CONSTEXPR complex(const complex<long double>& __c);
|
||||||
|
|
||||||
/*constexpr*/ _LIBCPP_INLINE_VISIBILITY double real() const {return __re_;}
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR double real() const {return __re_;}
|
||||||
/*constexpr*/ _LIBCPP_INLINE_VISIBILITY double imag() const {return __im_;}
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR double imag() const {return __im_;}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY void real(value_type __re) {__re_ = __re;}
|
_LIBCPP_INLINE_VISIBILITY void real(value_type __re) {__re_ = __re;}
|
||||||
_LIBCPP_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;}
|
_LIBCPP_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;}
|
||||||
@ -442,13 +442,13 @@ class _LIBCPP_VISIBLE complex<long double>
|
|||||||
public:
|
public:
|
||||||
typedef long double value_type;
|
typedef long double value_type;
|
||||||
|
|
||||||
/*constexpr*/ _LIBCPP_INLINE_VISIBILITY complex(long double __re = 0.0L, long double __im = 0.0L)
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR complex(long double __re = 0.0L, long double __im = 0.0L)
|
||||||
: __re_(__re), __im_(__im) {}
|
: __re_(__re), __im_(__im) {}
|
||||||
/*constexpr*/ complex(const complex<float>& __c);
|
_LIBCPP_CONSTEXPR complex(const complex<float>& __c);
|
||||||
/*constexpr*/ complex(const complex<double>& __c);
|
_LIBCPP_CONSTEXPR complex(const complex<double>& __c);
|
||||||
|
|
||||||
/*constexpr*/ _LIBCPP_INLINE_VISIBILITY long double real() const {return __re_;}
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR long double real() const {return __re_;}
|
||||||
/*constexpr*/ _LIBCPP_INLINE_VISIBILITY long double imag() const {return __im_;}
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR long double imag() const {return __im_;}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY void real(value_type __re) {__re_ = __re;}
|
_LIBCPP_INLINE_VISIBILITY void real(value_type __re) {__re_ = __re;}
|
||||||
_LIBCPP_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;}
|
_LIBCPP_INLINE_VISIBILITY void imag(value_type __im) {__im_ = __im;}
|
||||||
@ -490,33 +490,33 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//constexpr
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
complex<float>::complex(const complex<double>& __c)
|
complex<float>::complex(const complex<double>& __c)
|
||||||
: __re_(__c.real()), __im_(__c.imag()) {}
|
: __re_(__c.real()), __im_(__c.imag()) {}
|
||||||
|
|
||||||
//constexpr
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
complex<float>::complex(const complex<long double>& __c)
|
complex<float>::complex(const complex<long double>& __c)
|
||||||
: __re_(__c.real()), __im_(__c.imag()) {}
|
: __re_(__c.real()), __im_(__c.imag()) {}
|
||||||
|
|
||||||
//constexpr
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
complex<double>::complex(const complex<float>& __c)
|
complex<double>::complex(const complex<float>& __c)
|
||||||
: __re_(__c.real()), __im_(__c.imag()) {}
|
: __re_(__c.real()), __im_(__c.imag()) {}
|
||||||
|
|
||||||
//constexpr
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
complex<double>::complex(const complex<long double>& __c)
|
complex<double>::complex(const complex<long double>& __c)
|
||||||
: __re_(__c.real()), __im_(__c.imag()) {}
|
: __re_(__c.real()), __im_(__c.imag()) {}
|
||||||
|
|
||||||
//constexpr
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
complex<long double>::complex(const complex<float>& __c)
|
complex<long double>::complex(const complex<float>& __c)
|
||||||
: __re_(__c.real()), __im_(__c.imag()) {}
|
: __re_(__c.real()), __im_(__c.imag()) {}
|
||||||
|
|
||||||
//constexpr
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
complex<long double>::complex(const complex<double>& __c)
|
complex<long double>::complex(const complex<double>& __c)
|
||||||
: __re_(__c.real()), __im_(__c.imag()) {}
|
: __re_(__c.real()), __im_(__c.imag()) {}
|
||||||
|
|
||||||
@ -1351,7 +1351,11 @@ tanh(const complex<_Tp>& __x)
|
|||||||
_Tp __2r(_Tp(2) * __x.real());
|
_Tp __2r(_Tp(2) * __x.real());
|
||||||
_Tp __2i(_Tp(2) * __x.imag());
|
_Tp __2i(_Tp(2) * __x.imag());
|
||||||
_Tp __d(cosh(__2r) + cos(__2i));
|
_Tp __d(cosh(__2r) + cos(__2i));
|
||||||
return complex<_Tp>(sinh(__2r)/__d, sin(__2i)/__d);
|
_Tp __2rsh(sinh(__2r));
|
||||||
|
if (isinf(__2rsh) && isinf(__d))
|
||||||
|
return complex<_Tp>(__2rsh > _Tp(0) ? _Tp(1) : _Tp(-1),
|
||||||
|
__2i > _Tp(0) ? _Tp(0) : _Tp(-0.));
|
||||||
|
return complex<_Tp>(__2rsh/__d, sin(__2i)/__d);
|
||||||
}
|
}
|
||||||
|
|
||||||
// asin
|
// asin
|
||||||
|
@ -28,8 +28,8 @@ public:
|
|||||||
condition_variable(const condition_variable&) = delete;
|
condition_variable(const condition_variable&) = delete;
|
||||||
condition_variable& operator=(const condition_variable&) = delete;
|
condition_variable& operator=(const condition_variable&) = delete;
|
||||||
|
|
||||||
void notify_one();
|
void notify_one() noexcept;
|
||||||
void notify_all();
|
void notify_all() noexcept;
|
||||||
|
|
||||||
void wait(unique_lock<mutex>& lock);
|
void wait(unique_lock<mutex>& lock);
|
||||||
template <class Predicate>
|
template <class Predicate>
|
||||||
@ -72,8 +72,8 @@ public:
|
|||||||
condition_variable_any(const condition_variable_any&) = delete;
|
condition_variable_any(const condition_variable_any&) = delete;
|
||||||
condition_variable_any& operator=(const condition_variable_any&) = delete;
|
condition_variable_any& operator=(const condition_variable_any&) = delete;
|
||||||
|
|
||||||
void notify_one();
|
void notify_one() noexcept;
|
||||||
void notify_all();
|
void notify_all() noexcept;
|
||||||
|
|
||||||
template <class Lock>
|
template <class Lock>
|
||||||
void wait(Lock& lock);
|
void wait(Lock& lock);
|
||||||
@ -124,8 +124,8 @@ class _LIBCPP_VISIBLE condition_variable_any
|
|||||||
public:
|
public:
|
||||||
condition_variable_any();
|
condition_variable_any();
|
||||||
|
|
||||||
void notify_one();
|
void notify_one() _NOEXCEPT;
|
||||||
void notify_all();
|
void notify_all() _NOEXCEPT;
|
||||||
|
|
||||||
template <class _Lock>
|
template <class _Lock>
|
||||||
void wait(_Lock& __lock);
|
void wait(_Lock& __lock);
|
||||||
@ -161,7 +161,7 @@ condition_variable_any::condition_variable_any()
|
|||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
void
|
void
|
||||||
condition_variable_any::notify_one()
|
condition_variable_any::notify_one() _NOEXCEPT
|
||||||
{
|
{
|
||||||
{lock_guard<mutex> _(*__mut_);}
|
{lock_guard<mutex> _(*__mut_);}
|
||||||
__cv_.notify_one();
|
__cv_.notify_one();
|
||||||
@ -169,7 +169,7 @@ condition_variable_any::notify_one()
|
|||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
void
|
void
|
||||||
condition_variable_any::notify_all()
|
condition_variable_any::notify_all() _NOEXCEPT
|
||||||
{
|
{
|
||||||
{lock_guard<mutex> _(*__mut_);}
|
{lock_guard<mutex> _(*__mut_);}
|
||||||
__cv_.notify_all();
|
__cv_.notify_all();
|
||||||
|
@ -62,28 +62,28 @@ struct _LIBCPP_VISIBLE nullptr_t
|
|||||||
|
|
||||||
struct __nat {int __for_bool_;};
|
struct __nat {int __for_bool_;};
|
||||||
|
|
||||||
_LIBCPP_ALWAYS_INLINE nullptr_t() {}
|
_LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t() : _(0) {}
|
||||||
_LIBCPP_ALWAYS_INLINE nullptr_t(int __nat::*) {}
|
_LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t(int __nat::*) : _(0) {}
|
||||||
|
|
||||||
_LIBCPP_ALWAYS_INLINE operator int __nat::*() const {return 0;}
|
_LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR operator int __nat::*() const {return 0;}
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
_LIBCPP_ALWAYS_INLINE
|
_LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR
|
||||||
operator _Tp* () const {return 0;}
|
operator _Tp* () const {return 0;}
|
||||||
|
|
||||||
template <class _Tp, class _Up>
|
template <class _Tp, class _Up>
|
||||||
_LIBCPP_ALWAYS_INLINE
|
_LIBCPP_ALWAYS_INLINE
|
||||||
operator _Tp _Up::* () const {return 0;}
|
operator _Tp _Up::* () const {return 0;}
|
||||||
|
|
||||||
friend _LIBCPP_ALWAYS_INLINE bool operator==(nullptr_t, nullptr_t) {return true;}
|
friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator==(nullptr_t, nullptr_t) {return true;}
|
||||||
friend _LIBCPP_ALWAYS_INLINE bool operator!=(nullptr_t, nullptr_t) {return false;}
|
friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator!=(nullptr_t, nullptr_t) {return false;}
|
||||||
friend _LIBCPP_ALWAYS_INLINE bool operator<(nullptr_t, nullptr_t) {return false;}
|
friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator<(nullptr_t, nullptr_t) {return false;}
|
||||||
friend _LIBCPP_ALWAYS_INLINE bool operator<=(nullptr_t, nullptr_t) {return true;}
|
friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator<=(nullptr_t, nullptr_t) {return true;}
|
||||||
friend _LIBCPP_ALWAYS_INLINE bool operator>(nullptr_t, nullptr_t) {return false;}
|
friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator>(nullptr_t, nullptr_t) {return false;}
|
||||||
friend _LIBCPP_ALWAYS_INLINE bool operator>=(nullptr_t, nullptr_t) {return true;}
|
friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator>=(nullptr_t, nullptr_t) {return true;}
|
||||||
};
|
};
|
||||||
|
|
||||||
inline _LIBCPP_ALWAYS_INLINE nullptr_t __get_nullptr_t() {return nullptr_t(0);}
|
inline _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t __get_nullptr_t() {return nullptr_t(0);}
|
||||||
|
|
||||||
#define nullptr _VSTD::__get_nullptr_t()
|
#define nullptr _VSTD::__get_nullptr_t()
|
||||||
|
|
||||||
|
@ -103,6 +103,18 @@ void perror(const char* s);
|
|||||||
#pragma GCC system_header
|
#pragma GCC system_header
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef getc
|
||||||
|
inline _LIBCPP_INLINE_VISIBILITY int __libcpp_getc(FILE* __stream) {return getc(__stream);}
|
||||||
|
#undef getc
|
||||||
|
inline _LIBCPP_INLINE_VISIBILITY int getc(FILE* __stream) {return __libcpp_getc(__stream);}
|
||||||
|
#endif // getc
|
||||||
|
|
||||||
|
#ifdef putc
|
||||||
|
inline _LIBCPP_INLINE_VISIBILITY int __libcpp_putc(int __c, FILE* __stream) {return putc(__c, __stream);}
|
||||||
|
#undef putc
|
||||||
|
inline _LIBCPP_INLINE_VISIBILITY int putc(int __c, FILE* __stream) {return __libcpp_putc(__c, __stream);}
|
||||||
|
#endif // putc
|
||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
using ::FILE;
|
using ::FILE;
|
||||||
|
@ -74,6 +74,9 @@ int mbtowc(wchar_t* restrict pwc, const char* restrict s, size_t n);
|
|||||||
int wctomb(char* s, wchar_t wchar);
|
int wctomb(char* s, wchar_t wchar);
|
||||||
size_t mbstowcs(wchar_t* restrict pwcs, const char* restrict s, size_t n);
|
size_t mbstowcs(wchar_t* restrict pwcs, const char* restrict s, size_t n);
|
||||||
size_t wcstombs(char* restrict s, const wchar_t* restrict pwcs, size_t n);
|
size_t wcstombs(char* restrict s, const wchar_t* restrict pwcs, size_t n);
|
||||||
|
int at_quick_exit(void (*func)(void)) // C++11
|
||||||
|
void quick_exit(int status); // C++11
|
||||||
|
void *aligned_alloc(size_t alignment, size_t size); // C11
|
||||||
|
|
||||||
} // std
|
} // std
|
||||||
|
|
||||||
@ -135,14 +138,17 @@ using ::wcstombs;
|
|||||||
using ::at_quick_exit;
|
using ::at_quick_exit;
|
||||||
using ::quick_exit;
|
using ::quick_exit;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef _LIBCPP_HAS_C11_FEATURES
|
||||||
|
using ::aligned_alloc;
|
||||||
|
#endif
|
||||||
|
|
||||||
// MSVC already has the correct prototype in <stdlib.h.h> #ifdef __cplusplus
|
// MSVC already has the correct prototype in <stdlib.h.h> #ifdef __cplusplus
|
||||||
#if !defined(_MSC_VER) && !defined(__sun__)
|
#if !defined(_MSC_VER) && !defined(__sun__)
|
||||||
inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) {return labs(__x);}
|
inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT {return labs(__x);}
|
||||||
inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) {return llabs(__x);}
|
inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);}
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY ldiv_t div( long __x, long __y) {return ldiv(__x, __y);}
|
inline _LIBCPP_INLINE_VISIBILITY ldiv_t div( long __x, long __y) _NOEXCEPT {return ldiv(__x, __y);}
|
||||||
inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x, long long __y) {return lldiv(__x, __y);}
|
inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x, long long __y) _NOEXCEPT {return lldiv(__x, __y);}
|
||||||
#endif // _MSC_VER
|
#endif // _MSC_VER
|
||||||
|
|
||||||
_LIBCPP_END_NAMESPACE_STD
|
_LIBCPP_END_NAMESPACE_STD
|
||||||
|
@ -1966,6 +1966,7 @@ deque<_Tp, _Allocator>::emplace(const_iterator __p, _Args&&... __args)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
value_type __tmp(_VSTD::forward<_Args>(__args)...);
|
||||||
iterator __b = __base::begin();
|
iterator __b = __base::begin();
|
||||||
iterator __bm1 = _VSTD::prev(__b);
|
iterator __bm1 = _VSTD::prev(__b);
|
||||||
__alloc_traits::construct(__a, _VSTD::addressof(*__bm1), _VSTD::move(*__b));
|
__alloc_traits::construct(__a, _VSTD::addressof(*__bm1), _VSTD::move(*__b));
|
||||||
@ -1973,7 +1974,7 @@ deque<_Tp, _Allocator>::emplace(const_iterator __p, _Args&&... __args)
|
|||||||
++__base::size();
|
++__base::size();
|
||||||
if (__pos > 1)
|
if (__pos > 1)
|
||||||
__b = _VSTD::move(_VSTD::next(__b), __b + __pos, __b);
|
__b = _VSTD::move(_VSTD::next(__b), __b + __pos, __b);
|
||||||
*__b = value_type(_VSTD::forward<_Args>(__args)...);
|
*__b = _VSTD::move(__tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1989,13 +1990,14 @@ deque<_Tp, _Allocator>::emplace(const_iterator __p, _Args&&... __args)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
value_type __tmp(_VSTD::forward<_Args>(__args)...);
|
||||||
iterator __e = __base::end();
|
iterator __e = __base::end();
|
||||||
iterator __em1 = _VSTD::prev(__e);
|
iterator __em1 = _VSTD::prev(__e);
|
||||||
__alloc_traits::construct(__a, _VSTD::addressof(*__e), _VSTD::move(*__em1));
|
__alloc_traits::construct(__a, _VSTD::addressof(*__e), _VSTD::move(*__em1));
|
||||||
++__base::size();
|
++__base::size();
|
||||||
if (__de > 1)
|
if (__de > 1)
|
||||||
__e = _VSTD::move_backward(__e - __de, __em1, __e);
|
__e = _VSTD::move_backward(__e - __de, __em1, __e);
|
||||||
*--__e = value_type(_VSTD::forward<_Args>(__args)...);
|
*--__e = _VSTD::move(__tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return __base::begin() + __pos;
|
return __base::begin() + __pos;
|
||||||
|
@ -107,19 +107,19 @@ public:
|
|||||||
typedef void (*unexpected_handler)();
|
typedef void (*unexpected_handler)();
|
||||||
_LIBCPP_VISIBLE unexpected_handler set_unexpected(unexpected_handler) _NOEXCEPT;
|
_LIBCPP_VISIBLE unexpected_handler set_unexpected(unexpected_handler) _NOEXCEPT;
|
||||||
_LIBCPP_VISIBLE unexpected_handler get_unexpected() _NOEXCEPT;
|
_LIBCPP_VISIBLE unexpected_handler get_unexpected() _NOEXCEPT;
|
||||||
_ATTRIBUTE(noreturn) _LIBCPP_VISIBLE void unexpected();
|
_LIBCPP_NORETURN _LIBCPP_VISIBLE void unexpected();
|
||||||
|
|
||||||
typedef void (*terminate_handler)();
|
typedef void (*terminate_handler)();
|
||||||
_LIBCPP_VISIBLE terminate_handler set_terminate(terminate_handler) _NOEXCEPT;
|
_LIBCPP_VISIBLE terminate_handler set_terminate(terminate_handler) _NOEXCEPT;
|
||||||
_LIBCPP_VISIBLE terminate_handler get_terminate() _NOEXCEPT;
|
_LIBCPP_VISIBLE terminate_handler get_terminate() _NOEXCEPT;
|
||||||
_ATTRIBUTE(noreturn) _LIBCPP_VISIBLE void terminate() _NOEXCEPT;
|
_LIBCPP_NORETURN _LIBCPP_VISIBLE void terminate() _NOEXCEPT;
|
||||||
|
|
||||||
_LIBCPP_VISIBLE bool uncaught_exception() _NOEXCEPT;
|
_LIBCPP_VISIBLE bool uncaught_exception() _NOEXCEPT;
|
||||||
|
|
||||||
class exception_ptr;
|
class _LIBCPP_VISIBLE exception_ptr;
|
||||||
|
|
||||||
exception_ptr current_exception() _NOEXCEPT;
|
exception_ptr current_exception() _NOEXCEPT;
|
||||||
_ATTRIBUTE(noreturn) void rethrow_exception(exception_ptr);
|
_LIBCPP_NORETURN void rethrow_exception(exception_ptr);
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE exception_ptr
|
class _LIBCPP_VISIBLE exception_ptr
|
||||||
{
|
{
|
||||||
@ -143,7 +143,7 @@ public:
|
|||||||
{return !(__x == __y);}
|
{return !(__x == __y);}
|
||||||
|
|
||||||
friend exception_ptr current_exception() _NOEXCEPT;
|
friend exception_ptr current_exception() _NOEXCEPT;
|
||||||
_ATTRIBUTE(noreturn) friend void rethrow_exception(exception_ptr);
|
_LIBCPP_NORETURN friend void rethrow_exception(exception_ptr);
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class _Ep>
|
template<class _Ep>
|
||||||
@ -174,7 +174,7 @@ public:
|
|||||||
virtual ~nested_exception() _NOEXCEPT;
|
virtual ~nested_exception() _NOEXCEPT;
|
||||||
|
|
||||||
// access functions
|
// access functions
|
||||||
_ATTRIBUTE(noreturn) void rethrow_nested() const;
|
_LIBCPP_NORETURN void rethrow_nested() const;
|
||||||
_LIBCPP_INLINE_VISIBILITY exception_ptr nested_ptr() const _NOEXCEPT {return __ptr_;}
|
_LIBCPP_INLINE_VISIBILITY exception_ptr nested_ptr() const _NOEXCEPT {return __ptr_;}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ struct __nested
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
_ATTRIBUTE(noreturn)
|
_LIBCPP_NORETURN
|
||||||
void
|
void
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
throw_with_nested(_Tp&& __t, typename enable_if<
|
throw_with_nested(_Tp&& __t, typename enable_if<
|
||||||
@ -206,7 +206,7 @@ throw_with_nested (_Tp& __t, typename enable_if<
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
_ATTRIBUTE(noreturn)
|
_LIBCPP_NORETURN
|
||||||
void
|
void
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
throw_with_nested(_Tp&& __t, typename enable_if<
|
throw_with_nested(_Tp&& __t, typename enable_if<
|
||||||
|
@ -212,8 +212,8 @@ struct __forward_list_node
|
|||||||
value_type __value_;
|
value_type __value_;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class _Tp, class _Alloc> class forward_list;
|
template<class _Tp, class _Alloc> class _LIBCPP_VISIBLE forward_list;
|
||||||
template<class _NodeConstPtr> class __forward_list_const_iterator;
|
template<class _NodeConstPtr> class _LIBCPP_VISIBLE __forward_list_const_iterator;
|
||||||
|
|
||||||
template <class _NodePtr>
|
template <class _NodePtr>
|
||||||
class _LIBCPP_VISIBLE __forward_list_iterator
|
class _LIBCPP_VISIBLE __forward_list_iterator
|
||||||
@ -225,8 +225,8 @@ class _LIBCPP_VISIBLE __forward_list_iterator
|
|||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
explicit __forward_list_iterator(__node_pointer __p) _NOEXCEPT : __ptr_(__p) {}
|
explicit __forward_list_iterator(__node_pointer __p) _NOEXCEPT : __ptr_(__p) {}
|
||||||
|
|
||||||
template<class, class> friend class forward_list;
|
template<class, class> friend class _LIBCPP_VISIBLE forward_list;
|
||||||
template<class> friend class __forward_list_const_iterator;
|
template<class> friend class _LIBCPP_VISIBLE __forward_list_const_iterator;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef forward_iterator_tag iterator_category;
|
typedef forward_iterator_tag iterator_category;
|
||||||
|
@ -234,6 +234,7 @@ private:
|
|||||||
FILE* __file_;
|
FILE* __file_;
|
||||||
const codecvt<char_type, char, state_type>* __cv_;
|
const codecvt<char_type, char, state_type>* __cv_;
|
||||||
state_type __st_;
|
state_type __st_;
|
||||||
|
state_type __st_last_;
|
||||||
ios_base::openmode __om_;
|
ios_base::openmode __om_;
|
||||||
ios_base::openmode __cm_;
|
ios_base::openmode __cm_;
|
||||||
bool __owns_eb_;
|
bool __owns_eb_;
|
||||||
@ -253,14 +254,20 @@ basic_filebuf<_CharT, _Traits>::basic_filebuf()
|
|||||||
__intbuf_(0),
|
__intbuf_(0),
|
||||||
__ibs_(0),
|
__ibs_(0),
|
||||||
__file_(0),
|
__file_(0),
|
||||||
__cv_(&use_facet<codecvt<char_type, char, state_type> >(this->getloc())),
|
__cv_(nullptr),
|
||||||
__st_(),
|
__st_(),
|
||||||
|
__st_last_(),
|
||||||
__om_(0),
|
__om_(0),
|
||||||
__cm_(0),
|
__cm_(0),
|
||||||
__owns_eb_(false),
|
__owns_eb_(false),
|
||||||
__owns_ib_(false),
|
__owns_ib_(false),
|
||||||
__always_noconv_(__cv_->always_noconv())
|
__always_noconv_(false)
|
||||||
{
|
{
|
||||||
|
if (has_facet<codecvt<char_type, char, state_type> >(this->getloc()))
|
||||||
|
{
|
||||||
|
__cv_ = &use_facet<codecvt<char_type, char, state_type> >(this->getloc());
|
||||||
|
__always_noconv_ = __cv_->always_noconv();
|
||||||
|
}
|
||||||
setbuf(0, 4096);
|
setbuf(0, 4096);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -288,6 +295,7 @@ basic_filebuf<_CharT, _Traits>::basic_filebuf(basic_filebuf&& __rhs)
|
|||||||
__file_ = __rhs.__file_;
|
__file_ = __rhs.__file_;
|
||||||
__cv_ = __rhs.__cv_;
|
__cv_ = __rhs.__cv_;
|
||||||
__st_ = __rhs.__st_;
|
__st_ = __rhs.__st_;
|
||||||
|
__st_last_ = __rhs.__st_last_;
|
||||||
__om_ = __rhs.__om_;
|
__om_ = __rhs.__om_;
|
||||||
__cm_ = __rhs.__cm_;
|
__cm_ = __rhs.__cm_;
|
||||||
__owns_eb_ = __rhs.__owns_eb_;
|
__owns_eb_ = __rhs.__owns_eb_;
|
||||||
@ -320,6 +328,7 @@ basic_filebuf<_CharT, _Traits>::basic_filebuf(basic_filebuf&& __rhs)
|
|||||||
__rhs.__ibs_ = 0;
|
__rhs.__ibs_ = 0;
|
||||||
__rhs.__file_ = 0;
|
__rhs.__file_ = 0;
|
||||||
__rhs.__st_ = state_type();
|
__rhs.__st_ = state_type();
|
||||||
|
__rhs.__st_last_ = state_type();
|
||||||
__rhs.__om_ = 0;
|
__rhs.__om_ = 0;
|
||||||
__rhs.__cm_ = 0;
|
__rhs.__cm_ = 0;
|
||||||
__rhs.__owns_eb_ = false;
|
__rhs.__owns_eb_ = false;
|
||||||
@ -335,6 +344,7 @@ basic_filebuf<_CharT, _Traits>::operator=(basic_filebuf&& __rhs)
|
|||||||
{
|
{
|
||||||
close();
|
close();
|
||||||
swap(__rhs);
|
swap(__rhs);
|
||||||
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
@ -397,6 +407,7 @@ basic_filebuf<_CharT, _Traits>::swap(basic_filebuf& __rhs)
|
|||||||
_VSTD::swap(__file_, __rhs.__file_);
|
_VSTD::swap(__file_, __rhs.__file_);
|
||||||
_VSTD::swap(__cv_, __rhs.__cv_);
|
_VSTD::swap(__cv_, __rhs.__cv_);
|
||||||
_VSTD::swap(__st_, __rhs.__st_);
|
_VSTD::swap(__st_, __rhs.__st_);
|
||||||
|
_VSTD::swap(__st_last_, __rhs.__st_last_);
|
||||||
_VSTD::swap(__om_, __rhs.__om_);
|
_VSTD::swap(__om_, __rhs.__om_);
|
||||||
_VSTD::swap(__cm_, __rhs.__cm_);
|
_VSTD::swap(__cm_, __rhs.__cm_);
|
||||||
_VSTD::swap(__owns_eb_, __rhs.__owns_eb_);
|
_VSTD::swap(__owns_eb_, __rhs.__owns_eb_);
|
||||||
@ -591,18 +602,22 @@ basic_filebuf<_CharT, _Traits>::underflow()
|
|||||||
memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
|
memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
|
||||||
__extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_);
|
__extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_);
|
||||||
__extbufend_ = __extbuf_ + (__extbuf_ == __extbuf_min_ ? sizeof(__extbuf_min_) : __ebs_);
|
__extbufend_ = __extbuf_ + (__extbuf_ == __extbuf_min_ ? sizeof(__extbuf_min_) : __ebs_);
|
||||||
size_t __nmemb = _VSTD::min(static_cast<size_t>(this->egptr() - this->eback() - __unget_sz),
|
size_t __nmemb = _VSTD::min(static_cast<size_t>(__ibs_ - __unget_sz),
|
||||||
static_cast<size_t>(__extbufend_ - __extbufnext_));
|
static_cast<size_t>(__extbufend_ - __extbufnext_));
|
||||||
codecvt_base::result __r;
|
codecvt_base::result __r;
|
||||||
state_type __svs = __st_;
|
__st_last_ = __st_;
|
||||||
size_t __nr = fread((void*)__extbufnext_, 1, __nmemb, __file_);
|
size_t __nr = fread((void*)__extbufnext_, 1, __nmemb, __file_);
|
||||||
if (__nr != 0)
|
if (__nr != 0)
|
||||||
{
|
{
|
||||||
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
|
if (!__cv_)
|
||||||
|
throw bad_cast();
|
||||||
|
#endif
|
||||||
__extbufend_ = __extbufnext_ + __nr;
|
__extbufend_ = __extbufnext_ + __nr;
|
||||||
char_type* __inext;
|
char_type* __inext;
|
||||||
__r = __cv_->in(__st_, __extbuf_, __extbufend_, __extbufnext_,
|
__r = __cv_->in(__st_, __extbuf_, __extbufend_, __extbufnext_,
|
||||||
this->eback() + __unget_sz,
|
this->eback() + __unget_sz,
|
||||||
this->egptr(), __inext);
|
this->eback() + __ibs_, __inext);
|
||||||
if (__r == codecvt_base::noconv)
|
if (__r == codecvt_base::noconv)
|
||||||
{
|
{
|
||||||
this->setg((char_type*)__extbuf_, (char_type*)__extbuf_, (char_type*)__extbufend_);
|
this->setg((char_type*)__extbuf_, (char_type*)__extbuf_, (char_type*)__extbufend_);
|
||||||
@ -676,6 +691,10 @@ basic_filebuf<_CharT, _Traits>::overflow(int_type __c)
|
|||||||
codecvt_base::result __r;
|
codecvt_base::result __r;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
|
if (!__cv_)
|
||||||
|
throw bad_cast();
|
||||||
|
#endif
|
||||||
const char_type* __e;
|
const char_type* __e;
|
||||||
__r = __cv_->out(__st_, this->pbase(), this->pptr(), __e,
|
__r = __cv_->out(__st_, this->pbase(), this->pptr(), __e,
|
||||||
__extbuf_, __extbuf_ + __ebs_, __extbe);
|
__extbuf_, __extbuf_ + __ebs_, __extbe);
|
||||||
@ -765,6 +784,10 @@ typename basic_filebuf<_CharT, _Traits>::pos_type
|
|||||||
basic_filebuf<_CharT, _Traits>::seekoff(off_type __off, ios_base::seekdir __way,
|
basic_filebuf<_CharT, _Traits>::seekoff(off_type __off, ios_base::seekdir __way,
|
||||||
ios_base::openmode)
|
ios_base::openmode)
|
||||||
{
|
{
|
||||||
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
|
if (!__cv_)
|
||||||
|
throw bad_cast();
|
||||||
|
#endif
|
||||||
int __width = __cv_->encoding();
|
int __width = __cv_->encoding();
|
||||||
if (__file_ == 0 || (__width <= 0 && __off != 0) || sync())
|
if (__file_ == 0 || (__width <= 0 && __off != 0) || sync())
|
||||||
return pos_type(off_type(-1));
|
return pos_type(off_type(-1));
|
||||||
@ -799,6 +822,7 @@ basic_filebuf<_CharT, _Traits>::seekpos(pos_type __sp, ios_base::openmode)
|
|||||||
return pos_type(off_type(-1));
|
return pos_type(off_type(-1));
|
||||||
if (fseeko(__file_, __sp, SEEK_SET))
|
if (fseeko(__file_, __sp, SEEK_SET))
|
||||||
return pos_type(off_type(-1));
|
return pos_type(off_type(-1));
|
||||||
|
__st_ = __sp.state();
|
||||||
return __sp;
|
return __sp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -808,6 +832,10 @@ basic_filebuf<_CharT, _Traits>::sync()
|
|||||||
{
|
{
|
||||||
if (__file_ == 0)
|
if (__file_ == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
|
if (!__cv_)
|
||||||
|
throw bad_cast();
|
||||||
|
#endif
|
||||||
if (__cm_ & ios_base::out)
|
if (__cm_ & ios_base::out)
|
||||||
{
|
{
|
||||||
if (this->pptr() != this->pbase())
|
if (this->pptr() != this->pbase())
|
||||||
@ -830,6 +858,8 @@ basic_filebuf<_CharT, _Traits>::sync()
|
|||||||
else if (__cm_ & ios_base::in)
|
else if (__cm_ & ios_base::in)
|
||||||
{
|
{
|
||||||
off_type __c;
|
off_type __c;
|
||||||
|
state_type __state = __st_last_;
|
||||||
|
bool __update_st = false;
|
||||||
if (__always_noconv_)
|
if (__always_noconv_)
|
||||||
__c = this->egptr() - this->gptr();
|
__c = this->egptr() - this->gptr();
|
||||||
else
|
else
|
||||||
@ -842,32 +872,19 @@ basic_filebuf<_CharT, _Traits>::sync()
|
|||||||
{
|
{
|
||||||
if (this->gptr() != this->egptr())
|
if (this->gptr() != this->egptr())
|
||||||
{
|
{
|
||||||
reverse(this->gptr(), this->egptr());
|
const int __off = __cv_->length(__state, __extbuf_,
|
||||||
codecvt_base::result __r;
|
__extbufnext_,
|
||||||
const char_type* __e = this->gptr();
|
this->gptr() - this->eback());
|
||||||
char* __extbe;
|
__c += __extbufnext_ - __extbuf_ - __off;
|
||||||
do
|
__update_st = true;
|
||||||
{
|
|
||||||
__r = __cv_->out(__st_, __e, this->egptr(), __e,
|
|
||||||
__extbuf_, __extbuf_ + __ebs_, __extbe);
|
|
||||||
switch (__r)
|
|
||||||
{
|
|
||||||
case codecvt_base::noconv:
|
|
||||||
__c += this->egptr() - this->gptr();
|
|
||||||
break;
|
|
||||||
case codecvt_base::ok:
|
|
||||||
case codecvt_base::partial:
|
|
||||||
__c += __extbe - __extbuf_;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
} while (__r == codecvt_base::partial);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fseeko(__file_, -__c, SEEK_CUR))
|
if (fseeko(__file_, -__c, SEEK_CUR))
|
||||||
return -1;
|
return -1;
|
||||||
|
if (__update_st)
|
||||||
|
__st_ = __state;
|
||||||
|
__extbufnext_ = __extbufend_ = __extbuf_;
|
||||||
this->setg(0, 0, 0);
|
this->setg(0, 0, 0);
|
||||||
__cm_ = 0;
|
__cm_ = 0;
|
||||||
}
|
}
|
||||||
|
@ -1113,7 +1113,8 @@ class _LIBCPP_VISIBLE function<_Rp(_ArgTypes...)>
|
|||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static bool __not_null(const function<_Rp(_Ap...)>& __p) {return __p;}
|
static bool __not_null(const function<_Rp(_Ap...)>& __p) {return __p;}
|
||||||
|
|
||||||
template <class _Fp, bool = __invokable<_Fp&, _ArgTypes...>::value>
|
template <class _Fp, bool = !is_same<_Fp, function>::value &&
|
||||||
|
__invokable<_Fp&, _ArgTypes...>::value>
|
||||||
struct __callable;
|
struct __callable;
|
||||||
template <class _Fp>
|
template <class _Fp>
|
||||||
struct __callable<_Fp, true>
|
struct __callable<_Fp, true>
|
||||||
@ -1350,6 +1351,7 @@ function<_Rp(_ArgTypes...)>::operator=(function&& __f) _NOEXCEPT
|
|||||||
__f_ = __f.__f_;
|
__f_ = __f.__f_;
|
||||||
__f.__f_ = 0;
|
__f.__f_ = 0;
|
||||||
}
|
}
|
||||||
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class _Rp, class ..._ArgTypes>
|
template<class _Rp, class ..._ArgTypes>
|
||||||
@ -1361,6 +1363,7 @@ function<_Rp(_ArgTypes...)>::operator=(nullptr_t) _NOEXCEPT
|
|||||||
else if (__f_)
|
else if (__f_)
|
||||||
__f_->destroy_deallocate();
|
__f_->destroy_deallocate();
|
||||||
__f_ = 0;
|
__f_ = 0;
|
||||||
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class _Rp, class ..._ArgTypes>
|
template<class _Rp, class ..._ArgTypes>
|
||||||
@ -1707,7 +1710,11 @@ public:
|
|||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||||
|
|
||||||
template <class _Gp, class ..._BA>
|
template <class _Gp, class ..._BA,
|
||||||
|
class = typename enable_if
|
||||||
|
<
|
||||||
|
is_constructible<_Fd, _Gp>::value
|
||||||
|
>::type>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
explicit __bind(_Gp&& __f, _BA&& ...__bound_args)
|
explicit __bind(_Gp&& __f, _BA&& ...__bound_args)
|
||||||
: __f_(_VSTD::forward<_Gp>(__f)),
|
: __f_(_VSTD::forward<_Gp>(__f)),
|
||||||
|
@ -40,10 +40,10 @@ enum class future_status
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <> struct is_error_code_enum<future_errc> : public true_type { };
|
template <> struct is_error_code_enum<future_errc> : public true_type { };
|
||||||
error_code make_error_code(future_errc e);
|
error_code make_error_code(future_errc e) noexcept;
|
||||||
error_condition make_error_condition(future_errc e);
|
error_condition make_error_condition(future_errc e) noexcept;
|
||||||
|
|
||||||
const error_category& future_category();
|
const error_category& future_category() noexcept;
|
||||||
|
|
||||||
class future_error
|
class future_error
|
||||||
: public logic_error
|
: public logic_error
|
||||||
@ -51,8 +51,8 @@ class future_error
|
|||||||
public:
|
public:
|
||||||
future_error(error_code ec); // exposition only
|
future_error(error_code ec); // exposition only
|
||||||
|
|
||||||
const error_code& code() const throw();
|
const error_code& code() const noexcept;
|
||||||
const char* what() const throw();
|
const char* what() const noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class R>
|
template <class R>
|
||||||
@ -62,14 +62,14 @@ public:
|
|||||||
promise();
|
promise();
|
||||||
template <class Allocator>
|
template <class Allocator>
|
||||||
promise(allocator_arg_t, const Allocator& a);
|
promise(allocator_arg_t, const Allocator& a);
|
||||||
promise(promise&& rhs);
|
promise(promise&& rhs) noexcept;
|
||||||
promise(const promise& rhs) = delete;
|
promise(const promise& rhs) = delete;
|
||||||
~promise();
|
~promise();
|
||||||
|
|
||||||
// assignment
|
// assignment
|
||||||
promise& operator=(promise&& rhs);
|
promise& operator=(promise&& rhs) noexcept;
|
||||||
promise& operator=(const promise& rhs) = delete;
|
promise& operator=(const promise& rhs) = delete;
|
||||||
void swap(promise& other);
|
void swap(promise& other) noexcept;
|
||||||
|
|
||||||
// retrieving the result
|
// retrieving the result
|
||||||
future<R> get_future();
|
future<R> get_future();
|
||||||
@ -92,14 +92,14 @@ public:
|
|||||||
promise();
|
promise();
|
||||||
template <class Allocator>
|
template <class Allocator>
|
||||||
promise(allocator_arg_t, const Allocator& a);
|
promise(allocator_arg_t, const Allocator& a);
|
||||||
promise(promise&& rhs);
|
promise(promise&& rhs) noexcept;
|
||||||
promise(const promise& rhs) = delete;
|
promise(const promise& rhs) = delete;
|
||||||
~promise();
|
~promise();
|
||||||
|
|
||||||
// assignment
|
// assignment
|
||||||
promise& operator=(promise&& rhs);
|
promise& operator=(promise&& rhs) noexcept;
|
||||||
promise& operator=(const promise& rhs) = delete;
|
promise& operator=(const promise& rhs) = delete;
|
||||||
void swap(promise& other);
|
void swap(promise& other) noexcept;
|
||||||
|
|
||||||
// retrieving the result
|
// retrieving the result
|
||||||
future<R&> get_future();
|
future<R&> get_future();
|
||||||
@ -120,14 +120,14 @@ public:
|
|||||||
promise();
|
promise();
|
||||||
template <class Allocator>
|
template <class Allocator>
|
||||||
promise(allocator_arg_t, const Allocator& a);
|
promise(allocator_arg_t, const Allocator& a);
|
||||||
promise(promise&& rhs);
|
promise(promise&& rhs) noexcept;
|
||||||
promise(const promise& rhs) = delete;
|
promise(const promise& rhs) = delete;
|
||||||
~promise();
|
~promise();
|
||||||
|
|
||||||
// assignment
|
// assignment
|
||||||
promise& operator=(promise&& rhs);
|
promise& operator=(promise&& rhs) noexcept;
|
||||||
promise& operator=(const promise& rhs) = delete;
|
promise& operator=(const promise& rhs) = delete;
|
||||||
void swap(promise& other);
|
void swap(promise& other) noexcept;
|
||||||
|
|
||||||
// retrieving the result
|
// retrieving the result
|
||||||
future<void> get_future();
|
future<void> get_future();
|
||||||
@ -141,7 +141,7 @@ public:
|
|||||||
void set_exception_at_thread_exit(exception_ptr p);
|
void set_exception_at_thread_exit(exception_ptr p);
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class R> void swap(promise<R>& x, promise<R>& y);
|
template <class R> void swap(promise<R>& x, promise<R>& y) noexcept;
|
||||||
|
|
||||||
template <class R, class Alloc>
|
template <class R, class Alloc>
|
||||||
struct uses_allocator<promise<R>, Alloc> : public true_type {};
|
struct uses_allocator<promise<R>, Alloc> : public true_type {};
|
||||||
@ -150,19 +150,19 @@ template <class R>
|
|||||||
class future
|
class future
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
future();
|
future() noexcept;
|
||||||
future(future&&);
|
future(future&&) noexcept;
|
||||||
future(const future& rhs) = delete;
|
future(const future& rhs) = delete;
|
||||||
~future();
|
~future();
|
||||||
future& operator=(const future& rhs) = delete;
|
future& operator=(const future& rhs) = delete;
|
||||||
future& operator=(future&&);
|
future& operator=(future&&) noexcept;
|
||||||
shared_future<R> share() &&;
|
shared_future<R> share();
|
||||||
|
|
||||||
// retrieving the value
|
// retrieving the value
|
||||||
R get();
|
R get();
|
||||||
|
|
||||||
// functions to check state
|
// functions to check state
|
||||||
bool valid() const;
|
bool valid() const noexcept;
|
||||||
|
|
||||||
void wait() const;
|
void wait() const;
|
||||||
template <class Rep, class Period>
|
template <class Rep, class Period>
|
||||||
@ -177,19 +177,19 @@ template <class R>
|
|||||||
class future<R&>
|
class future<R&>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
future();
|
future() noexcept;
|
||||||
future(future&&);
|
future(future&&) noexcept;
|
||||||
future(const future& rhs) = delete;
|
future(const future& rhs) = delete;
|
||||||
~future();
|
~future();
|
||||||
future& operator=(const future& rhs) = delete;
|
future& operator=(const future& rhs) = delete;
|
||||||
future& operator=(future&&);
|
future& operator=(future&&) noexcept;
|
||||||
shared_future<R&> share() &&;
|
shared_future<R&> share();
|
||||||
|
|
||||||
// retrieving the value
|
// retrieving the value
|
||||||
R& get();
|
R& get();
|
||||||
|
|
||||||
// functions to check state
|
// functions to check state
|
||||||
bool valid() const;
|
bool valid() const noexcept;
|
||||||
|
|
||||||
void wait() const;
|
void wait() const;
|
||||||
template <class Rep, class Period>
|
template <class Rep, class Period>
|
||||||
@ -204,19 +204,19 @@ template <>
|
|||||||
class future<void>
|
class future<void>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
future();
|
future() noexcept;
|
||||||
future(future&&);
|
future(future&&) noexcept;
|
||||||
future(const future& rhs) = delete;
|
future(const future& rhs) = delete;
|
||||||
~future();
|
~future();
|
||||||
future& operator=(const future& rhs) = delete;
|
future& operator=(const future& rhs) = delete;
|
||||||
future& operator=(future&&);
|
future& operator=(future&&) noexcept;
|
||||||
shared_future<void> share() &&;
|
shared_future<void> share();
|
||||||
|
|
||||||
// retrieving the value
|
// retrieving the value
|
||||||
void get();
|
void get();
|
||||||
|
|
||||||
// functions to check state
|
// functions to check state
|
||||||
bool valid() const;
|
bool valid() const noexcept;
|
||||||
|
|
||||||
void wait() const;
|
void wait() const;
|
||||||
template <class Rep, class Period>
|
template <class Rep, class Period>
|
||||||
@ -231,19 +231,19 @@ template <class R>
|
|||||||
class shared_future
|
class shared_future
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
shared_future();
|
shared_future() noexcept;
|
||||||
shared_future(const shared_future& rhs);
|
shared_future(const shared_future& rhs);
|
||||||
shared_future(future<R>&&);
|
shared_future(future<R>&&) noexcept;
|
||||||
shared_future(shared_future&& rhs);
|
shared_future(shared_future&& rhs) noexcept;
|
||||||
~shared_future();
|
~shared_future();
|
||||||
shared_future& operator=(const shared_future& rhs);
|
shared_future& operator=(const shared_future& rhs);
|
||||||
shared_future& operator=(shared_future&& rhs);
|
shared_future& operator=(shared_future&& rhs) noexcept;
|
||||||
|
|
||||||
// retrieving the value
|
// retrieving the value
|
||||||
const R& get() const;
|
const R& get() const;
|
||||||
|
|
||||||
// functions to check state
|
// functions to check state
|
||||||
bool valid() const;
|
bool valid() const noexcept;
|
||||||
|
|
||||||
void wait() const;
|
void wait() const;
|
||||||
template <class Rep, class Period>
|
template <class Rep, class Period>
|
||||||
@ -258,19 +258,19 @@ template <class R>
|
|||||||
class shared_future<R&>
|
class shared_future<R&>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
shared_future();
|
shared_future() noexcept;
|
||||||
shared_future(const shared_future& rhs);
|
shared_future(const shared_future& rhs);
|
||||||
shared_future(future<R&>&&);
|
shared_future(future<R&>&&) noexcept;
|
||||||
shared_future(shared_future&& rhs);
|
shared_future(shared_future&& rhs) noexcept;
|
||||||
~shared_future();
|
~shared_future();
|
||||||
shared_future& operator=(const shared_future& rhs);
|
shared_future& operator=(const shared_future& rhs);
|
||||||
shared_future& operator=(shared_future&& rhs);
|
shared_future& operator=(shared_future&& rhs) noexcept;
|
||||||
|
|
||||||
// retrieving the value
|
// retrieving the value
|
||||||
R& get() const;
|
R& get() const;
|
||||||
|
|
||||||
// functions to check state
|
// functions to check state
|
||||||
bool valid() const;
|
bool valid() const noexcept;
|
||||||
|
|
||||||
void wait() const;
|
void wait() const;
|
||||||
template <class Rep, class Period>
|
template <class Rep, class Period>
|
||||||
@ -285,19 +285,19 @@ template <>
|
|||||||
class shared_future<void>
|
class shared_future<void>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
shared_future();
|
shared_future() noexcept;
|
||||||
shared_future(const shared_future& rhs);
|
shared_future(const shared_future& rhs);
|
||||||
shared_future(future<void>&&);
|
shared_future(future<void>&&) noexcept;
|
||||||
shared_future(shared_future&& rhs);
|
shared_future(shared_future&& rhs) noexcept;
|
||||||
~shared_future();
|
~shared_future();
|
||||||
shared_future& operator=(const shared_future& rhs);
|
shared_future& operator=(const shared_future& rhs);
|
||||||
shared_future& operator=(shared_future&& rhs);
|
shared_future& operator=(shared_future&& rhs) noexcept;
|
||||||
|
|
||||||
// retrieving the value
|
// retrieving the value
|
||||||
void get() const;
|
void get() const;
|
||||||
|
|
||||||
// functions to check state
|
// functions to check state
|
||||||
bool valid() const;
|
bool valid() const noexcept;
|
||||||
|
|
||||||
void wait() const;
|
void wait() const;
|
||||||
template <class Rep, class Period>
|
template <class Rep, class Period>
|
||||||
@ -325,7 +325,7 @@ public:
|
|||||||
typedef R result_type;
|
typedef R result_type;
|
||||||
|
|
||||||
// construction and destruction
|
// construction and destruction
|
||||||
packaged_task();
|
packaged_task() noexcept;
|
||||||
template <class F>
|
template <class F>
|
||||||
explicit packaged_task(F&& f);
|
explicit packaged_task(F&& f);
|
||||||
template <class F, class Allocator>
|
template <class F, class Allocator>
|
||||||
@ -333,15 +333,15 @@ public:
|
|||||||
~packaged_task();
|
~packaged_task();
|
||||||
|
|
||||||
// no copy
|
// no copy
|
||||||
packaged_task(packaged_task&) = delete;
|
packaged_task(const packaged_task&) = delete;
|
||||||
packaged_task& operator=(packaged_task&) = delete;
|
packaged_task& operator=(const packaged_task&) = delete;
|
||||||
|
|
||||||
// move support
|
// move support
|
||||||
packaged_task(packaged_task&& other);
|
packaged_task(packaged_task&& other) noexcept;
|
||||||
packaged_task& operator=(packaged_task&& other);
|
packaged_task& operator=(packaged_task&& other) noexcept;
|
||||||
void swap(packaged_task& other);
|
void swap(packaged_task& other) noexcept;
|
||||||
|
|
||||||
bool valid() const;
|
bool valid() const noexcept;
|
||||||
|
|
||||||
// result retrieval
|
// result retrieval
|
||||||
future<R> get_future();
|
future<R> get_future();
|
||||||
@ -354,7 +354,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class R>
|
template <class R>
|
||||||
void swap(packaged_task<R(ArgTypes...)&, packaged_task<R(ArgTypes...)>&);
|
void swap(packaged_task<R(ArgTypes...)&, packaged_task<R(ArgTypes...)>&) noexcept;
|
||||||
|
|
||||||
template <class R, class Alloc> struct uses_allocator<packaged_task<R>, Alloc>;
|
template <class R, class Alloc> struct uses_allocator<packaged_task<R>, Alloc>;
|
||||||
|
|
||||||
@ -413,18 +413,18 @@ _LIBCPP_DECLARE_STRONG_ENUM(future_status)
|
|||||||
_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(future_status)
|
_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(future_status)
|
||||||
|
|
||||||
_LIBCPP_VISIBLE
|
_LIBCPP_VISIBLE
|
||||||
const error_category& future_category();
|
const error_category& future_category() _NOEXCEPT;
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
error_code
|
error_code
|
||||||
make_error_code(future_errc __e)
|
make_error_code(future_errc __e) _NOEXCEPT
|
||||||
{
|
{
|
||||||
return error_code(static_cast<int>(__e), future_category());
|
return error_code(static_cast<int>(__e), future_category());
|
||||||
}
|
}
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
error_condition
|
error_condition
|
||||||
make_error_condition(future_errc __e)
|
make_error_condition(future_errc __e) _NOEXCEPT
|
||||||
{
|
{
|
||||||
return error_condition(static_cast<int>(__e), future_category());
|
return error_condition(static_cast<int>(__e), future_category());
|
||||||
}
|
}
|
||||||
@ -437,7 +437,7 @@ public:
|
|||||||
future_error(error_code __ec);
|
future_error(error_code __ec);
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
const error_code& code() const throw() {return __ec_;}
|
const error_code& code() const _NOEXCEPT {return __ec_;}
|
||||||
|
|
||||||
virtual ~future_error() _NOEXCEPT;
|
virtual ~future_error() _NOEXCEPT;
|
||||||
};
|
};
|
||||||
@ -755,7 +755,6 @@ template <class _Alloc>
|
|||||||
void
|
void
|
||||||
__assoc_sub_state_alloc<_Alloc>::__on_zero_shared() _NOEXCEPT
|
__assoc_sub_state_alloc<_Alloc>::__on_zero_shared() _NOEXCEPT
|
||||||
{
|
{
|
||||||
this->~base();
|
|
||||||
typename _Alloc::template rebind<__assoc_sub_state_alloc>::other __a(__alloc_);
|
typename _Alloc::template rebind<__assoc_sub_state_alloc>::other __a(__alloc_);
|
||||||
this->~__assoc_sub_state_alloc();
|
this->~__assoc_sub_state_alloc();
|
||||||
__a.deallocate(this, 1);
|
__a.deallocate(this, 1);
|
||||||
@ -963,12 +962,12 @@ __async_assoc_state<void, _Fp>::__on_zero_shared() _NOEXCEPT
|
|||||||
base::__on_zero_shared();
|
base::__on_zero_shared();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _Rp> class promise;
|
template <class _Rp> class _LIBCPP_VISIBLE promise;
|
||||||
template <class _Rp> class shared_future;
|
template <class _Rp> class _LIBCPP_VISIBLE shared_future;
|
||||||
|
|
||||||
// future
|
// future
|
||||||
|
|
||||||
template <class _Rp> class future;
|
template <class _Rp> class _LIBCPP_VISIBLE future;
|
||||||
|
|
||||||
template <class _Rp, class _Fp>
|
template <class _Rp, class _Fp>
|
||||||
future<_Rp>
|
future<_Rp>
|
||||||
@ -1010,15 +1009,15 @@ class _LIBCPP_VISIBLE future
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
future() : __state_(nullptr) {}
|
future() _NOEXCEPT : __state_(nullptr) {}
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
future(future&& __rhs)
|
future(future&& __rhs) _NOEXCEPT
|
||||||
: __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
|
: __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
|
||||||
future(const future&) = delete;
|
future(const future&) = delete;
|
||||||
future& operator=(const future&) = delete;
|
future& operator=(const future&) = delete;
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
future& operator=(future&& __rhs)
|
future& operator=(future&& __rhs) _NOEXCEPT
|
||||||
{
|
{
|
||||||
future(std::move(__rhs)).swap(*this);
|
future(std::move(__rhs)).swap(*this);
|
||||||
return *this;
|
return *this;
|
||||||
@ -1036,11 +1035,11 @@ public:
|
|||||||
_Rp get();
|
_Rp get();
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void swap(future& __rhs) {_VSTD::swap(__state_, __rhs.__state_);}
|
void swap(future& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
|
||||||
|
|
||||||
// functions to check state
|
// functions to check state
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool valid() const {return __state_ != nullptr;}
|
bool valid() const _NOEXCEPT {return __state_ != nullptr;}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void wait() const {__state_->wait();}
|
void wait() const {__state_->wait();}
|
||||||
@ -1114,15 +1113,15 @@ class _LIBCPP_VISIBLE future<_Rp&>
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
future() : __state_(nullptr) {}
|
future() _NOEXCEPT : __state_(nullptr) {}
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
future(future&& __rhs)
|
future(future&& __rhs) _NOEXCEPT
|
||||||
: __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
|
: __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
|
||||||
future(const future&) = delete;
|
future(const future&) = delete;
|
||||||
future& operator=(const future&) = delete;
|
future& operator=(const future&) = delete;
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
future& operator=(future&& __rhs)
|
future& operator=(future&& __rhs) _NOEXCEPT
|
||||||
{
|
{
|
||||||
future(std::move(__rhs)).swap(*this);
|
future(std::move(__rhs)).swap(*this);
|
||||||
return *this;
|
return *this;
|
||||||
@ -1140,11 +1139,11 @@ public:
|
|||||||
_Rp& get();
|
_Rp& get();
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void swap(future& __rhs) {_VSTD::swap(__state_, __rhs.__state_);}
|
void swap(future& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
|
||||||
|
|
||||||
// functions to check state
|
// functions to check state
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool valid() const {return __state_ != nullptr;}
|
bool valid() const _NOEXCEPT {return __state_ != nullptr;}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void wait() const {__state_->wait();}
|
void wait() const {__state_->wait();}
|
||||||
@ -1213,15 +1212,15 @@ class _LIBCPP_VISIBLE future<void>
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
future() : __state_(nullptr) {}
|
future() _NOEXCEPT : __state_(nullptr) {}
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
future(future&& __rhs)
|
future(future&& __rhs) _NOEXCEPT
|
||||||
: __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
|
: __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
|
||||||
future(const future&) = delete;
|
future(const future&) = delete;
|
||||||
future& operator=(const future&) = delete;
|
future& operator=(const future&) = delete;
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
future& operator=(future&& __rhs)
|
future& operator=(future&& __rhs) _NOEXCEPT
|
||||||
{
|
{
|
||||||
future(std::move(__rhs)).swap(*this);
|
future(std::move(__rhs)).swap(*this);
|
||||||
return *this;
|
return *this;
|
||||||
@ -1239,11 +1238,11 @@ public:
|
|||||||
void get();
|
void get();
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void swap(future& __rhs) {_VSTD::swap(__state_, __rhs.__state_);}
|
void swap(future& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
|
||||||
|
|
||||||
// functions to check state
|
// functions to check state
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool valid() const {return __state_ != nullptr;}
|
bool valid() const _NOEXCEPT {return __state_ != nullptr;}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void wait() const {__state_->wait();}
|
void wait() const {__state_->wait();}
|
||||||
@ -1262,7 +1261,7 @@ public:
|
|||||||
template <class _Rp>
|
template <class _Rp>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
void
|
void
|
||||||
swap(future<_Rp>& __x, future<_Rp>& __y)
|
swap(future<_Rp>& __x, future<_Rp>& __y) _NOEXCEPT
|
||||||
{
|
{
|
||||||
__x.swap(__y);
|
__x.swap(__y);
|
||||||
}
|
}
|
||||||
@ -1277,7 +1276,7 @@ class _LIBCPP_VISIBLE promise
|
|||||||
__assoc_state<_Rp>* __state_;
|
__assoc_state<_Rp>* __state_;
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
explicit promise(nullptr_t) : __state_(nullptr) {}
|
explicit promise(nullptr_t) _NOEXCEPT : __state_(nullptr) {}
|
||||||
|
|
||||||
template <class> friend class packaged_task;
|
template <class> friend class packaged_task;
|
||||||
public:
|
public:
|
||||||
@ -1286,7 +1285,7 @@ public:
|
|||||||
promise(allocator_arg_t, const _Alloc& __a);
|
promise(allocator_arg_t, const _Alloc& __a);
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
promise(promise&& __rhs)
|
promise(promise&& __rhs) _NOEXCEPT
|
||||||
: __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
|
: __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
|
||||||
promise(const promise& __rhs) = delete;
|
promise(const promise& __rhs) = delete;
|
||||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
@ -1299,7 +1298,7 @@ public:
|
|||||||
// assignment
|
// assignment
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
promise& operator=(promise&& __rhs)
|
promise& operator=(promise&& __rhs) _NOEXCEPT
|
||||||
{
|
{
|
||||||
promise(std::move(__rhs)).swap(*this);
|
promise(std::move(__rhs)).swap(*this);
|
||||||
return *this;
|
return *this;
|
||||||
@ -1311,7 +1310,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void swap(promise& __rhs) {_VSTD::swap(__state_, __rhs.__state_);}
|
void swap(promise& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
|
||||||
|
|
||||||
// retrieving the result
|
// retrieving the result
|
||||||
future<_Rp> get_future();
|
future<_Rp> get_future();
|
||||||
@ -1455,7 +1454,7 @@ class _LIBCPP_VISIBLE promise<_Rp&>
|
|||||||
__assoc_state<_Rp&>* __state_;
|
__assoc_state<_Rp&>* __state_;
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
explicit promise(nullptr_t) : __state_(nullptr) {}
|
explicit promise(nullptr_t) _NOEXCEPT : __state_(nullptr) {}
|
||||||
|
|
||||||
template <class> friend class packaged_task;
|
template <class> friend class packaged_task;
|
||||||
|
|
||||||
@ -1465,7 +1464,7 @@ public:
|
|||||||
promise(allocator_arg_t, const _Allocator& __a);
|
promise(allocator_arg_t, const _Allocator& __a);
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
promise(promise&& __rhs)
|
promise(promise&& __rhs) _NOEXCEPT
|
||||||
: __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
|
: __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
|
||||||
promise(const promise& __rhs) = delete;
|
promise(const promise& __rhs) = delete;
|
||||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
@ -1478,7 +1477,7 @@ public:
|
|||||||
// assignment
|
// assignment
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
promise& operator=(promise&& __rhs)
|
promise& operator=(promise&& __rhs) _NOEXCEPT
|
||||||
{
|
{
|
||||||
promise(std::move(__rhs)).swap(*this);
|
promise(std::move(__rhs)).swap(*this);
|
||||||
return *this;
|
return *this;
|
||||||
@ -1490,7 +1489,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void swap(promise& __rhs) {_VSTD::swap(__state_, __rhs.__state_);}
|
void swap(promise& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
|
||||||
|
|
||||||
// retrieving the result
|
// retrieving the result
|
||||||
future<_Rp&> get_future();
|
future<_Rp&> get_future();
|
||||||
@ -1598,7 +1597,7 @@ class _LIBCPP_VISIBLE promise<void>
|
|||||||
__assoc_sub_state* __state_;
|
__assoc_sub_state* __state_;
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
explicit promise(nullptr_t) : __state_(nullptr) {}
|
explicit promise(nullptr_t) _NOEXCEPT : __state_(nullptr) {}
|
||||||
|
|
||||||
template <class> friend class packaged_task;
|
template <class> friend class packaged_task;
|
||||||
|
|
||||||
@ -1608,7 +1607,7 @@ public:
|
|||||||
promise(allocator_arg_t, const _Allocator& __a);
|
promise(allocator_arg_t, const _Allocator& __a);
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
promise(promise&& __rhs)
|
promise(promise&& __rhs) _NOEXCEPT
|
||||||
: __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
|
: __state_(__rhs.__state_) {__rhs.__state_ = nullptr;}
|
||||||
promise(const promise& __rhs) = delete;
|
promise(const promise& __rhs) = delete;
|
||||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
@ -1621,7 +1620,7 @@ public:
|
|||||||
// assignment
|
// assignment
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
promise& operator=(promise&& __rhs)
|
promise& operator=(promise&& __rhs) _NOEXCEPT
|
||||||
{
|
{
|
||||||
promise(std::move(__rhs)).swap(*this);
|
promise(std::move(__rhs)).swap(*this);
|
||||||
return *this;
|
return *this;
|
||||||
@ -1633,7 +1632,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void swap(promise& __rhs) {_VSTD::swap(__state_, __rhs.__state_);}
|
void swap(promise& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
|
||||||
|
|
||||||
// retrieving the result
|
// retrieving the result
|
||||||
future<void> get_future();
|
future<void> get_future();
|
||||||
@ -1661,7 +1660,7 @@ promise<void>::promise(allocator_arg_t, const _Alloc& __a0)
|
|||||||
template <class _Rp>
|
template <class _Rp>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
void
|
void
|
||||||
swap(promise<_Rp>& __x, promise<_Rp>& __y)
|
swap(promise<_Rp>& __x, promise<_Rp>& __y) _NOEXCEPT
|
||||||
{
|
{
|
||||||
__x.swap(__y);
|
__x.swap(__y);
|
||||||
}
|
}
|
||||||
@ -1686,7 +1685,7 @@ public:
|
|||||||
__packaged_task_base() {}
|
__packaged_task_base() {}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
virtual ~__packaged_task_base() {}
|
virtual ~__packaged_task_base() {}
|
||||||
virtual void __move_to(__packaged_task_base*) = 0;
|
virtual void __move_to(__packaged_task_base*) _NOEXCEPT = 0;
|
||||||
virtual void destroy() = 0;
|
virtual void destroy() = 0;
|
||||||
virtual void destroy_deallocate() = 0;
|
virtual void destroy_deallocate() = 0;
|
||||||
virtual _Rp operator()(_ArgTypes&& ...) = 0;
|
virtual _Rp operator()(_ArgTypes&& ...) = 0;
|
||||||
@ -1710,7 +1709,7 @@ public:
|
|||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
__packaged_task_func(_Fp&& __f, const _Alloc& __a)
|
__packaged_task_func(_Fp&& __f, const _Alloc& __a)
|
||||||
: __f_(_VSTD::move(__f), __a) {}
|
: __f_(_VSTD::move(__f), __a) {}
|
||||||
virtual void __move_to(__packaged_task_base<_Rp(_ArgTypes...)>*);
|
virtual void __move_to(__packaged_task_base<_Rp(_ArgTypes...)>*) _NOEXCEPT;
|
||||||
virtual void destroy();
|
virtual void destroy();
|
||||||
virtual void destroy_deallocate();
|
virtual void destroy_deallocate();
|
||||||
virtual _Rp operator()(_ArgTypes&& ... __args);
|
virtual _Rp operator()(_ArgTypes&& ... __args);
|
||||||
@ -1719,7 +1718,7 @@ public:
|
|||||||
template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
|
template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
|
||||||
void
|
void
|
||||||
__packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>::__move_to(
|
__packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>::__move_to(
|
||||||
__packaged_task_base<_Rp(_ArgTypes...)>* __p)
|
__packaged_task_base<_Rp(_ArgTypes...)>* __p) _NOEXCEPT
|
||||||
{
|
{
|
||||||
::new (__p) __packaged_task_func(_VSTD::move(__f_.first()), _VSTD::move(__f_.second()));
|
::new (__p) __packaged_task_func(_VSTD::move(__f_.first()), _VSTD::move(__f_.second()));
|
||||||
}
|
}
|
||||||
@ -1762,27 +1761,27 @@ public:
|
|||||||
|
|
||||||
// construct/copy/destroy:
|
// construct/copy/destroy:
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
__packaged_task_function() : __f_(nullptr) {}
|
__packaged_task_function() _NOEXCEPT : __f_(nullptr) {}
|
||||||
template<class _Fp>
|
template<class _Fp>
|
||||||
__packaged_task_function(_Fp&& __f);
|
__packaged_task_function(_Fp&& __f);
|
||||||
template<class _Fp, class _Alloc>
|
template<class _Fp, class _Alloc>
|
||||||
__packaged_task_function(allocator_arg_t, const _Alloc& __a, _Fp&& __f);
|
__packaged_task_function(allocator_arg_t, const _Alloc& __a, _Fp&& __f);
|
||||||
|
|
||||||
__packaged_task_function(__packaged_task_function&&);
|
__packaged_task_function(__packaged_task_function&&) _NOEXCEPT;
|
||||||
__packaged_task_function& operator=(__packaged_task_function&&);
|
__packaged_task_function& operator=(__packaged_task_function&&) _NOEXCEPT;
|
||||||
|
|
||||||
__packaged_task_function(const __packaged_task_function&) = delete;
|
__packaged_task_function(const __packaged_task_function&) = delete;
|
||||||
__packaged_task_function& operator=(const __packaged_task_function&) = delete;
|
__packaged_task_function& operator=(const __packaged_task_function&) = delete;
|
||||||
|
|
||||||
~__packaged_task_function();
|
~__packaged_task_function();
|
||||||
|
|
||||||
void swap(__packaged_task_function&);
|
void swap(__packaged_task_function&) _NOEXCEPT;
|
||||||
|
|
||||||
_Rp operator()(_ArgTypes...) const;
|
_Rp operator()(_ArgTypes...) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class _Rp, class ..._ArgTypes>
|
template<class _Rp, class ..._ArgTypes>
|
||||||
__packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(__packaged_task_function&& __f)
|
__packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(__packaged_task_function&& __f) _NOEXCEPT
|
||||||
{
|
{
|
||||||
if (__f.__f_ == nullptr)
|
if (__f.__f_ == nullptr)
|
||||||
__f_ = nullptr;
|
__f_ = nullptr;
|
||||||
@ -1854,7 +1853,7 @@ __packaged_task_function<_Rp(_ArgTypes...)>::__packaged_task_function(
|
|||||||
|
|
||||||
template<class _Rp, class ..._ArgTypes>
|
template<class _Rp, class ..._ArgTypes>
|
||||||
__packaged_task_function<_Rp(_ArgTypes...)>&
|
__packaged_task_function<_Rp(_ArgTypes...)>&
|
||||||
__packaged_task_function<_Rp(_ArgTypes...)>::operator=(__packaged_task_function&& __f)
|
__packaged_task_function<_Rp(_ArgTypes...)>::operator=(__packaged_task_function&& __f) _NOEXCEPT
|
||||||
{
|
{
|
||||||
if (__f_ == (__base*)&__buf_)
|
if (__f_ == (__base*)&__buf_)
|
||||||
__f_->destroy();
|
__f_->destroy();
|
||||||
@ -1873,6 +1872,7 @@ __packaged_task_function<_Rp(_ArgTypes...)>::operator=(__packaged_task_function&
|
|||||||
__f_ = __f.__f_;
|
__f_ = __f.__f_;
|
||||||
__f.__f_ = nullptr;
|
__f.__f_ = nullptr;
|
||||||
}
|
}
|
||||||
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class _Rp, class ..._ArgTypes>
|
template<class _Rp, class ..._ArgTypes>
|
||||||
@ -1886,7 +1886,7 @@ __packaged_task_function<_Rp(_ArgTypes...)>::~__packaged_task_function()
|
|||||||
|
|
||||||
template<class _Rp, class ..._ArgTypes>
|
template<class _Rp, class ..._ArgTypes>
|
||||||
void
|
void
|
||||||
__packaged_task_function<_Rp(_ArgTypes...)>::swap(__packaged_task_function& __f)
|
__packaged_task_function<_Rp(_ArgTypes...)>::swap(__packaged_task_function& __f) _NOEXCEPT
|
||||||
{
|
{
|
||||||
if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_)
|
if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_)
|
||||||
{
|
{
|
||||||
@ -1942,7 +1942,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
// construction and destruction
|
// construction and destruction
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
packaged_task() : __p_(nullptr) {}
|
packaged_task() _NOEXCEPT : __p_(nullptr) {}
|
||||||
template <class _Fp>
|
template <class _Fp>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
explicit packaged_task(_Fp&& __f) : __f_(_VSTD::forward<_Fp>(__f)) {}
|
explicit packaged_task(_Fp&& __f) : __f_(_VSTD::forward<_Fp>(__f)) {}
|
||||||
@ -1954,29 +1954,29 @@ public:
|
|||||||
// ~packaged_task() = default;
|
// ~packaged_task() = default;
|
||||||
|
|
||||||
// no copy
|
// no copy
|
||||||
packaged_task(packaged_task&) = delete;
|
packaged_task(const packaged_task&) = delete;
|
||||||
packaged_task& operator=(packaged_task&) = delete;
|
packaged_task& operator=(const packaged_task&) = delete;
|
||||||
|
|
||||||
// move support
|
// move support
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
packaged_task(packaged_task&& __other)
|
packaged_task(packaged_task&& __other) _NOEXCEPT
|
||||||
: __f_(_VSTD::move(__other.__f_)), __p_(_VSTD::move(__other.__p_)) {}
|
: __f_(_VSTD::move(__other.__f_)), __p_(_VSTD::move(__other.__p_)) {}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
packaged_task& operator=(packaged_task&& __other)
|
packaged_task& operator=(packaged_task&& __other) _NOEXCEPT
|
||||||
{
|
{
|
||||||
__f_ = _VSTD::move(__other.__f_);
|
__f_ = _VSTD::move(__other.__f_);
|
||||||
__p_ = _VSTD::move(__other.__p_);
|
__p_ = _VSTD::move(__other.__p_);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void swap(packaged_task& __other)
|
void swap(packaged_task& __other) _NOEXCEPT
|
||||||
{
|
{
|
||||||
__f_.swap(__other.__f_);
|
__f_.swap(__other.__f_);
|
||||||
__p_.swap(__other.__p_);
|
__p_.swap(__other.__p_);
|
||||||
}
|
}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool valid() const {return __p_.__state_ != nullptr;}
|
bool valid() const _NOEXCEPT {return __p_.__state_ != nullptr;}
|
||||||
|
|
||||||
// result retrieval
|
// result retrieval
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@ -2057,7 +2057,7 @@ private:
|
|||||||
public:
|
public:
|
||||||
// construction and destruction
|
// construction and destruction
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
packaged_task() : __p_(nullptr) {}
|
packaged_task() _NOEXCEPT : __p_(nullptr) {}
|
||||||
template <class _Fp>
|
template <class _Fp>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
explicit packaged_task(_Fp&& __f) : __f_(_VSTD::forward<_Fp>(__f)) {}
|
explicit packaged_task(_Fp&& __f) : __f_(_VSTD::forward<_Fp>(__f)) {}
|
||||||
@ -2069,29 +2069,29 @@ public:
|
|||||||
// ~packaged_task() = default;
|
// ~packaged_task() = default;
|
||||||
|
|
||||||
// no copy
|
// no copy
|
||||||
packaged_task(packaged_task&) = delete;
|
packaged_task(const packaged_task&) = delete;
|
||||||
packaged_task& operator=(packaged_task&) = delete;
|
packaged_task& operator=(const packaged_task&) = delete;
|
||||||
|
|
||||||
// move support
|
// move support
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
packaged_task(packaged_task&& __other)
|
packaged_task(packaged_task&& __other) _NOEXCEPT
|
||||||
: __f_(_VSTD::move(__other.__f_)), __p_(_VSTD::move(__other.__p_)) {}
|
: __f_(_VSTD::move(__other.__f_)), __p_(_VSTD::move(__other.__p_)) {}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
packaged_task& operator=(packaged_task&& __other)
|
packaged_task& operator=(packaged_task&& __other) _NOEXCEPT
|
||||||
{
|
{
|
||||||
__f_ = _VSTD::move(__other.__f_);
|
__f_ = _VSTD::move(__other.__f_);
|
||||||
__p_ = _VSTD::move(__other.__p_);
|
__p_ = _VSTD::move(__other.__p_);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void swap(packaged_task& __other)
|
void swap(packaged_task& __other) _NOEXCEPT
|
||||||
{
|
{
|
||||||
__f_.swap(__other.__f_);
|
__f_.swap(__other.__f_);
|
||||||
__p_.swap(__other.__p_);
|
__p_.swap(__other.__p_);
|
||||||
}
|
}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool valid() const {return __p_.__state_ != nullptr;}
|
bool valid() const _NOEXCEPT {return __p_.__state_ != nullptr;}
|
||||||
|
|
||||||
// result retrieval
|
// result retrieval
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@ -2164,7 +2164,7 @@ packaged_task<void(_ArgTypes...)>::reset()
|
|||||||
template <class _Callable>
|
template <class _Callable>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
void
|
void
|
||||||
swap(packaged_task<_Callable>& __x, packaged_task<_Callable>& __y)
|
swap(packaged_task<_Callable>& __x, packaged_task<_Callable>& __y) _NOEXCEPT
|
||||||
{
|
{
|
||||||
__x.swap(__y);
|
__x.swap(__y);
|
||||||
}
|
}
|
||||||
@ -2265,23 +2265,23 @@ class _LIBCPP_VISIBLE shared_future
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
shared_future() : __state_(nullptr) {}
|
shared_future() _NOEXCEPT : __state_(nullptr) {}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
shared_future(const shared_future& __rhs) : __state_(__rhs.__state_)
|
shared_future(const shared_future& __rhs) : __state_(__rhs.__state_)
|
||||||
{if (__state_) __state_->__add_shared();}
|
{if (__state_) __state_->__add_shared();}
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
shared_future(future<_Rp>&& __f) : __state_(__f.__state_)
|
shared_future(future<_Rp>&& __f) _NOEXCEPT : __state_(__f.__state_)
|
||||||
{__f.__state_ = nullptr;}
|
{__f.__state_ = nullptr;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
shared_future(shared_future&& __rhs) : __state_(__rhs.__state_)
|
shared_future(shared_future&& __rhs) _NOEXCEPT : __state_(__rhs.__state_)
|
||||||
{__rhs.__state_ = nullptr;}
|
{__rhs.__state_ = nullptr;}
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
~shared_future();
|
~shared_future();
|
||||||
shared_future& operator=(const shared_future& __rhs);
|
shared_future& operator=(const shared_future& __rhs);
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
shared_future& operator=(shared_future&& __rhs)
|
shared_future& operator=(shared_future&& __rhs) _NOEXCEPT
|
||||||
{
|
{
|
||||||
shared_future(std::move(__rhs)).swap(*this);
|
shared_future(std::move(__rhs)).swap(*this);
|
||||||
return *this;
|
return *this;
|
||||||
@ -2293,11 +2293,11 @@ public:
|
|||||||
const _Rp& get() const {return __state_->copy();}
|
const _Rp& get() const {return __state_->copy();}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void swap(shared_future& __rhs) {_VSTD::swap(__state_, __rhs.__state_);}
|
void swap(shared_future& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
|
||||||
|
|
||||||
// functions to check state
|
// functions to check state
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool valid() const {return __state_ != nullptr;}
|
bool valid() const _NOEXCEPT {return __state_ != nullptr;}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void wait() const {__state_->wait();}
|
void wait() const {__state_->wait();}
|
||||||
@ -2339,23 +2339,23 @@ class _LIBCPP_VISIBLE shared_future<_Rp&>
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
shared_future() : __state_(nullptr) {}
|
shared_future() _NOEXCEPT : __state_(nullptr) {}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
shared_future(const shared_future& __rhs) : __state_(__rhs.__state_)
|
shared_future(const shared_future& __rhs) : __state_(__rhs.__state_)
|
||||||
{if (__state_) __state_->__add_shared();}
|
{if (__state_) __state_->__add_shared();}
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
shared_future(future<_Rp&>&& __f) : __state_(__f.__state_)
|
shared_future(future<_Rp&>&& __f) _NOEXCEPT : __state_(__f.__state_)
|
||||||
{__f.__state_ = nullptr;}
|
{__f.__state_ = nullptr;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
shared_future(shared_future&& __rhs) : __state_(__rhs.__state_)
|
shared_future(shared_future&& __rhs) _NOEXCEPT : __state_(__rhs.__state_)
|
||||||
{__rhs.__state_ = nullptr;}
|
{__rhs.__state_ = nullptr;}
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
~shared_future();
|
~shared_future();
|
||||||
shared_future& operator=(const shared_future& __rhs);
|
shared_future& operator=(const shared_future& __rhs);
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
shared_future& operator=(shared_future&& __rhs)
|
shared_future& operator=(shared_future&& __rhs) _NOEXCEPT
|
||||||
{
|
{
|
||||||
shared_future(std::move(__rhs)).swap(*this);
|
shared_future(std::move(__rhs)).swap(*this);
|
||||||
return *this;
|
return *this;
|
||||||
@ -2367,11 +2367,11 @@ public:
|
|||||||
_Rp& get() const {return __state_->copy();}
|
_Rp& get() const {return __state_->copy();}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void swap(shared_future& __rhs) {_VSTD::swap(__state_, __rhs.__state_);}
|
void swap(shared_future& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
|
||||||
|
|
||||||
// functions to check state
|
// functions to check state
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool valid() const {return __state_ != nullptr;}
|
bool valid() const _NOEXCEPT {return __state_ != nullptr;}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void wait() const {__state_->wait();}
|
void wait() const {__state_->wait();}
|
||||||
@ -2413,23 +2413,23 @@ class _LIBCPP_VISIBLE shared_future<void>
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
shared_future() : __state_(nullptr) {}
|
shared_future() _NOEXCEPT : __state_(nullptr) {}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
shared_future(const shared_future& __rhs) : __state_(__rhs.__state_)
|
shared_future(const shared_future& __rhs) : __state_(__rhs.__state_)
|
||||||
{if (__state_) __state_->__add_shared();}
|
{if (__state_) __state_->__add_shared();}
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
shared_future(future<void>&& __f) : __state_(__f.__state_)
|
shared_future(future<void>&& __f) _NOEXCEPT : __state_(__f.__state_)
|
||||||
{__f.__state_ = nullptr;}
|
{__f.__state_ = nullptr;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
shared_future(shared_future&& __rhs) : __state_(__rhs.__state_)
|
shared_future(shared_future&& __rhs) _NOEXCEPT : __state_(__rhs.__state_)
|
||||||
{__rhs.__state_ = nullptr;}
|
{__rhs.__state_ = nullptr;}
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
~shared_future();
|
~shared_future();
|
||||||
shared_future& operator=(const shared_future& __rhs);
|
shared_future& operator=(const shared_future& __rhs);
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
shared_future& operator=(shared_future&& __rhs)
|
shared_future& operator=(shared_future&& __rhs) _NOEXCEPT
|
||||||
{
|
{
|
||||||
shared_future(std::move(__rhs)).swap(*this);
|
shared_future(std::move(__rhs)).swap(*this);
|
||||||
return *this;
|
return *this;
|
||||||
@ -2441,11 +2441,11 @@ public:
|
|||||||
void get() const {__state_->copy();}
|
void get() const {__state_->copy();}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void swap(shared_future& __rhs) {_VSTD::swap(__state_, __rhs.__state_);}
|
void swap(shared_future& __rhs) _NOEXCEPT {_VSTD::swap(__state_, __rhs.__state_);}
|
||||||
|
|
||||||
// functions to check state
|
// functions to check state
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool valid() const {return __state_ != nullptr;}
|
bool valid() const _NOEXCEPT {return __state_ != nullptr;}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void wait() const {__state_->wait();}
|
void wait() const {__state_->wait();}
|
||||||
@ -2464,7 +2464,7 @@ public:
|
|||||||
template <class _Rp>
|
template <class _Rp>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
void
|
void
|
||||||
swap(shared_future<_Rp>& __x, shared_future<_Rp>& __y)
|
swap(shared_future<_Rp>& __x, shared_future<_Rp>& __y) _NOEXCEPT
|
||||||
{
|
{
|
||||||
__x.swap(__y);
|
__x.swap(__y);
|
||||||
}
|
}
|
||||||
|
@ -29,43 +29,43 @@ public:
|
|||||||
class failure;
|
class failure;
|
||||||
|
|
||||||
typedef T1 fmtflags;
|
typedef T1 fmtflags;
|
||||||
static const fmtflags boolalpha;
|
static constexpr fmtflags boolalpha;
|
||||||
static const fmtflags dec;
|
static constexpr fmtflags dec;
|
||||||
static const fmtflags fixed;
|
static constexpr fmtflags fixed;
|
||||||
static const fmtflags hex;
|
static constexpr fmtflags hex;
|
||||||
static const fmtflags internal;
|
static constexpr fmtflags internal;
|
||||||
static const fmtflags left;
|
static constexpr fmtflags left;
|
||||||
static const fmtflags oct;
|
static constexpr fmtflags oct;
|
||||||
static const fmtflags right;
|
static constexpr fmtflags right;
|
||||||
static const fmtflags scientific;
|
static constexpr fmtflags scientific;
|
||||||
static const fmtflags showbase;
|
static constexpr fmtflags showbase;
|
||||||
static const fmtflags showpoint;
|
static constexpr fmtflags showpoint;
|
||||||
static const fmtflags showpos;
|
static constexpr fmtflags showpos;
|
||||||
static const fmtflags skipws;
|
static constexpr fmtflags skipws;
|
||||||
static const fmtflags unitbuf;
|
static constexpr fmtflags unitbuf;
|
||||||
static const fmtflags uppercase;
|
static constexpr fmtflags uppercase;
|
||||||
static const fmtflags adjustfield;
|
static constexpr fmtflags adjustfield;
|
||||||
static const fmtflags basefield;
|
static constexpr fmtflags basefield;
|
||||||
static const fmtflags floatfield;
|
static constexpr fmtflags floatfield;
|
||||||
|
|
||||||
typedef T2 iostate;
|
typedef T2 iostate;
|
||||||
static const iostate badbit;
|
static constexpr iostate badbit;
|
||||||
static const iostate eofbit;
|
static constexpr iostate eofbit;
|
||||||
static const iostate failbit;
|
static constexpr iostate failbit;
|
||||||
static const iostate goodbit;
|
static constexpr iostate goodbit;
|
||||||
|
|
||||||
typedef T3 openmode;
|
typedef T3 openmode;
|
||||||
static const openmode app;
|
static constexpr openmode app;
|
||||||
static const openmode ate;
|
static constexpr openmode ate;
|
||||||
static const openmode binary;
|
static constexpr openmode binary;
|
||||||
static const openmode in;
|
static constexpr openmode in;
|
||||||
static const openmode out;
|
static constexpr openmode out;
|
||||||
static const openmode trunc;
|
static constexpr openmode trunc;
|
||||||
|
|
||||||
typedef T4 seekdir;
|
typedef T4 seekdir;
|
||||||
static const seekdir beg;
|
static constexpr seekdir beg;
|
||||||
static const seekdir cur;
|
static constexpr seekdir cur;
|
||||||
static const seekdir end;
|
static constexpr seekdir end;
|
||||||
|
|
||||||
class Init;
|
class Init;
|
||||||
|
|
||||||
@ -160,7 +160,7 @@ protected:
|
|||||||
basic_ios();
|
basic_ios();
|
||||||
void init(basic_streambuf<charT,traits>* sb);
|
void init(basic_streambuf<charT,traits>* sb);
|
||||||
void move(basic_ios& rhs);
|
void move(basic_ios& rhs);
|
||||||
void swap(basic_ios& rhs);
|
void swap(basic_ios& rhs) noexcept;
|
||||||
void set_rdbuf(basic_streambuf<charT, traits>* sb);
|
void set_rdbuf(basic_streambuf<charT, traits>* sb);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -227,7 +227,7 @@ typedef ptrdiff_t streamsize;
|
|||||||
class _LIBCPP_VISIBLE ios_base
|
class _LIBCPP_VISIBLE ios_base
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
class failure;
|
class _LIBCPP_VISIBLE failure;
|
||||||
|
|
||||||
typedef unsigned int fmtflags;
|
typedef unsigned int fmtflags;
|
||||||
static const fmtflags boolalpha = 0x0001;
|
static const fmtflags boolalpha = 0x0001;
|
||||||
@ -271,7 +271,7 @@ public:
|
|||||||
typedef _VSTD::streamoff streamoff;
|
typedef _VSTD::streamoff streamoff;
|
||||||
typedef _VSTD::streampos streampos;
|
typedef _VSTD::streampos streampos;
|
||||||
|
|
||||||
class Init;
|
class _LIBCPP_VISIBLE Init;
|
||||||
|
|
||||||
// 27.5.2.2 fmtflags state:
|
// 27.5.2.2 fmtflags state:
|
||||||
_LIBCPP_INLINE_VISIBILITY fmtflags flags() const;
|
_LIBCPP_INLINE_VISIBILITY fmtflags flags() const;
|
||||||
@ -342,7 +342,7 @@ protected:
|
|||||||
void __call_callbacks(event);
|
void __call_callbacks(event);
|
||||||
void copyfmt(const ios_base&);
|
void copyfmt(const ios_base&);
|
||||||
void move(ios_base&);
|
void move(ios_base&);
|
||||||
void swap(ios_base&);
|
void swap(ios_base&) _NOEXCEPT;
|
||||||
|
|
||||||
_LIBCPP_ALWAYS_INLINE
|
_LIBCPP_ALWAYS_INLINE
|
||||||
void set_rdbuf(void* __sb)
|
void set_rdbuf(void* __sb)
|
||||||
@ -632,12 +632,12 @@ protected:
|
|||||||
void move(basic_ios&& __rhs) {move(__rhs);}
|
void move(basic_ios&& __rhs) {move(__rhs);}
|
||||||
#endif
|
#endif
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void swap(basic_ios& __rhs);
|
void swap(basic_ios& __rhs) _NOEXCEPT;
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void set_rdbuf(basic_streambuf<char_type, traits_type>* __sb);
|
void set_rdbuf(basic_streambuf<char_type, traits_type>* __sb);
|
||||||
private:
|
private:
|
||||||
basic_ostream<char_type, traits_type>* __tie_;
|
basic_ostream<char_type, traits_type>* __tie_;
|
||||||
char_type __fill_;
|
mutable int_type __fill_;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _CharT, class _Traits>
|
template <class _CharT, class _Traits>
|
||||||
@ -659,7 +659,7 @@ basic_ios<_CharT, _Traits>::init(basic_streambuf<char_type, traits_type>* __sb)
|
|||||||
{
|
{
|
||||||
ios_base::init(__sb);
|
ios_base::init(__sb);
|
||||||
__tie_ = 0;
|
__tie_ = 0;
|
||||||
__fill_ = widen(' ');
|
__fill_ = traits_type::eof();
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _CharT, class _Traits>
|
template <class _CharT, class _Traits>
|
||||||
@ -731,6 +731,8 @@ inline _LIBCPP_INLINE_VISIBILITY
|
|||||||
_CharT
|
_CharT
|
||||||
basic_ios<_CharT, _Traits>::fill() const
|
basic_ios<_CharT, _Traits>::fill() const
|
||||||
{
|
{
|
||||||
|
if (traits_type::eq_int_type(traits_type::eof(), __fill_))
|
||||||
|
__fill_ = widen(' ');
|
||||||
return __fill_;
|
return __fill_;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -774,7 +776,7 @@ basic_ios<_CharT, _Traits>::move(basic_ios& __rhs)
|
|||||||
template <class _CharT, class _Traits>
|
template <class _CharT, class _Traits>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
void
|
void
|
||||||
basic_ios<_CharT, _Traits>::swap(basic_ios& __rhs)
|
basic_ios<_CharT, _Traits>::swap(basic_ios& __rhs) _NOEXCEPT
|
||||||
{
|
{
|
||||||
ios_base::swap(__rhs);
|
ios_base::swap(__rhs);
|
||||||
_VSTD::swap(__tie_, __rhs.__tie_);
|
_VSTD::swap(__tie_, __rhs.__tie_);
|
||||||
|
@ -95,7 +95,7 @@ typedef fpos<char_traits<wchar_t>::state_type> wstreampos;
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
class ios_base;
|
class _LIBCPP_VISIBLE ios_base;
|
||||||
|
|
||||||
template<class _CharT> struct _LIBCPP_VISIBLE char_traits;
|
template<class _CharT> struct _LIBCPP_VISIBLE char_traits;
|
||||||
template<class _Tp> class _LIBCPP_VISIBLE allocator;
|
template<class _Tp> class _LIBCPP_VISIBLE allocator;
|
||||||
|
@ -194,7 +194,7 @@ protected:
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
// 27.7.1.1.3 Prefix/suffix:
|
// 27.7.1.1.3 Prefix/suffix:
|
||||||
class sentry;
|
class _LIBCPP_VISIBLE sentry;
|
||||||
|
|
||||||
// 27.7.1.2 Formatted input:
|
// 27.7.1.2 Formatted input:
|
||||||
basic_istream& operator>>(basic_istream& (*__pf)(basic_istream&));
|
basic_istream& operator>>(basic_istream& (*__pf)(basic_istream&));
|
||||||
@ -1263,6 +1263,7 @@ basic_istream<_CharT, _Traits>::putback(char_type __c)
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||||
|
this->clear(this->rdstate() & ~ios_base::eofbit);
|
||||||
sentry __sen(*this, true);
|
sentry __sen(*this, true);
|
||||||
if (__sen)
|
if (__sen)
|
||||||
{
|
{
|
||||||
@ -1290,6 +1291,7 @@ basic_istream<_CharT, _Traits>::unget()
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||||
|
this->clear(this->rdstate() & ~ios_base::eofbit);
|
||||||
sentry __sen(*this, true);
|
sentry __sen(*this, true);
|
||||||
if (__sen)
|
if (__sen)
|
||||||
{
|
{
|
||||||
@ -1368,6 +1370,7 @@ basic_istream<_CharT, _Traits>::seekg(pos_type __pos)
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||||
|
this->clear(this->rdstate() & ~ios_base::eofbit);
|
||||||
sentry __sen(*this, true);
|
sentry __sen(*this, true);
|
||||||
if (__sen)
|
if (__sen)
|
||||||
if (this->rdbuf()->pubseekpos(__pos, ios_base::in) == pos_type(-1))
|
if (this->rdbuf()->pubseekpos(__pos, ios_base::in) == pos_type(-1))
|
||||||
|
@ -263,10 +263,10 @@ public:
|
|||||||
typedef basic_streambuf<charT,traits> streambuf_type;
|
typedef basic_streambuf<charT,traits> streambuf_type;
|
||||||
typedef basic_istream<charT,traits> istream_type;
|
typedef basic_istream<charT,traits> istream_type;
|
||||||
|
|
||||||
istreambuf_iterator() throw();
|
istreambuf_iterator() noexcept;
|
||||||
istreambuf_iterator(istream_type& s) throw();
|
istreambuf_iterator(istream_type& s) noexcept;
|
||||||
istreambuf_iterator(streambuf_type* s) throw();
|
istreambuf_iterator(streambuf_type* s) noexcept;
|
||||||
istreambuf_iterator(a-private-type) throw();
|
istreambuf_iterator(a-private-type) noexcept;
|
||||||
|
|
||||||
charT operator*() const;
|
charT operator*() const;
|
||||||
pointer operator->() const;
|
pointer operator->() const;
|
||||||
@ -293,13 +293,13 @@ public:
|
|||||||
typedef basic_streambuf<charT,traits> streambuf_type;
|
typedef basic_streambuf<charT,traits> streambuf_type;
|
||||||
typedef basic_ostream<charT,traits> ostream_type;
|
typedef basic_ostream<charT,traits> ostream_type;
|
||||||
|
|
||||||
ostreambuf_iterator(ostream_type& s) throw();
|
ostreambuf_iterator(ostream_type& s) noexcept;
|
||||||
ostreambuf_iterator(streambuf_type* s) throw();
|
ostreambuf_iterator(streambuf_type* s) noexcept;
|
||||||
ostreambuf_iterator& operator=(charT c);
|
ostreambuf_iterator& operator=(charT c);
|
||||||
ostreambuf_iterator& operator*();
|
ostreambuf_iterator& operator*();
|
||||||
ostreambuf_iterator& operator++();
|
ostreambuf_iterator& operator++();
|
||||||
ostreambuf_iterator& operator++(int);
|
ostreambuf_iterator& operator++(int);
|
||||||
bool failed() const throw();
|
bool failed() const noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class C> auto begin(C& c) -> decltype(c.begin());
|
template <class C> auto begin(C& c) -> decltype(c.begin());
|
||||||
@ -815,12 +815,12 @@ private:
|
|||||||
__sbuf_ = 0;
|
__sbuf_ = 0;
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
_LIBCPP_INLINE_VISIBILITY istreambuf_iterator() throw() : __sbuf_(0) {}
|
_LIBCPP_INLINE_VISIBILITY istreambuf_iterator() _NOEXCEPT : __sbuf_(0) {}
|
||||||
_LIBCPP_INLINE_VISIBILITY istreambuf_iterator(istream_type& __s) throw()
|
_LIBCPP_INLINE_VISIBILITY istreambuf_iterator(istream_type& __s) _NOEXCEPT
|
||||||
: __sbuf_(__s.rdbuf()) {__test_for_eof();}
|
: __sbuf_(__s.rdbuf()) {__test_for_eof();}
|
||||||
_LIBCPP_INLINE_VISIBILITY istreambuf_iterator(streambuf_type* __s) throw()
|
_LIBCPP_INLINE_VISIBILITY istreambuf_iterator(streambuf_type* __s) _NOEXCEPT
|
||||||
: __sbuf_(__s) {__test_for_eof();}
|
: __sbuf_(__s) {__test_for_eof();}
|
||||||
_LIBCPP_INLINE_VISIBILITY istreambuf_iterator(const __proxy& __p) throw()
|
_LIBCPP_INLINE_VISIBILITY istreambuf_iterator(const __proxy& __p) _NOEXCEPT
|
||||||
: __sbuf_(__p.__sbuf_) {}
|
: __sbuf_(__p.__sbuf_) {}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY char_type operator*() const
|
_LIBCPP_INLINE_VISIBILITY char_type operator*() const
|
||||||
@ -867,9 +867,9 @@ public:
|
|||||||
private:
|
private:
|
||||||
streambuf_type* __sbuf_;
|
streambuf_type* __sbuf_;
|
||||||
public:
|
public:
|
||||||
_LIBCPP_INLINE_VISIBILITY ostreambuf_iterator(ostream_type& __s) throw()
|
_LIBCPP_INLINE_VISIBILITY ostreambuf_iterator(ostream_type& __s) _NOEXCEPT
|
||||||
: __sbuf_(__s.rdbuf()) {}
|
: __sbuf_(__s.rdbuf()) {}
|
||||||
_LIBCPP_INLINE_VISIBILITY ostreambuf_iterator(streambuf_type* __s) throw()
|
_LIBCPP_INLINE_VISIBILITY ostreambuf_iterator(streambuf_type* __s) _NOEXCEPT
|
||||||
: __sbuf_(__s) {}
|
: __sbuf_(__s) {}
|
||||||
_LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator=(_CharT __c)
|
_LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator=(_CharT __c)
|
||||||
{
|
{
|
||||||
@ -880,7 +880,15 @@ public:
|
|||||||
_LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator*() {return *this;}
|
_LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator*() {return *this;}
|
||||||
_LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator++() {return *this;}
|
_LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator++() {return *this;}
|
||||||
_LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator++(int) {return *this;}
|
_LIBCPP_INLINE_VISIBILITY ostreambuf_iterator& operator++(int) {return *this;}
|
||||||
_LIBCPP_INLINE_VISIBILITY bool failed() const throw() {return __sbuf_ == 0;}
|
_LIBCPP_INLINE_VISIBILITY bool failed() const _NOEXCEPT {return __sbuf_ == 0;}
|
||||||
|
|
||||||
|
template <class _Ch, class _Tr>
|
||||||
|
friend
|
||||||
|
_LIBCPP_HIDDEN
|
||||||
|
ostreambuf_iterator<_Ch, _Tr>
|
||||||
|
__pad_and_output(ostreambuf_iterator<_Ch, _Tr> __s,
|
||||||
|
const _Ch* __ob, const _Ch* __op, const _Ch* __oe,
|
||||||
|
ios_base& __iob, _Ch __fl);
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Iter>
|
template <class _Iter>
|
||||||
@ -1009,43 +1017,52 @@ make_move_iterator(const _Iter& __i)
|
|||||||
template <class _Iter> class __wrap_iter;
|
template <class _Iter> class __wrap_iter;
|
||||||
|
|
||||||
template <class _Iter1, class _Iter2>
|
template <class _Iter1, class _Iter2>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool
|
bool
|
||||||
operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||||
|
|
||||||
template <class _Iter1, class _Iter2>
|
template <class _Iter1, class _Iter2>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool
|
bool
|
||||||
operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||||
|
|
||||||
template <class _Iter1, class _Iter2>
|
template <class _Iter1, class _Iter2>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool
|
bool
|
||||||
operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||||
|
|
||||||
template <class _Iter1, class _Iter2>
|
template <class _Iter1, class _Iter2>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool
|
bool
|
||||||
operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||||
|
|
||||||
template <class _Iter1, class _Iter2>
|
template <class _Iter1, class _Iter2>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool
|
bool
|
||||||
operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||||
|
|
||||||
template <class _Iter1, class _Iter2>
|
template <class _Iter1, class _Iter2>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool
|
bool
|
||||||
operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
operator<=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||||
|
|
||||||
template <class _Iter1, class _Iter2>
|
template <class _Iter1, class _Iter2>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
typename __wrap_iter<_Iter1>::difference_type
|
typename __wrap_iter<_Iter1>::difference_type
|
||||||
operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
operator-(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
|
||||||
|
|
||||||
template <class _Iter>
|
template <class _Iter>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
__wrap_iter<_Iter>
|
__wrap_iter<_Iter>
|
||||||
operator+(typename __wrap_iter<_Iter>::difference_type, __wrap_iter<_Iter>) _NOEXCEPT;
|
operator+(typename __wrap_iter<_Iter>::difference_type, __wrap_iter<_Iter>) _NOEXCEPT;
|
||||||
|
|
||||||
template <class _Ip, class _Op> _Op copy(_Ip, _Ip, _Op);
|
template <class _Ip, class _Op> _Op _LIBCPP_INLINE_VISIBILITY copy(_Ip, _Ip, _Op);
|
||||||
template <class _B1, class _B2> _B2 copy_backward(_B1, _B1, _B2);
|
template <class _B1, class _B2> _B2 _LIBCPP_INLINE_VISIBILITY copy_backward(_B1, _B1, _B2);
|
||||||
template <class _Ip, class _Op> _Op move(_Ip, _Ip, _Op);
|
template <class _Ip, class _Op> _Op _LIBCPP_INLINE_VISIBILITY move(_Ip, _Ip, _Op);
|
||||||
template <class _B1, class _B2> _B2 move_backward(_B1, _B1, _B2);
|
template <class _B1, class _B2> _B2 _LIBCPP_INLINE_VISIBILITY move_backward(_B1, _B1, _B2);
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
typename enable_if
|
typename enable_if
|
||||||
<
|
<
|
||||||
is_trivially_copy_assignable<_Tp>::value,
|
is_trivially_copy_assignable<_Tp>::value,
|
||||||
@ -1284,6 +1301,38 @@ operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEX
|
|||||||
return !(__y < __x);
|
return !(__y < __x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <class _Iter1>
|
||||||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
bool
|
||||||
|
operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
|
||||||
|
{
|
||||||
|
return !(__x == __y);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class _Iter1>
|
||||||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
bool
|
||||||
|
operator>(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
|
||||||
|
{
|
||||||
|
return __y < __x;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class _Iter1>
|
||||||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
bool
|
||||||
|
operator>=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
|
||||||
|
{
|
||||||
|
return !(__x < __y);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class _Iter1>
|
||||||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
bool
|
||||||
|
operator<=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
|
||||||
|
{
|
||||||
|
return !(__y < __x);
|
||||||
|
}
|
||||||
|
|
||||||
template <class _Iter1, class _Iter2>
|
template <class _Iter1, class _Iter2>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
typename __wrap_iter<_Iter1>::difference_type
|
typename __wrap_iter<_Iter1>::difference_type
|
||||||
@ -1313,34 +1362,42 @@ operator+(typename __wrap_iter<_Iter>::difference_type __n,
|
|||||||
template <class _Container, class _Iter> class __debug_iter;
|
template <class _Container, class _Iter> class __debug_iter;
|
||||||
|
|
||||||
template <class _Container, class _Iter1, class _Iter2>
|
template <class _Container, class _Iter1, class _Iter2>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool
|
bool
|
||||||
operator==(const __debug_iter<_Container, _Iter1>&, const __debug_iter<_Container, _Iter2>&);
|
operator==(const __debug_iter<_Container, _Iter1>&, const __debug_iter<_Container, _Iter2>&);
|
||||||
|
|
||||||
template <class _Container, class _Iter1, class _Iter2>
|
template <class _Container, class _Iter1, class _Iter2>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool
|
bool
|
||||||
operator<(const __debug_iter<_Container, _Iter1>&, const __debug_iter<_Container, _Iter2>&);
|
operator<(const __debug_iter<_Container, _Iter1>&, const __debug_iter<_Container, _Iter2>&);
|
||||||
|
|
||||||
template <class _Container, class _Iter1, class _Iter2>
|
template <class _Container, class _Iter1, class _Iter2>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool
|
bool
|
||||||
operator!=(const __debug_iter<_Container, _Iter1>&, const __debug_iter<_Container, _Iter2>&);
|
operator!=(const __debug_iter<_Container, _Iter1>&, const __debug_iter<_Container, _Iter2>&);
|
||||||
|
|
||||||
template <class _Container, class _Iter1, class _Iter2>
|
template <class _Container, class _Iter1, class _Iter2>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool
|
bool
|
||||||
operator>(const __debug_iter<_Container, _Iter1>&, const __debug_iter<_Container, _Iter2>&);
|
operator>(const __debug_iter<_Container, _Iter1>&, const __debug_iter<_Container, _Iter2>&);
|
||||||
|
|
||||||
template <class _Container, class _Iter1, class _Iter2>
|
template <class _Container, class _Iter1, class _Iter2>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool
|
bool
|
||||||
operator>=(const __debug_iter<_Container, _Iter1>&, const __debug_iter<_Container, _Iter2>&);
|
operator>=(const __debug_iter<_Container, _Iter1>&, const __debug_iter<_Container, _Iter2>&);
|
||||||
|
|
||||||
template <class _Container, class _Iter1, class _Iter2>
|
template <class _Container, class _Iter1, class _Iter2>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool
|
bool
|
||||||
operator<=(const __debug_iter<_Container, _Iter1>&, const __debug_iter<_Container, _Iter2>&);
|
operator<=(const __debug_iter<_Container, _Iter1>&, const __debug_iter<_Container, _Iter2>&);
|
||||||
|
|
||||||
template <class _Container, class _Iter1, class _Iter2>
|
template <class _Container, class _Iter1, class _Iter2>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
typename __debug_iter<_Container, _Iter1>::difference_type
|
typename __debug_iter<_Container, _Iter1>::difference_type
|
||||||
operator-(const __debug_iter<_Container, _Iter1>&, const __debug_iter<_Container, _Iter2>&);
|
operator-(const __debug_iter<_Container, _Iter1>&, const __debug_iter<_Container, _Iter2>&);
|
||||||
|
|
||||||
template <class _Container, class _Iter>
|
template <class _Container, class _Iter>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
__debug_iter<_Container, _Iter>
|
__debug_iter<_Container, _Iter>
|
||||||
operator+(typename __debug_iter<_Container, _Iter>::difference_type, const __debug_iter<_Container, _Iter>&);
|
operator+(typename __debug_iter<_Container, _Iter>::difference_type, const __debug_iter<_Container, _Iter>&);
|
||||||
|
|
||||||
|
@ -213,9 +213,9 @@ struct __list_node
|
|||||||
_Tp __value_;
|
_Tp __value_;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp, class _Alloc> class list;
|
template <class _Tp, class _Alloc> class _LIBCPP_VISIBLE list;
|
||||||
template <class _Tp, class _Alloc> class __list_imp;
|
template <class _Tp, class _Alloc> class __list_imp;
|
||||||
template <class _Tp, class _VoidPtr> class __list_const_iterator;
|
template <class _Tp, class _VoidPtr> class _LIBCPP_VISIBLE __list_const_iterator;
|
||||||
|
|
||||||
template <class _Tp, class _VoidPtr>
|
template <class _Tp, class _VoidPtr>
|
||||||
class _LIBCPP_VISIBLE __list_iterator
|
class _LIBCPP_VISIBLE __list_iterator
|
||||||
|
@ -1587,6 +1587,52 @@ __pad_and_output(_OutputIterator __s,
|
|||||||
return __s;
|
return __s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <class _CharT, class _Traits>
|
||||||
|
_LIBCPP_HIDDEN
|
||||||
|
ostreambuf_iterator<_CharT, _Traits>
|
||||||
|
__pad_and_output(ostreambuf_iterator<_CharT, _Traits> __s,
|
||||||
|
const _CharT* __ob, const _CharT* __op, const _CharT* __oe,
|
||||||
|
ios_base& __iob, _CharT __fl)
|
||||||
|
{
|
||||||
|
if (__s.__sbuf_ == nullptr)
|
||||||
|
return __s;
|
||||||
|
streamsize __sz = __oe - __ob;
|
||||||
|
streamsize __ns = __iob.width();
|
||||||
|
if (__ns > __sz)
|
||||||
|
__ns -= __sz;
|
||||||
|
else
|
||||||
|
__ns = 0;
|
||||||
|
streamsize __np = __op - __ob;
|
||||||
|
if (__np > 0)
|
||||||
|
{
|
||||||
|
if (__s.__sbuf_->sputn(__ob, __np) != __np)
|
||||||
|
{
|
||||||
|
__s.__sbuf_ = nullptr;
|
||||||
|
return __s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (__ns > 0)
|
||||||
|
{
|
||||||
|
basic_string<_CharT, _Traits> __sp(__ns, __fl);
|
||||||
|
if (__s.__sbuf_->sputn(__sp.data(), __ns) != __ns)
|
||||||
|
{
|
||||||
|
__s.__sbuf_ = nullptr;
|
||||||
|
return __s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
__np = __oe - __op;
|
||||||
|
if (__np > 0)
|
||||||
|
{
|
||||||
|
if (__s.__sbuf_->sputn(__op, __np) != __np)
|
||||||
|
{
|
||||||
|
__s.__sbuf_ = nullptr;
|
||||||
|
return __s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
__iob.width(0);
|
||||||
|
return __s;
|
||||||
|
}
|
||||||
|
|
||||||
template <class _CharT, class _OutputIterator>
|
template <class _CharT, class _OutputIterator>
|
||||||
_OutputIterator
|
_OutputIterator
|
||||||
num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
|
num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
|
||||||
@ -3920,7 +3966,8 @@ wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
|
|||||||
if (__cvtptr_ != nullptr)
|
if (__cvtptr_ != nullptr)
|
||||||
{
|
{
|
||||||
wide_string __ws(2*(__frm_end - __frm), _Elem());
|
wide_string __ws(2*(__frm_end - __frm), _Elem());
|
||||||
__ws.resize(__ws.capacity());
|
if (__frm != __frm_end)
|
||||||
|
__ws.resize(__ws.capacity());
|
||||||
codecvt_base::result __r = codecvt_base::ok;
|
codecvt_base::result __r = codecvt_base::ok;
|
||||||
state_type __st = __cvtstate_;
|
state_type __st = __cvtstate_;
|
||||||
if (__frm != __frm_end)
|
if (__frm != __frm_end)
|
||||||
@ -3980,7 +4027,8 @@ wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
|
|||||||
if (__cvtptr_ != nullptr)
|
if (__cvtptr_ != nullptr)
|
||||||
{
|
{
|
||||||
byte_string __bs(2*(__frm_end - __frm), char());
|
byte_string __bs(2*(__frm_end - __frm), char());
|
||||||
__bs.resize(__bs.capacity());
|
if (__frm != __frm_end)
|
||||||
|
__bs.resize(__bs.capacity());
|
||||||
codecvt_base::result __r = codecvt_base::ok;
|
codecvt_base::result __r = codecvt_base::ok;
|
||||||
state_type __st = __cvtstate_;
|
state_type __st = __cvtstate_;
|
||||||
if (__frm != __frm_end)
|
if (__frm != __frm_end)
|
||||||
|
@ -880,45 +880,15 @@ public:
|
|||||||
value_compare value_comp() const {return value_compare(__tree_.value_comp().key_comp());}
|
value_compare value_comp() const {return value_compare(__tree_.value_comp().key_comp());}
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
|
||||||
pair<iterator, bool>
|
|
||||||
emplace() {return __tree_.__emplace_unique();}
|
|
||||||
|
|
||||||
template <class _A0,
|
|
||||||
class = typename enable_if<is_constructible<value_type, _A0>::value>::type>
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
|
||||||
pair<iterator, bool>
|
|
||||||
emplace(_A0&& __a0)
|
|
||||||
{return __tree_.__emplace_unique(_VSTD::forward<_A0>(__a0));}
|
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
template <class _A0, class ..._Args,
|
template <class ..._Args>
|
||||||
class = typename enable_if<is_constructible<key_type, _A0>::value>::type>
|
|
||||||
pair<iterator, bool>
|
pair<iterator, bool>
|
||||||
emplace(_A0&& __a0, _Args&& ...__args);
|
emplace(_Args&& ...__args);
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
template <class ..._Args>
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
|
||||||
iterator
|
|
||||||
emplace_hint(const_iterator __p)
|
|
||||||
{return __tree_.__emplace_hint_unique(__p.__i_);}
|
|
||||||
|
|
||||||
template <class _A0,
|
|
||||||
class = typename enable_if<is_constructible<value_type, _A0>::value>::type>
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
|
||||||
iterator
|
iterator
|
||||||
emplace_hint(const_iterator __p, _A0&& __a0)
|
emplace_hint(const_iterator __p, _Args&& ...__args);
|
||||||
{return __tree_.__emplace_hint_unique(__p.__i_, _VSTD::forward<_A0>(__a0));}
|
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
|
||||||
|
|
||||||
template <class _A0, class ..._Args,
|
|
||||||
class = typename enable_if<is_constructible<key_type, _A0>::value>::type>
|
|
||||||
iterator
|
|
||||||
emplace_hint(const_iterator __p, _A0&& __a0, _Args&& ...__args);
|
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
@ -1015,13 +985,23 @@ private:
|
|||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
__node_holder __construct_node();
|
__node_holder __construct_node();
|
||||||
template <class _A0,
|
template <class _A0>
|
||||||
class = typename enable_if<is_constructible<value_type, _A0>::value>::type>
|
typename enable_if
|
||||||
__node_holder __construct_node(_A0&& __a0);
|
<
|
||||||
|
is_constructible<value_type, _A0>::value,
|
||||||
|
__node_holder
|
||||||
|
>::type
|
||||||
|
__construct_node(_A0&& __a0);
|
||||||
|
template <class _A0>
|
||||||
|
typename enable_if
|
||||||
|
<
|
||||||
|
is_constructible<key_type, _A0>::value,
|
||||||
|
__node_holder
|
||||||
|
>::type
|
||||||
|
__construct_node(_A0&& __a0);
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||||
template <class _A0, class ..._Args,
|
template <class _A0, class _A1, class ..._Args>
|
||||||
class = typename enable_if<is_constructible<key_type, _A0>::value>::type>
|
__node_holder __construct_node(_A0&& __a0, _A1&& __a1, _Args&& ...__args);
|
||||||
__node_holder __construct_node(_A0&& __a0, _Args&& ...__args);
|
|
||||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
__node_holder __construct_node(const key_type& __k);
|
__node_holder __construct_node(const key_type& __k);
|
||||||
@ -1215,9 +1195,12 @@ map<_Key, _Tp, _Compare, _Allocator>::__construct_node()
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
||||||
template <class _A0,
|
template <class _A0>
|
||||||
class>
|
typename enable_if
|
||||||
typename map<_Key, _Tp, _Compare, _Allocator>::__node_holder
|
<
|
||||||
|
is_constructible<pair<const _Key, _Tp>, _A0>::value,
|
||||||
|
typename map<_Key, _Tp, _Compare, _Allocator>::__node_holder
|
||||||
|
>::type
|
||||||
map<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0)
|
map<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0)
|
||||||
{
|
{
|
||||||
__node_allocator& __na = __tree_.__node_alloc();
|
__node_allocator& __na = __tree_.__node_alloc();
|
||||||
@ -1228,19 +1211,37 @@ map<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0)
|
|||||||
return __h;
|
return __h;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
|
||||||
|
|
||||||
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
||||||
template <class _A0, class ..._Args,
|
template <class _A0>
|
||||||
class>
|
typename enable_if
|
||||||
typename map<_Key, _Tp, _Compare, _Allocator>::__node_holder
|
<
|
||||||
map<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0, _Args&& ...__args)
|
is_constructible<_Key, _A0>::value,
|
||||||
|
typename map<_Key, _Tp, _Compare, _Allocator>::__node_holder
|
||||||
|
>::type
|
||||||
|
map<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0)
|
||||||
{
|
{
|
||||||
__node_allocator& __na = __tree_.__node_alloc();
|
__node_allocator& __na = __tree_.__node_alloc();
|
||||||
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
|
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
|
||||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), _VSTD::forward<_A0>(__a0));
|
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), _VSTD::forward<_A0>(__a0));
|
||||||
__h.get_deleter().__first_constructed = true;
|
__h.get_deleter().__first_constructed = true;
|
||||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second), _VSTD::forward<_Args>(__args)...);
|
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
|
||||||
|
__h.get_deleter().__second_constructed = true;
|
||||||
|
return __h;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
|
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
||||||
|
template <class _A0, class _A1, class ..._Args>
|
||||||
|
typename map<_Key, _Tp, _Compare, _Allocator>::__node_holder
|
||||||
|
map<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0, _A1&& __a1, _Args&& ...__args)
|
||||||
|
{
|
||||||
|
__node_allocator& __na = __tree_.__node_alloc();
|
||||||
|
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
|
||||||
|
__node_traits::construct(__na, _VSTD::addressof(__h->__value_),
|
||||||
|
_VSTD::forward<_A0>(__a0), _VSTD::forward<_A1>(__a1),
|
||||||
|
_VSTD::forward<_Args>(__args)...);
|
||||||
|
__h.get_deleter().__first_constructed = true;
|
||||||
__h.get_deleter().__second_constructed = true;
|
__h.get_deleter().__second_constructed = true;
|
||||||
return __h;
|
return __h;
|
||||||
}
|
}
|
||||||
@ -1329,14 +1330,11 @@ map<_Key, _Tp, _Compare, _Allocator>::at(const key_type& __k) const
|
|||||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||||
|
|
||||||
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
||||||
template <class _A0, class ..._Args,
|
template <class ..._Args>
|
||||||
class //= typename enable_if<is_constructible<_Key, _A0>::value>::type
|
|
||||||
>
|
|
||||||
pair<typename map<_Key, _Tp, _Compare, _Allocator>::iterator, bool>
|
pair<typename map<_Key, _Tp, _Compare, _Allocator>::iterator, bool>
|
||||||
map<_Key, _Tp, _Compare, _Allocator>::emplace(_A0&& __a0, _Args&& ...__args)
|
map<_Key, _Tp, _Compare, _Allocator>::emplace(_Args&& ...__args)
|
||||||
{
|
{
|
||||||
__node_holder __h = __construct_node(_VSTD::forward<_A0>(__a0),
|
__node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
|
||||||
_VSTD::forward<_Args>(__args)...);
|
|
||||||
pair<iterator, bool> __r = __tree_.__node_insert_unique(__h.get());
|
pair<iterator, bool> __r = __tree_.__node_insert_unique(__h.get());
|
||||||
if (__r.second)
|
if (__r.second)
|
||||||
__h.release();
|
__h.release();
|
||||||
@ -1344,15 +1342,12 @@ map<_Key, _Tp, _Compare, _Allocator>::emplace(_A0&& __a0, _Args&& ...__args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
||||||
template <class _A0, class ..._Args,
|
template <class ..._Args>
|
||||||
class //= typename enable_if<is_constructible<_Key, _A0>::value>::type
|
|
||||||
>
|
|
||||||
typename map<_Key, _Tp, _Compare, _Allocator>::iterator
|
typename map<_Key, _Tp, _Compare, _Allocator>::iterator
|
||||||
map<_Key, _Tp, _Compare, _Allocator>::emplace_hint(const_iterator __p,
|
map<_Key, _Tp, _Compare, _Allocator>::emplace_hint(const_iterator __p,
|
||||||
_A0&& __a0, _Args&& ...__args)
|
_Args&& ...__args)
|
||||||
{
|
{
|
||||||
__node_holder __h = __construct_node(_VSTD::forward<_A0>(__a0),
|
__node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
|
||||||
_VSTD::forward<_Args>(__args)...);
|
|
||||||
iterator __r = __tree_.__node_insert_unique(__p.__i_, __h.get());
|
iterator __r = __tree_.__node_insert_unique(__p.__i_, __h.get());
|
||||||
if (__r.__i_.__ptr_ == __h.get())
|
if (__r.__i_.__ptr_ == __h.get())
|
||||||
__h.release();
|
__h.release();
|
||||||
@ -1629,43 +1624,15 @@ public:
|
|||||||
{return value_compare(__tree_.value_comp().key_comp());}
|
{return value_compare(__tree_.value_comp().key_comp());}
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
|
||||||
iterator emplace() {return __tree_.__emplace_multi();}
|
|
||||||
|
|
||||||
template <class _A0,
|
|
||||||
class = typename enable_if<is_constructible<value_type, _A0>::value>::type>
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
|
||||||
iterator
|
|
||||||
emplace(_A0&& __a0)
|
|
||||||
{return __tree_.__emplace_multi(_VSTD::forward<_A0>(__a0));}
|
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
template <class _A0, class ..._Args,
|
template <class ..._Args>
|
||||||
class = typename enable_if<is_constructible<key_type, _A0>::value>::type>
|
|
||||||
iterator
|
iterator
|
||||||
emplace(_A0&& __a0, _Args&& ...__args);
|
emplace(_Args&& ...__args);
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
template <class ..._Args>
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
|
||||||
iterator emplace_hint(const_iterator __p)
|
|
||||||
{return __tree_.__emplace_hint_multi(__p.__i_);}
|
|
||||||
|
|
||||||
template <class _A0,
|
|
||||||
class = typename enable_if<is_constructible<value_type, _A0>::value>::type>
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
|
||||||
iterator
|
iterator
|
||||||
emplace_hint(const_iterator __p, _A0&& __a0)
|
emplace_hint(const_iterator __p, _Args&& ...__args);
|
||||||
{return __tree_.__emplace_hint_multi(__p.__i_, _VSTD::forward<_A0>(__a0));}
|
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
|
||||||
|
|
||||||
template <class _A0, class ..._Args,
|
|
||||||
class = typename enable_if<is_constructible<key_type, _A0>::value>::type>
|
|
||||||
iterator
|
|
||||||
emplace_hint(const_iterator __p, _A0&& __a0, _Args&& ...__args);
|
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
@ -1757,13 +1724,23 @@ private:
|
|||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
__node_holder __construct_node();
|
__node_holder __construct_node();
|
||||||
template <class _A0,
|
template <class _A0>
|
||||||
class = typename enable_if<is_constructible<value_type, _A0>::value>::type>
|
typename enable_if
|
||||||
__node_holder __construct_node(_A0&& __a0);
|
<
|
||||||
|
is_constructible<value_type, _A0>::value,
|
||||||
|
__node_holder
|
||||||
|
>::type
|
||||||
|
__construct_node(_A0&& __a0);
|
||||||
|
template <class _A0>
|
||||||
|
typename enable_if
|
||||||
|
<
|
||||||
|
is_constructible<key_type, _A0>::value,
|
||||||
|
__node_holder
|
||||||
|
>::type
|
||||||
|
__construct_node(_A0&& __a0);
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||||
template <class _A0, class ..._Args,
|
template <class _A0, class _A1, class ..._Args>
|
||||||
class = typename enable_if<is_constructible<key_type, _A0>::value>::type>
|
__node_holder __construct_node(_A0&& __a0, _A1&& __a1, _Args&& ...__args);
|
||||||
__node_holder __construct_node(_A0&& __a0, _Args&& ...__args);
|
|
||||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
};
|
};
|
||||||
@ -1797,10 +1774,12 @@ multimap<_Key, _Tp, _Compare, _Allocator>::__construct_node()
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
||||||
template <class _A0,
|
template <class _A0>
|
||||||
class // = typename enable_if<is_constructible<value_type, _A0>::value>::type
|
typename enable_if
|
||||||
>
|
<
|
||||||
typename multimap<_Key, _Tp, _Compare, _Allocator>::__node_holder
|
is_constructible<pair<const _Key, _Tp>, _A0>::value,
|
||||||
|
typename multimap<_Key, _Tp, _Compare, _Allocator>::__node_holder
|
||||||
|
>::type
|
||||||
multimap<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0)
|
multimap<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0)
|
||||||
{
|
{
|
||||||
__node_allocator& __na = __tree_.__node_alloc();
|
__node_allocator& __na = __tree_.__node_alloc();
|
||||||
@ -1811,20 +1790,37 @@ multimap<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0)
|
|||||||
return __h;
|
return __h;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
|
||||||
|
|
||||||
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
||||||
template <class _A0, class ..._Args,
|
template <class _A0>
|
||||||
class // = typename enable_if<is_constructible<key_type, _A0>::value>::type
|
typename enable_if
|
||||||
>
|
<
|
||||||
typename multimap<_Key, _Tp, _Compare, _Allocator>::__node_holder
|
is_constructible<_Key, _A0>::value,
|
||||||
multimap<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0, _Args&& ...__args)
|
typename multimap<_Key, _Tp, _Compare, _Allocator>::__node_holder
|
||||||
|
>::type
|
||||||
|
multimap<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0)
|
||||||
{
|
{
|
||||||
__node_allocator& __na = __tree_.__node_alloc();
|
__node_allocator& __na = __tree_.__node_alloc();
|
||||||
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
|
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
|
||||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), _VSTD::forward<_A0>(__a0));
|
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.first), _VSTD::forward<_A0>(__a0));
|
||||||
__h.get_deleter().__first_constructed = true;
|
__h.get_deleter().__first_constructed = true;
|
||||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second), _VSTD::forward<_Args>(__args)...);
|
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
|
||||||
|
__h.get_deleter().__second_constructed = true;
|
||||||
|
return __h;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
|
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
||||||
|
template <class _A0, class _A1, class ..._Args>
|
||||||
|
typename multimap<_Key, _Tp, _Compare, _Allocator>::__node_holder
|
||||||
|
multimap<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0, _A1&& __a1, _Args&& ...__args)
|
||||||
|
{
|
||||||
|
__node_allocator& __na = __tree_.__node_alloc();
|
||||||
|
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
|
||||||
|
__node_traits::construct(__na, _VSTD::addressof(__h->__value_),
|
||||||
|
_VSTD::forward<_A0>(__a0), _VSTD::forward<_A1>(__a1),
|
||||||
|
_VSTD::forward<_Args>(__args)...);
|
||||||
|
__h.get_deleter().__first_constructed = true;
|
||||||
__h.get_deleter().__second_constructed = true;
|
__h.get_deleter().__second_constructed = true;
|
||||||
return __h;
|
return __h;
|
||||||
}
|
}
|
||||||
@ -1835,30 +1831,23 @@ multimap<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0, _Args&&
|
|||||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||||
|
|
||||||
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
||||||
template <class _A0, class ..._Args,
|
template <class ..._Args>
|
||||||
class //= typename enable_if<is_constructible<_Key, _A0>::value>::type
|
|
||||||
>
|
|
||||||
typename multimap<_Key, _Tp, _Compare, _Allocator>::iterator
|
typename multimap<_Key, _Tp, _Compare, _Allocator>::iterator
|
||||||
multimap<_Key, _Tp, _Compare, _Allocator>::emplace(_A0&& __a0, _Args&& ...__args)
|
multimap<_Key, _Tp, _Compare, _Allocator>::emplace(_Args&& ...__args)
|
||||||
{
|
{
|
||||||
__node_holder __h = __construct_node(_VSTD::forward<_A0>(__a0),
|
__node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
|
||||||
_VSTD::forward<_Args>(__args)...);
|
|
||||||
iterator __r = __tree_.__node_insert_multi(__h.get());
|
iterator __r = __tree_.__node_insert_multi(__h.get());
|
||||||
__h.release();
|
__h.release();
|
||||||
return __r;
|
return __r;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
template <class _Key, class _Tp, class _Compare, class _Allocator>
|
||||||
template <class _A0, class ..._Args,
|
template <class ..._Args>
|
||||||
class //= typename enable_if<is_constructible<_Key, _A0>::value>::type
|
|
||||||
>
|
|
||||||
typename multimap<_Key, _Tp, _Compare, _Allocator>::iterator
|
typename multimap<_Key, _Tp, _Compare, _Allocator>::iterator
|
||||||
multimap<_Key, _Tp, _Compare, _Allocator>::emplace_hint(const_iterator __p,
|
multimap<_Key, _Tp, _Compare, _Allocator>::emplace_hint(const_iterator __p,
|
||||||
_A0&& __a0,
|
|
||||||
_Args&& ...__args)
|
_Args&& ...__args)
|
||||||
{
|
{
|
||||||
__node_holder __h = __construct_node(_VSTD::forward<_A0>(__a0),
|
__node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
|
||||||
_VSTD::forward<_Args>(__args)...);
|
|
||||||
iterator __r = __tree_.__node_insert_multi(__p.__i_, __h.get());
|
iterator __r = __tree_.__node_insert_multi(__p.__i_, __h.get());
|
||||||
__h.release();
|
__h.release();
|
||||||
return __r;
|
return __r;
|
||||||
|
@ -602,6 +602,10 @@ void* align(size_t alignment, size_t size, void*& ptr, size_t& space);
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if __has_feature(cxx_atomic)
|
||||||
|
# include <atomic>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <__undef_min_max>
|
#include <__undef_min_max>
|
||||||
|
|
||||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||||
@ -2467,7 +2471,11 @@ struct __same_or_less_cv_qualified<_Ptr1, _Ptr2, true>
|
|||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct _LIBCPP_VISIBLE default_delete
|
struct _LIBCPP_VISIBLE default_delete
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY default_delete() _NOEXCEPT {}
|
#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||||
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR default_delete() _NOEXCEPT = default;
|
||||||
|
#else
|
||||||
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR default_delete() _NOEXCEPT {}
|
||||||
|
#endif
|
||||||
template <class _Up>
|
template <class _Up>
|
||||||
_LIBCPP_INLINE_VISIBILITY default_delete(const default_delete<_Up>&,
|
_LIBCPP_INLINE_VISIBILITY default_delete(const default_delete<_Up>&,
|
||||||
typename enable_if<is_convertible<_Up*, _Tp*>::value>::type* = 0) _NOEXCEPT {}
|
typename enable_if<is_convertible<_Up*, _Tp*>::value>::type* = 0) _NOEXCEPT {}
|
||||||
@ -2482,7 +2490,11 @@ template <class _Tp>
|
|||||||
struct _LIBCPP_VISIBLE default_delete<_Tp[]>
|
struct _LIBCPP_VISIBLE default_delete<_Tp[]>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
_LIBCPP_INLINE_VISIBILITY default_delete() _NOEXCEPT {}
|
#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
|
||||||
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR default_delete() _NOEXCEPT = default;
|
||||||
|
#else
|
||||||
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR default_delete() _NOEXCEPT {}
|
||||||
|
#endif
|
||||||
template <class _Up>
|
template <class _Up>
|
||||||
_LIBCPP_INLINE_VISIBILITY default_delete(const default_delete<_Up[]>&,
|
_LIBCPP_INLINE_VISIBILITY default_delete(const default_delete<_Up[]>&,
|
||||||
typename enable_if<__same_or_less_cv_qualified<_Up*, _Tp*>::value>::type* = 0) _NOEXCEPT {}
|
typename enable_if<__same_or_less_cv_qualified<_Up*, _Tp*>::value>::type* = 0) _NOEXCEPT {}
|
||||||
@ -2520,13 +2532,13 @@ private:
|
|||||||
typedef typename remove_reference<deleter_type>::type& _Dp_reference;
|
typedef typename remove_reference<deleter_type>::type& _Dp_reference;
|
||||||
typedef const typename remove_reference<deleter_type>::type& _Dp_const_reference;
|
typedef const typename remove_reference<deleter_type>::type& _Dp_const_reference;
|
||||||
public:
|
public:
|
||||||
_LIBCPP_INLINE_VISIBILITY unique_ptr() _NOEXCEPT
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR unique_ptr() _NOEXCEPT
|
||||||
: __ptr_(pointer())
|
: __ptr_(pointer())
|
||||||
{
|
{
|
||||||
static_assert(!is_pointer<deleter_type>::value,
|
static_assert(!is_pointer<deleter_type>::value,
|
||||||
"unique_ptr constructed with null function pointer deleter");
|
"unique_ptr constructed with null function pointer deleter");
|
||||||
}
|
}
|
||||||
_LIBCPP_INLINE_VISIBILITY unique_ptr(nullptr_t) _NOEXCEPT
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT
|
||||||
: __ptr_(pointer())
|
: __ptr_(pointer())
|
||||||
{
|
{
|
||||||
static_assert(!is_pointer<deleter_type>::value,
|
static_assert(!is_pointer<deleter_type>::value,
|
||||||
@ -2699,13 +2711,13 @@ private:
|
|||||||
typedef typename remove_reference<deleter_type>::type& _Dp_reference;
|
typedef typename remove_reference<deleter_type>::type& _Dp_reference;
|
||||||
typedef const typename remove_reference<deleter_type>::type& _Dp_const_reference;
|
typedef const typename remove_reference<deleter_type>::type& _Dp_const_reference;
|
||||||
public:
|
public:
|
||||||
_LIBCPP_INLINE_VISIBILITY unique_ptr() _NOEXCEPT
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR unique_ptr() _NOEXCEPT
|
||||||
: __ptr_(pointer())
|
: __ptr_(pointer())
|
||||||
{
|
{
|
||||||
static_assert(!is_pointer<deleter_type>::value,
|
static_assert(!is_pointer<deleter_type>::value,
|
||||||
"unique_ptr constructed with null function pointer deleter");
|
"unique_ptr constructed with null function pointer deleter");
|
||||||
}
|
}
|
||||||
_LIBCPP_INLINE_VISIBILITY unique_ptr(nullptr_t) _NOEXCEPT
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT
|
||||||
: __ptr_(pointer())
|
: __ptr_(pointer())
|
||||||
{
|
{
|
||||||
static_assert(!is_pointer<deleter_type>::value,
|
static_assert(!is_pointer<deleter_type>::value,
|
||||||
@ -2955,7 +2967,7 @@ operator>=(const unique_ptr<_T1, _D1>& __x, const unique_ptr<_T2, _D2>& __y) {re
|
|||||||
template <class _T1, class _D1>
|
template <class _T1, class _D1>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
bool
|
bool
|
||||||
operator==(const unique_ptr<_T1, _D1>& __x, nullptr_t)
|
operator==(const unique_ptr<_T1, _D1>& __x, nullptr_t) _NOEXCEPT
|
||||||
{
|
{
|
||||||
return !__x;
|
return !__x;
|
||||||
}
|
}
|
||||||
@ -2963,7 +2975,7 @@ operator==(const unique_ptr<_T1, _D1>& __x, nullptr_t)
|
|||||||
template <class _T1, class _D1>
|
template <class _T1, class _D1>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
bool
|
bool
|
||||||
operator==(nullptr_t, const unique_ptr<_T1, _D1>& __x)
|
operator==(nullptr_t, const unique_ptr<_T1, _D1>& __x) _NOEXCEPT
|
||||||
{
|
{
|
||||||
return !__x;
|
return !__x;
|
||||||
}
|
}
|
||||||
@ -2971,7 +2983,7 @@ operator==(nullptr_t, const unique_ptr<_T1, _D1>& __x)
|
|||||||
template <class _T1, class _D1>
|
template <class _T1, class _D1>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
bool
|
bool
|
||||||
operator!=(const unique_ptr<_T1, _D1>& __x, nullptr_t)
|
operator!=(const unique_ptr<_T1, _D1>& __x, nullptr_t) _NOEXCEPT
|
||||||
{
|
{
|
||||||
return static_cast<bool>(__x);
|
return static_cast<bool>(__x);
|
||||||
}
|
}
|
||||||
@ -2979,7 +2991,7 @@ operator!=(const unique_ptr<_T1, _D1>& __x, nullptr_t)
|
|||||||
template <class _T1, class _D1>
|
template <class _T1, class _D1>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
bool
|
bool
|
||||||
operator!=(nullptr_t, const unique_ptr<_T1, _D1>& __x)
|
operator!=(nullptr_t, const unique_ptr<_T1, _D1>& __x) _NOEXCEPT
|
||||||
{
|
{
|
||||||
return static_cast<bool>(__x);
|
return static_cast<bool>(__x);
|
||||||
}
|
}
|
||||||
@ -3379,8 +3391,19 @@ struct __scalar_hash<_Tp, 4>
|
|||||||
|
|
||||||
template<class _Tp>
|
template<class _Tp>
|
||||||
struct _LIBCPP_VISIBLE hash<_Tp*>
|
struct _LIBCPP_VISIBLE hash<_Tp*>
|
||||||
: public __scalar_hash<_Tp*>
|
: public unary_function<_Tp*, size_t>
|
||||||
{
|
{
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
size_t operator()(_Tp* __v) const _NOEXCEPT
|
||||||
|
{
|
||||||
|
union
|
||||||
|
{
|
||||||
|
_Tp* __t;
|
||||||
|
size_t __a;
|
||||||
|
} __u;
|
||||||
|
__u.__t = __v;
|
||||||
|
return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp, class _Dp>
|
template <class _Tp, class _Dp>
|
||||||
@ -3557,7 +3580,7 @@ public:
|
|||||||
virtual const char* what() const _NOEXCEPT;
|
virtual const char* what() const _NOEXCEPT;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class _Tp> class weak_ptr;
|
template<class _Tp> class _LIBCPP_VISIBLE weak_ptr;
|
||||||
|
|
||||||
class __shared_count
|
class __shared_count
|
||||||
{
|
{
|
||||||
@ -3603,6 +3626,9 @@ public:
|
|||||||
long use_count() const _NOEXCEPT {return __shared_count::use_count();}
|
long use_count() const _NOEXCEPT {return __shared_count::use_count();}
|
||||||
__shared_weak_count* lock() _NOEXCEPT;
|
__shared_weak_count* lock() _NOEXCEPT;
|
||||||
|
|
||||||
|
// purposefully not protected with #ifndef _LIBCPP_NO_RTTI because doing so
|
||||||
|
// breaks ABI for those clients who need to compile their projects with
|
||||||
|
// -fno-rtti and yet link against a libc++.dylib compiled without -fno-rtti.
|
||||||
virtual const void* __get_deleter(const type_info&) const _NOEXCEPT;
|
virtual const void* __get_deleter(const type_info&) const _NOEXCEPT;
|
||||||
private:
|
private:
|
||||||
virtual void __on_zero_shared_weak() _NOEXCEPT = 0;
|
virtual void __on_zero_shared_weak() _NOEXCEPT = 0;
|
||||||
@ -3720,7 +3746,7 @@ __shared_ptr_emplace<_Tp, _Alloc>::__on_zero_shared_weak() _NOEXCEPT
|
|||||||
__a.deallocate(this, 1);
|
__a.deallocate(this, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class _Tp> class enable_shared_from_this;
|
template<class _Tp> class _LIBCPP_VISIBLE enable_shared_from_this;
|
||||||
|
|
||||||
template<class _Tp>
|
template<class _Tp>
|
||||||
class _LIBCPP_VISIBLE shared_ptr
|
class _LIBCPP_VISIBLE shared_ptr
|
||||||
@ -3733,8 +3759,8 @@ private:
|
|||||||
|
|
||||||
struct __nat {int __for_bool_;};
|
struct __nat {int __for_bool_;};
|
||||||
public:
|
public:
|
||||||
shared_ptr() _NOEXCEPT;
|
_LIBCPP_CONSTEXPR shared_ptr() _NOEXCEPT;
|
||||||
shared_ptr(nullptr_t) _NOEXCEPT;
|
_LIBCPP_CONSTEXPR shared_ptr(nullptr_t) _NOEXCEPT;
|
||||||
template<class _Yp,
|
template<class _Yp,
|
||||||
class = typename enable_if
|
class = typename enable_if
|
||||||
<
|
<
|
||||||
@ -3923,6 +3949,10 @@ public:
|
|||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool owner_before(weak_ptr<_Up> const& __p) const
|
bool owner_before(weak_ptr<_Up> const& __p) const
|
||||||
{return __cntrl_ < __p.__cntrl_;}
|
{return __cntrl_ < __p.__cntrl_;}
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
bool
|
||||||
|
__owner_equivalent(const shared_ptr& __p) const
|
||||||
|
{return __cntrl_ == __p.__cntrl_;}
|
||||||
|
|
||||||
#ifndef _LIBCPP_NO_RTTI
|
#ifndef _LIBCPP_NO_RTTI
|
||||||
template <class _Dp>
|
template <class _Dp>
|
||||||
@ -3994,6 +4024,7 @@ private:
|
|||||||
|
|
||||||
template<class _Tp>
|
template<class _Tp>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
shared_ptr<_Tp>::shared_ptr() _NOEXCEPT
|
shared_ptr<_Tp>::shared_ptr() _NOEXCEPT
|
||||||
: __ptr_(0),
|
: __ptr_(0),
|
||||||
__cntrl_(0)
|
__cntrl_(0)
|
||||||
@ -4002,6 +4033,7 @@ shared_ptr<_Tp>::shared_ptr() _NOEXCEPT
|
|||||||
|
|
||||||
template<class _Tp>
|
template<class _Tp>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
shared_ptr<_Tp>::shared_ptr(nullptr_t) _NOEXCEPT
|
shared_ptr<_Tp>::shared_ptr(nullptr_t) _NOEXCEPT
|
||||||
: __ptr_(0),
|
: __ptr_(0),
|
||||||
__cntrl_(0)
|
__cntrl_(0)
|
||||||
@ -4892,7 +4924,7 @@ private:
|
|||||||
__shared_weak_count* __cntrl_;
|
__shared_weak_count* __cntrl_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
weak_ptr() _NOEXCEPT;
|
_LIBCPP_CONSTEXPR weak_ptr() _NOEXCEPT;
|
||||||
template<class _Yp> weak_ptr(shared_ptr<_Yp> const& __r,
|
template<class _Yp> weak_ptr(shared_ptr<_Yp> const& __r,
|
||||||
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type = 0)
|
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type = 0)
|
||||||
_NOEXCEPT;
|
_NOEXCEPT;
|
||||||
@ -4964,6 +4996,7 @@ public:
|
|||||||
|
|
||||||
template<class _Tp>
|
template<class _Tp>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR
|
||||||
weak_ptr<_Tp>::weak_ptr() _NOEXCEPT
|
weak_ptr<_Tp>::weak_ptr() _NOEXCEPT
|
||||||
: __ptr_(0),
|
: __ptr_(0),
|
||||||
__cntrl_(0)
|
__cntrl_(0)
|
||||||
@ -5194,7 +5227,7 @@ class _LIBCPP_VISIBLE enable_shared_from_this
|
|||||||
{
|
{
|
||||||
mutable weak_ptr<_Tp> __weak_this_;
|
mutable weak_ptr<_Tp> __weak_this_;
|
||||||
protected:
|
protected:
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||||
enable_shared_from_this() _NOEXCEPT {}
|
enable_shared_from_this() _NOEXCEPT {}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
enable_shared_from_this(enable_shared_from_this const&) _NOEXCEPT {}
|
enable_shared_from_this(enable_shared_from_this const&) _NOEXCEPT {}
|
||||||
@ -5231,6 +5264,134 @@ inline _LIBCPP_INLINE_VISIBILITY
|
|||||||
basic_ostream<_CharT, _Traits>&
|
basic_ostream<_CharT, _Traits>&
|
||||||
operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p);
|
operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p);
|
||||||
|
|
||||||
|
#if __has_feature(cxx_atomic)
|
||||||
|
|
||||||
|
class __sp_mut
|
||||||
|
{
|
||||||
|
void* _;
|
||||||
|
public:
|
||||||
|
void lock() _NOEXCEPT;
|
||||||
|
void unlock() _NOEXCEPT;
|
||||||
|
|
||||||
|
private:
|
||||||
|
_LIBCPP_CONSTEXPR __sp_mut(void*) _NOEXCEPT;
|
||||||
|
__sp_mut(const __sp_mut&);
|
||||||
|
__sp_mut& operator=(const __sp_mut&);
|
||||||
|
|
||||||
|
friend _LIBCPP_VISIBLE __sp_mut& __get_sp_mut(const void*);
|
||||||
|
};
|
||||||
|
|
||||||
|
_LIBCPP_VISIBLE __sp_mut& __get_sp_mut(const void*);
|
||||||
|
|
||||||
|
template <class _Tp>
|
||||||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
bool
|
||||||
|
atomic_is_lock_free(const shared_ptr<_Tp>*)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class _Tp>
|
||||||
|
shared_ptr<_Tp>
|
||||||
|
atomic_load(const shared_ptr<_Tp>* __p)
|
||||||
|
{
|
||||||
|
__sp_mut& __m = __get_sp_mut(__p);
|
||||||
|
__m.lock();
|
||||||
|
shared_ptr<_Tp> __q = *__p;
|
||||||
|
__m.unlock();
|
||||||
|
return __q;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class _Tp>
|
||||||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
shared_ptr<_Tp>
|
||||||
|
atomic_load_explicit(const shared_ptr<_Tp>* __p, memory_order)
|
||||||
|
{
|
||||||
|
return atomic_load(__p);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class _Tp>
|
||||||
|
void
|
||||||
|
atomic_store(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
|
||||||
|
{
|
||||||
|
__sp_mut& __m = __get_sp_mut(__p);
|
||||||
|
__m.lock();
|
||||||
|
__p->swap(__r);
|
||||||
|
__m.unlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class _Tp>
|
||||||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
void
|
||||||
|
atomic_store_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order)
|
||||||
|
{
|
||||||
|
atomic_store(__p, __r);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class _Tp>
|
||||||
|
shared_ptr<_Tp>
|
||||||
|
atomic_exchange(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
|
||||||
|
{
|
||||||
|
__sp_mut& __m = __get_sp_mut(__p);
|
||||||
|
__m.lock();
|
||||||
|
__p->swap(__r);
|
||||||
|
__m.unlock();
|
||||||
|
return __r;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class _Tp>
|
||||||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
shared_ptr<_Tp>
|
||||||
|
atomic_exchange_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order)
|
||||||
|
{
|
||||||
|
return atomic_exchange(__p, __r);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class _Tp>
|
||||||
|
bool
|
||||||
|
atomic_compare_exchange_strong(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_ptr<_Tp> __w)
|
||||||
|
{
|
||||||
|
__sp_mut& __m = __get_sp_mut(__p);
|
||||||
|
__m.lock();
|
||||||
|
if (__p->__owner_equivalent(*__v))
|
||||||
|
{
|
||||||
|
*__p = __w;
|
||||||
|
__m.unlock();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
*__v = *__p;
|
||||||
|
__m.unlock();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class _Tp>
|
||||||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
bool
|
||||||
|
atomic_compare_exchange_weak(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_ptr<_Tp> __w)
|
||||||
|
{
|
||||||
|
return atomic_compare_exchange_strong(__p, __v, __w);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class _Tp>
|
||||||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
bool
|
||||||
|
atomic_compare_exchange_strong_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v,
|
||||||
|
shared_ptr<_Tp> __w, memory_order, memory_order)
|
||||||
|
{
|
||||||
|
return atomic_compare_exchange_strong(__p, __v, __w);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class _Tp>
|
||||||
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
bool
|
||||||
|
atomic_compare_exchange_weak_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v,
|
||||||
|
shared_ptr<_Tp> __w, memory_order, memory_order)
|
||||||
|
{
|
||||||
|
return atomic_compare_exchange_weak(__p, __v, __w);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // __has_feature(cxx_atomic)
|
||||||
|
|
||||||
//enum class
|
//enum class
|
||||||
struct _LIBCPP_VISIBLE pointer_safety
|
struct _LIBCPP_VISIBLE pointer_safety
|
||||||
{
|
{
|
||||||
|
@ -20,7 +20,7 @@ namespace std
|
|||||||
class mutex
|
class mutex
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
mutex();
|
constexpr mutex() noexcept;
|
||||||
~mutex();
|
~mutex();
|
||||||
|
|
||||||
mutex(const mutex&) = delete;
|
mutex(const mutex&) = delete;
|
||||||
@ -44,7 +44,7 @@ public:
|
|||||||
recursive_mutex& operator=(const recursive_mutex&) = delete;
|
recursive_mutex& operator=(const recursive_mutex&) = delete;
|
||||||
|
|
||||||
void lock();
|
void lock();
|
||||||
bool try_lock();
|
bool try_lock() noexcept;
|
||||||
void unlock();
|
void unlock();
|
||||||
|
|
||||||
typedef pthread_mutex_t* native_handle_type;
|
typedef pthread_mutex_t* native_handle_type;
|
||||||
@ -79,7 +79,7 @@ public:
|
|||||||
recursive_timed_mutex& operator=(const recursive_timed_mutex&) = delete;
|
recursive_timed_mutex& operator=(const recursive_timed_mutex&) = delete;
|
||||||
|
|
||||||
void lock();
|
void lock();
|
||||||
bool try_lock();
|
bool try_lock() noexcept;
|
||||||
template <class Rep, class Period>
|
template <class Rep, class Period>
|
||||||
bool try_lock_for(const chrono::duration<Rep, Period>& rel_time);
|
bool try_lock_for(const chrono::duration<Rep, Period>& rel_time);
|
||||||
template <class Clock, class Duration>
|
template <class Clock, class Duration>
|
||||||
@ -114,9 +114,9 @@ class unique_lock
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef Mutex mutex_type;
|
typedef Mutex mutex_type;
|
||||||
unique_lock();
|
unique_lock() noexcept;
|
||||||
explicit unique_lock(mutex_type& m);
|
explicit unique_lock(mutex_type& m);
|
||||||
unique_lock(mutex_type& m, defer_lock_t);
|
unique_lock(mutex_type& m, defer_lock_t) noexcept;
|
||||||
unique_lock(mutex_type& m, try_to_lock_t);
|
unique_lock(mutex_type& m, try_to_lock_t);
|
||||||
unique_lock(mutex_type& m, adopt_lock_t);
|
unique_lock(mutex_type& m, adopt_lock_t);
|
||||||
template <class Clock, class Duration>
|
template <class Clock, class Duration>
|
||||||
@ -128,8 +128,8 @@ public:
|
|||||||
unique_lock(unique_lock const&) = delete;
|
unique_lock(unique_lock const&) = delete;
|
||||||
unique_lock& operator=(unique_lock const&) = delete;
|
unique_lock& operator=(unique_lock const&) = delete;
|
||||||
|
|
||||||
unique_lock(unique_lock&& u);
|
unique_lock(unique_lock&& u) noexcept;
|
||||||
unique_lock& operator=(unique_lock&& u);
|
unique_lock& operator=(unique_lock&& u) noexcept;
|
||||||
|
|
||||||
void lock();
|
void lock();
|
||||||
bool try_lock();
|
bool try_lock();
|
||||||
@ -141,16 +141,16 @@ public:
|
|||||||
|
|
||||||
void unlock();
|
void unlock();
|
||||||
|
|
||||||
void swap(unique_lock& u);
|
void swap(unique_lock& u) noexcept;
|
||||||
mutex_type* release();
|
mutex_type* release() noexcept;
|
||||||
|
|
||||||
bool owns_lock() const;
|
bool owns_lock() const noexcept;
|
||||||
explicit operator bool () const;
|
explicit operator bool () const noexcept;
|
||||||
mutex_type* mutex() const;
|
mutex_type* mutex() const noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class Mutex>
|
template <class Mutex>
|
||||||
void swap(unique_lock<Mutex>& x, unique_lock<Mutex>& y);
|
void swap(unique_lock<Mutex>& x, unique_lock<Mutex>& y) noexcept;
|
||||||
|
|
||||||
template <class L1, class L2, class... L3>
|
template <class L1, class L2, class... L3>
|
||||||
int try_lock(L1&, L2&, L3&...);
|
int try_lock(L1&, L2&, L3&...);
|
||||||
@ -159,7 +159,7 @@ template <class L1, class L2, class... L3>
|
|||||||
|
|
||||||
struct once_flag
|
struct once_flag
|
||||||
{
|
{
|
||||||
constexpr once_flag();
|
constexpr once_flag() noexcept;
|
||||||
|
|
||||||
once_flag(const once_flag&) = delete;
|
once_flag(const once_flag&) = delete;
|
||||||
once_flag& operator=(const once_flag&) = delete;
|
once_flag& operator=(const once_flag&) = delete;
|
||||||
@ -201,8 +201,8 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
void lock();
|
void lock();
|
||||||
bool try_lock();
|
bool try_lock() _NOEXCEPT;
|
||||||
void unlock();
|
void unlock() _NOEXCEPT;
|
||||||
|
|
||||||
typedef pthread_mutex_t* native_handle_type;
|
typedef pthread_mutex_t* native_handle_type;
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@ -224,14 +224,14 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
void lock();
|
void lock();
|
||||||
bool try_lock();
|
bool try_lock() _NOEXCEPT;
|
||||||
template <class _Rep, class _Period>
|
template <class _Rep, class _Period>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool try_lock_for(const chrono::duration<_Rep, _Period>& __d)
|
bool try_lock_for(const chrono::duration<_Rep, _Period>& __d)
|
||||||
{return try_lock_until(chrono::steady_clock::now() + __d);}
|
{return try_lock_until(chrono::steady_clock::now() + __d);}
|
||||||
template <class _Clock, class _Duration>
|
template <class _Clock, class _Duration>
|
||||||
bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t);
|
bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t);
|
||||||
void unlock();
|
void unlock() _NOEXCEPT;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Clock, class _Duration>
|
template <class _Clock, class _Duration>
|
||||||
@ -267,14 +267,14 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
void lock();
|
void lock();
|
||||||
bool try_lock();
|
bool try_lock() _NOEXCEPT;
|
||||||
template <class _Rep, class _Period>
|
template <class _Rep, class _Period>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool try_lock_for(const chrono::duration<_Rep, _Period>& __d)
|
bool try_lock_for(const chrono::duration<_Rep, _Period>& __d)
|
||||||
{return try_lock_until(chrono::steady_clock::now() + __d);}
|
{return try_lock_until(chrono::steady_clock::now() + __d);}
|
||||||
template <class _Clock, class _Duration>
|
template <class _Clock, class _Duration>
|
||||||
bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t);
|
bool try_lock_until(const chrono::time_point<_Clock, _Duration>& __t);
|
||||||
void unlock();
|
void unlock() _NOEXCEPT;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Clock, class _Duration>
|
template <class _Clock, class _Duration>
|
||||||
@ -425,25 +425,27 @@ lock(_L0& __l0, _L1& __l1, _L2& __l2, _L3& ...__l3)
|
|||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
struct once_flag;
|
struct _LIBCPP_VISIBLE once_flag;
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
template<class _Callable, class... _Args>
|
template<class _Callable, class... _Args>
|
||||||
void call_once(once_flag&, _Callable&&, _Args&&...);
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
void call_once(once_flag&, _Callable&&, _Args&&...);
|
||||||
|
|
||||||
#else // _LIBCPP_HAS_NO_VARIADICS
|
#else // _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
template<class _Callable>
|
template<class _Callable>
|
||||||
void call_once(once_flag&, _Callable);
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
void call_once(once_flag&, _Callable);
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
struct _LIBCPP_VISIBLE once_flag
|
struct _LIBCPP_VISIBLE once_flag
|
||||||
{
|
{
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
// constexpr
|
_LIBCPP_CONSTEXPR
|
||||||
once_flag() {}
|
once_flag() _NOEXCEPT : __state_(0) {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
once_flag(const once_flag&); // = delete;
|
once_flag(const once_flag&); // = delete;
|
||||||
|
@ -96,7 +96,7 @@ _LIBCPP_VISIBLE void* operator new(std::size_t __sz)
|
|||||||
throw(std::bad_alloc)
|
throw(std::bad_alloc)
|
||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
_LIBCPP_VISIBLE void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT;
|
_LIBCPP_VISIBLE void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
|
||||||
_LIBCPP_VISIBLE void operator delete(void* __p) _NOEXCEPT;
|
_LIBCPP_VISIBLE void operator delete(void* __p) _NOEXCEPT;
|
||||||
_LIBCPP_VISIBLE void operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
|
_LIBCPP_VISIBLE void operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ _LIBCPP_VISIBLE void* operator new[](std::size_t __sz)
|
|||||||
throw(std::bad_alloc)
|
throw(std::bad_alloc)
|
||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
_LIBCPP_VISIBLE void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT;
|
_LIBCPP_VISIBLE void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
|
||||||
_LIBCPP_VISIBLE void operator delete[](void* __p) _NOEXCEPT;
|
_LIBCPP_VISIBLE void operator delete[](void* __p) _NOEXCEPT;
|
||||||
_LIBCPP_VISIBLE void operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT;
|
_LIBCPP_VISIBLE void operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT;
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ protected:
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
// 27.7.2.4 Prefix/suffix:
|
// 27.7.2.4 Prefix/suffix:
|
||||||
class sentry;
|
class _LIBCPP_VISIBLE sentry;
|
||||||
|
|
||||||
// 27.7.2.6 Formatted output:
|
// 27.7.2.6 Formatted output:
|
||||||
basic_ostream& operator<<(basic_ostream& (*__pf)(basic_ostream&));
|
basic_ostream& operator<<(basic_ostream& (*__pf)(basic_ostream&));
|
||||||
|
@ -177,13 +177,15 @@ template <class T, class Container, class Compare>
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
template <class _Tp, class _Container> class queue;
|
template <class _Tp, class _Container> class _LIBCPP_VISIBLE queue;
|
||||||
|
|
||||||
template <class _Tp, class _Container>
|
template <class _Tp, class _Container>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool
|
bool
|
||||||
operator==(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y);
|
operator==(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y);
|
||||||
|
|
||||||
template <class _Tp, class _Container>
|
template <class _Tp, class _Container>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool
|
bool
|
||||||
operator< (const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y);
|
operator< (const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y);
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ public:
|
|||||||
void discard(unsigned long long z);
|
void discard(unsigned long long z);
|
||||||
|
|
||||||
// property functions
|
// property functions
|
||||||
const Engine& base() const;
|
const Engine& base() const noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class Engine, size_t p, size_t r>
|
template<class Engine, size_t p, size_t r>
|
||||||
@ -269,7 +269,7 @@ public:
|
|||||||
result_type operator()(); void discard(unsigned long long z);
|
result_type operator()(); void discard(unsigned long long z);
|
||||||
|
|
||||||
// property functions
|
// property functions
|
||||||
const Engine& base() const;
|
const Engine& base() const noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class Engine, size_t w, class UIntType>
|
template<class Engine, size_t w, class UIntType>
|
||||||
@ -323,7 +323,7 @@ public:
|
|||||||
void discard(unsigned long long z);
|
void discard(unsigned long long z);
|
||||||
|
|
||||||
// property functions
|
// property functions
|
||||||
const Engine& base() const;
|
const Engine& base() const noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class Engine, size_t k>
|
template<class Engine, size_t k>
|
||||||
@ -392,7 +392,7 @@ public:
|
|||||||
result_type operator()();
|
result_type operator()();
|
||||||
|
|
||||||
// property functions
|
// property functions
|
||||||
double entropy() const;
|
double entropy() const noexcept;
|
||||||
|
|
||||||
// no copy functions
|
// no copy functions
|
||||||
random_device(const random_device& ) = delete;
|
random_device(const random_device& ) = delete;
|
||||||
@ -1813,10 +1813,11 @@ struct __lce_ta<__a, __c, __m, (unsigned short)(~0), __b>
|
|||||||
};
|
};
|
||||||
|
|
||||||
template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
|
template <class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
|
||||||
class linear_congruential_engine;
|
class _LIBCPP_VISIBLE linear_congruential_engine;
|
||||||
|
|
||||||
template <class _CharT, class _Traits,
|
template <class _CharT, class _Traits,
|
||||||
class _Up, _Up _Ap, _Up _Cp, _Up _Np>
|
class _Up, _Up _Ap, _Up _Cp, _Up _Np>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
basic_ostream<_CharT, _Traits>&
|
basic_ostream<_CharT, _Traits>&
|
||||||
operator<<(basic_ostream<_CharT, _Traits>& __os,
|
operator<<(basic_ostream<_CharT, _Traits>& __os,
|
||||||
const linear_congruential_engine<_Up, _Ap, _Cp, _Np>&);
|
const linear_congruential_engine<_Up, _Ap, _Cp, _Np>&);
|
||||||
@ -2021,7 +2022,7 @@ typedef minstd_rand default_random_engine;
|
|||||||
template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
|
template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
|
||||||
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
|
_UIntType __a, size_t __u, _UIntType __d, size_t __s,
|
||||||
_UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
|
_UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
|
||||||
class mersenne_twister_engine;
|
class _LIBCPP_VISIBLE mersenne_twister_engine;
|
||||||
|
|
||||||
template <class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
|
template <class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
|
||||||
_UI _Ap, size_t _Up, _UI _Dp, size_t _Sp,
|
_UI _Ap, size_t _Up, _UI _Dp, size_t _Sp,
|
||||||
@ -2035,6 +2036,7 @@ operator==(const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp,
|
|||||||
template <class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
|
template <class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
|
||||||
_UI _Ap, size_t _Up, _UI _Dp, size_t _Sp,
|
_UI _Ap, size_t _Up, _UI _Dp, size_t _Sp,
|
||||||
_UI _Bp, size_t _Tp, _UI _Cp, size_t _Lp, _UI _Fp>
|
_UI _Bp, size_t _Tp, _UI _Cp, size_t _Lp, _UI _Fp>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool
|
bool
|
||||||
operator!=(const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
|
operator!=(const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
|
||||||
_Bp, _Tp, _Cp, _Lp, _Fp>& __x,
|
_Bp, _Tp, _Cp, _Lp, _Fp>& __x,
|
||||||
@ -2424,7 +2426,7 @@ typedef mersenne_twister_engine<uint_fast64_t, 64, 312, 156, 31,
|
|||||||
// subtract_with_carry_engine
|
// subtract_with_carry_engine
|
||||||
|
|
||||||
template<class _UIntType, size_t __w, size_t __s, size_t __r>
|
template<class _UIntType, size_t __w, size_t __s, size_t __r>
|
||||||
class subtract_with_carry_engine;
|
class _LIBCPP_VISIBLE subtract_with_carry_engine;
|
||||||
|
|
||||||
template<class _UI, size_t _Wp, size_t _Sp, size_t _Rp>
|
template<class _UI, size_t _Wp, size_t _Sp, size_t _Rp>
|
||||||
bool
|
bool
|
||||||
@ -2433,6 +2435,7 @@ operator==(
|
|||||||
const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __y);
|
const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __y);
|
||||||
|
|
||||||
template<class _UI, size_t _Wp, size_t _Sp, size_t _Rp>
|
template<class _UI, size_t _Wp, size_t _Sp, size_t _Rp>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool
|
bool
|
||||||
operator!=(
|
operator!=(
|
||||||
const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x,
|
const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x,
|
||||||
@ -2788,7 +2791,7 @@ public:
|
|||||||
|
|
||||||
// property functions
|
// property functions
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
const _Engine& base() const {return __e_;}
|
const _Engine& base() const _NOEXCEPT {return __e_;}
|
||||||
|
|
||||||
template<class _Eng, size_t _Pp, size_t _Rp>
|
template<class _Eng, size_t _Pp, size_t _Rp>
|
||||||
friend
|
friend
|
||||||
@ -2993,7 +2996,7 @@ public:
|
|||||||
|
|
||||||
// property functions
|
// property functions
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
const _Engine& base() const {return __e_;}
|
const _Engine& base() const _NOEXCEPT {return __e_;}
|
||||||
|
|
||||||
template<class _Eng, size_t _Wp, class _UI>
|
template<class _Eng, size_t _Wp, class _UI>
|
||||||
friend
|
friend
|
||||||
@ -3222,7 +3225,7 @@ public:
|
|||||||
|
|
||||||
// property functions
|
// property functions
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
const _Engine& base() const {return __e_;}
|
const _Engine& base() const _NOEXCEPT {return __e_;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
template<class _Eng, size_t _Kp>
|
template<class _Eng, size_t _Kp>
|
||||||
@ -3399,7 +3402,7 @@ public:
|
|||||||
result_type operator()();
|
result_type operator()();
|
||||||
|
|
||||||
// property functions
|
// property functions
|
||||||
double entropy() const;
|
double entropy() const _NOEXCEPT;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// no copy functions
|
// no copy functions
|
||||||
|
@ -147,7 +147,7 @@ public:
|
|||||||
explicit basic_regex(const charT* p, flag_type f = regex_constants::ECMAScript);
|
explicit basic_regex(const charT* p, flag_type f = regex_constants::ECMAScript);
|
||||||
basic_regex(const charT* p, size_t len, flag_type f);
|
basic_regex(const charT* p, size_t len, flag_type f);
|
||||||
basic_regex(const basic_regex&);
|
basic_regex(const basic_regex&);
|
||||||
basic_regex(basic_regex&&);
|
basic_regex(basic_regex&&) noexcept;
|
||||||
template <class ST, class SA>
|
template <class ST, class SA>
|
||||||
explicit basic_regex(const basic_string<charT, ST, SA>& p,
|
explicit basic_regex(const basic_string<charT, ST, SA>& p,
|
||||||
flag_type f = regex_constants::ECMAScript);
|
flag_type f = regex_constants::ECMAScript);
|
||||||
@ -159,7 +159,7 @@ public:
|
|||||||
~basic_regex();
|
~basic_regex();
|
||||||
|
|
||||||
basic_regex& operator=(const basic_regex&);
|
basic_regex& operator=(const basic_regex&);
|
||||||
basic_regex& operator=(basic_regex&&);
|
basic_regex& operator=(basic_regex&&) noexcept;
|
||||||
basic_regex& operator=(const charT* ptr);
|
basic_regex& operator=(const charT* ptr);
|
||||||
basic_regex& operator=(initializer_list<charT> il);
|
basic_regex& operator=(initializer_list<charT> il);
|
||||||
template <class ST, class SA>
|
template <class ST, class SA>
|
||||||
@ -167,7 +167,7 @@ public:
|
|||||||
|
|
||||||
// assign:
|
// assign:
|
||||||
basic_regex& assign(const basic_regex& that);
|
basic_regex& assign(const basic_regex& that);
|
||||||
basic_regex& assign(basic_regex&& that);
|
basic_regex& assign(basic_regex&& that) noexcept;
|
||||||
basic_regex& assign(const charT* ptr, flag_type f = regex_constants::ECMAScript);
|
basic_regex& assign(const charT* ptr, flag_type f = regex_constants::ECMAScript);
|
||||||
basic_regex& assign(const charT* p, size_t len, flag_type f);
|
basic_regex& assign(const charT* p, size_t len, flag_type f);
|
||||||
template <class string_traits, class A>
|
template <class string_traits, class A>
|
||||||
@ -449,7 +449,7 @@ public:
|
|||||||
// construct/copy/destroy:
|
// construct/copy/destroy:
|
||||||
explicit match_results(const Allocator& a = Allocator());
|
explicit match_results(const Allocator& a = Allocator());
|
||||||
match_results(const match_results& m);
|
match_results(const match_results& m);
|
||||||
match_results(match_results&& m);
|
match_results(match_results&& m) noexcept;
|
||||||
match_results& operator=(const match_results& m);
|
match_results& operator=(const match_results& m);
|
||||||
match_results& operator=(match_results&& m);
|
match_results& operator=(match_results&& m);
|
||||||
~match_results();
|
~match_results();
|
||||||
@ -760,7 +760,7 @@ enum syntax_option_type
|
|||||||
};
|
};
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
/*constexpr*/
|
_LIBCPP_CONSTEXPR
|
||||||
syntax_option_type
|
syntax_option_type
|
||||||
operator~(syntax_option_type __x)
|
operator~(syntax_option_type __x)
|
||||||
{
|
{
|
||||||
@ -768,7 +768,7 @@ operator~(syntax_option_type __x)
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
/*constexpr*/
|
_LIBCPP_CONSTEXPR
|
||||||
syntax_option_type
|
syntax_option_type
|
||||||
operator&(syntax_option_type __x, syntax_option_type __y)
|
operator&(syntax_option_type __x, syntax_option_type __y)
|
||||||
{
|
{
|
||||||
@ -776,7 +776,7 @@ operator&(syntax_option_type __x, syntax_option_type __y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
/*constexpr*/
|
_LIBCPP_CONSTEXPR
|
||||||
syntax_option_type
|
syntax_option_type
|
||||||
operator|(syntax_option_type __x, syntax_option_type __y)
|
operator|(syntax_option_type __x, syntax_option_type __y)
|
||||||
{
|
{
|
||||||
@ -784,7 +784,7 @@ operator|(syntax_option_type __x, syntax_option_type __y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
/*constexpr*/
|
_LIBCPP_CONSTEXPR
|
||||||
syntax_option_type
|
syntax_option_type
|
||||||
operator^(syntax_option_type __x, syntax_option_type __y)
|
operator^(syntax_option_type __x, syntax_option_type __y)
|
||||||
{
|
{
|
||||||
@ -792,7 +792,6 @@ operator^(syntax_option_type __x, syntax_option_type __y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
/*constexpr*/
|
|
||||||
syntax_option_type&
|
syntax_option_type&
|
||||||
operator&=(syntax_option_type& __x, syntax_option_type __y)
|
operator&=(syntax_option_type& __x, syntax_option_type __y)
|
||||||
{
|
{
|
||||||
@ -801,7 +800,6 @@ operator&=(syntax_option_type& __x, syntax_option_type __y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
/*constexpr*/
|
|
||||||
syntax_option_type&
|
syntax_option_type&
|
||||||
operator|=(syntax_option_type& __x, syntax_option_type __y)
|
operator|=(syntax_option_type& __x, syntax_option_type __y)
|
||||||
{
|
{
|
||||||
@ -810,7 +808,6 @@ operator|=(syntax_option_type& __x, syntax_option_type __y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
/*constexpr*/
|
|
||||||
syntax_option_type&
|
syntax_option_type&
|
||||||
operator^=(syntax_option_type& __x, syntax_option_type __y)
|
operator^=(syntax_option_type& __x, syntax_option_type __y)
|
||||||
{
|
{
|
||||||
@ -839,7 +836,7 @@ enum match_flag_type
|
|||||||
};
|
};
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
/*constexpr*/
|
_LIBCPP_CONSTEXPR
|
||||||
match_flag_type
|
match_flag_type
|
||||||
operator~(match_flag_type __x)
|
operator~(match_flag_type __x)
|
||||||
{
|
{
|
||||||
@ -847,7 +844,7 @@ operator~(match_flag_type __x)
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
/*constexpr*/
|
_LIBCPP_CONSTEXPR
|
||||||
match_flag_type
|
match_flag_type
|
||||||
operator&(match_flag_type __x, match_flag_type __y)
|
operator&(match_flag_type __x, match_flag_type __y)
|
||||||
{
|
{
|
||||||
@ -855,7 +852,7 @@ operator&(match_flag_type __x, match_flag_type __y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
/*constexpr*/
|
_LIBCPP_CONSTEXPR
|
||||||
match_flag_type
|
match_flag_type
|
||||||
operator|(match_flag_type __x, match_flag_type __y)
|
operator|(match_flag_type __x, match_flag_type __y)
|
||||||
{
|
{
|
||||||
@ -863,7 +860,7 @@ operator|(match_flag_type __x, match_flag_type __y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
/*constexpr*/
|
_LIBCPP_CONSTEXPR
|
||||||
match_flag_type
|
match_flag_type
|
||||||
operator^(match_flag_type __x, match_flag_type __y)
|
operator^(match_flag_type __x, match_flag_type __y)
|
||||||
{
|
{
|
||||||
@ -871,7 +868,6 @@ operator^(match_flag_type __x, match_flag_type __y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
/*constexpr*/
|
|
||||||
match_flag_type&
|
match_flag_type&
|
||||||
operator&=(match_flag_type& __x, match_flag_type __y)
|
operator&=(match_flag_type& __x, match_flag_type __y)
|
||||||
{
|
{
|
||||||
@ -880,7 +876,6 @@ operator&=(match_flag_type& __x, match_flag_type __y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
/*constexpr*/
|
|
||||||
match_flag_type&
|
match_flag_type&
|
||||||
operator|=(match_flag_type& __x, match_flag_type __y)
|
operator|=(match_flag_type& __x, match_flag_type __y)
|
||||||
{
|
{
|
||||||
@ -889,7 +884,6 @@ operator|=(match_flag_type& __x, match_flag_type __y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
/*constexpr*/
|
|
||||||
match_flag_type&
|
match_flag_type&
|
||||||
operator^=(match_flag_type& __x, match_flag_type __y)
|
operator^=(match_flag_type& __x, match_flag_type __y)
|
||||||
{
|
{
|
||||||
@ -1237,11 +1231,11 @@ regex_traits<_CharT>::__value(wchar_t __ch, int __radix) const
|
|||||||
|
|
||||||
template <class _CharT> class __node;
|
template <class _CharT> class __node;
|
||||||
|
|
||||||
template <class _BidirectionalIterator> class sub_match;
|
template <class _BidirectionalIterator> class _LIBCPP_VISIBLE sub_match;
|
||||||
|
|
||||||
template <class _BidirectionalIterator,
|
template <class _BidirectionalIterator,
|
||||||
class _Allocator = allocator<sub_match<_BidirectionalIterator> > >
|
class _Allocator = allocator<sub_match<_BidirectionalIterator> > >
|
||||||
class match_results;
|
class _LIBCPP_VISIBLE match_results;
|
||||||
|
|
||||||
template <class _CharT>
|
template <class _CharT>
|
||||||
struct __state
|
struct __state
|
||||||
@ -2439,16 +2433,16 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// constants:
|
// constants:
|
||||||
static const/*expr*/ regex_constants::syntax_option_type icase = regex_constants::icase;
|
static const regex_constants::syntax_option_type icase = regex_constants::icase;
|
||||||
static const/*expr*/ regex_constants::syntax_option_type nosubs = regex_constants::nosubs;
|
static const regex_constants::syntax_option_type nosubs = regex_constants::nosubs;
|
||||||
static const/*expr*/ regex_constants::syntax_option_type optimize = regex_constants::optimize;
|
static const regex_constants::syntax_option_type optimize = regex_constants::optimize;
|
||||||
static const/*expr*/ regex_constants::syntax_option_type collate = regex_constants::collate;
|
static const regex_constants::syntax_option_type collate = regex_constants::collate;
|
||||||
static const/*expr*/ regex_constants::syntax_option_type ECMAScript = regex_constants::ECMAScript;
|
static const regex_constants::syntax_option_type ECMAScript = regex_constants::ECMAScript;
|
||||||
static const/*expr*/ regex_constants::syntax_option_type basic = regex_constants::basic;
|
static const regex_constants::syntax_option_type basic = regex_constants::basic;
|
||||||
static const/*expr*/ regex_constants::syntax_option_type extended = regex_constants::extended;
|
static const regex_constants::syntax_option_type extended = regex_constants::extended;
|
||||||
static const/*expr*/ regex_constants::syntax_option_type awk = regex_constants::awk;
|
static const regex_constants::syntax_option_type awk = regex_constants::awk;
|
||||||
static const/*expr*/ regex_constants::syntax_option_type grep = regex_constants::grep;
|
static const regex_constants::syntax_option_type grep = regex_constants::grep;
|
||||||
static const/*expr*/ regex_constants::syntax_option_type egrep = regex_constants::egrep;
|
static const regex_constants::syntax_option_type egrep = regex_constants::egrep;
|
||||||
|
|
||||||
// construct/copy/destroy:
|
// construct/copy/destroy:
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@ -2512,6 +2506,11 @@ public:
|
|||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
basic_regex& assign(const basic_regex& __that)
|
basic_regex& assign(const basic_regex& __that)
|
||||||
{return *this = __that;}
|
{return *this = __that;}
|
||||||
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
basic_regex& assign(basic_regex&& __that) _NOEXCEPT
|
||||||
|
{return *this = _VSTD::move(__that);}
|
||||||
|
#endif
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
basic_regex& assign(const value_type* __p, flag_type __f = regex_constants::ECMAScript)
|
basic_regex& assign(const value_type* __p, flag_type __f = regex_constants::ECMAScript)
|
||||||
{return assign(__p, __p + __traits_.length(__p), __f);}
|
{return assign(__p, __p + __traits_.length(__p), __f);}
|
||||||
@ -2563,6 +2562,7 @@ public:
|
|||||||
{
|
{
|
||||||
__member_init(__f);
|
__member_init(__f);
|
||||||
__parse(__first, __last);
|
__parse(__first, __last);
|
||||||
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||||
@ -4740,7 +4740,7 @@ public:
|
|||||||
bool matched;
|
bool matched;
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
/*constexpr*/ sub_match() : matched() {}
|
_LIBCPP_CONSTEXPR sub_match() : matched() {}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
difference_type length() const
|
difference_type length() const
|
||||||
|
@ -91,13 +91,15 @@ template <class T, class Container>
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
template <class _Tp, class _Container> class stack;
|
template <class _Tp, class _Container> class _LIBCPP_VISIBLE stack;
|
||||||
|
|
||||||
template <class _Tp, class _Container>
|
template <class _Tp, class _Container>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool
|
bool
|
||||||
operator==(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y);
|
operator==(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y);
|
||||||
|
|
||||||
template <class _Tp, class _Container>
|
template <class _Tp, class _Container>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool
|
bool
|
||||||
operator< (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y);
|
operator< (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y);
|
||||||
|
|
||||||
|
@ -540,7 +540,7 @@ basic_streambuf<_CharT, _Traits>::xsputn(const char_type* __s, streamsize __n)
|
|||||||
{
|
{
|
||||||
if (__nout_ < __eout_)
|
if (__nout_ < __eout_)
|
||||||
*__nout_++ = *__s;
|
*__nout_++ = *__s;
|
||||||
else if (overflow(*__s) == __eof)
|
else if (overflow(traits_type::to_int_type(*__s)) == __eof)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return __i;
|
return __i;
|
||||||
|
@ -51,8 +51,8 @@ struct char_traits
|
|||||||
typedef mbstate_t state_type;
|
typedef mbstate_t state_type;
|
||||||
|
|
||||||
static void assign(char_type& c1, const char_type& c2) noexcept;
|
static void assign(char_type& c1, const char_type& c2) noexcept;
|
||||||
static bool eq(char_type c1, char_type c2) noexcept;
|
static constexpr bool eq(char_type c1, char_type c2) noexcept;
|
||||||
static bool lt(char_type c1, char_type c2) noexcept;
|
static constexpr bool lt(char_type c1, char_type c2) noexcept;
|
||||||
|
|
||||||
static int compare(const char_type* s1, const char_type* s2, size_t n);
|
static int compare(const char_type* s1, const char_type* s2, size_t n);
|
||||||
static size_t length(const char_type* s);
|
static size_t length(const char_type* s);
|
||||||
@ -61,11 +61,11 @@ struct char_traits
|
|||||||
static char_type* copy(char_type* s1, const char_type* s2, size_t n);
|
static char_type* copy(char_type* s1, const char_type* s2, size_t n);
|
||||||
static char_type* assign(char_type* s, size_t n, char_type a);
|
static char_type* assign(char_type* s, size_t n, char_type a);
|
||||||
|
|
||||||
static int_type not_eof(int_type c) noexcept;
|
static constexpr int_type not_eof(int_type c) noexcept;
|
||||||
static char_type to_char_type(int_type c) noexcept;
|
static constexpr char_type to_char_type(int_type c) noexcept;
|
||||||
static int_type to_int_type(char_type c) noexcept;
|
static constexpr int_type to_int_type(char_type c) noexcept;
|
||||||
static bool eq_int_type(int_type c1, int_type c2) noexcept;
|
static constexpr bool eq_int_type(int_type c1, int_type c2) noexcept;
|
||||||
static int_type eof() noexcept;
|
static constexpr int_type eof() noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <> struct char_traits<char>;
|
template <> struct char_traits<char>;
|
||||||
@ -506,10 +506,10 @@ struct _LIBCPP_VISIBLE char_traits
|
|||||||
static void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
|
static void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
|
||||||
{__c1 = __c2;}
|
{__c1 = __c2;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static bool eq(char_type __c1, char_type __c2) _NOEXCEPT
|
static _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
|
||||||
{return __c1 == __c2;}
|
{return __c1 == __c2;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static bool lt(char_type __c1, char_type __c2) _NOEXCEPT
|
static _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
|
||||||
{return __c1 < __c2;}
|
{return __c1 < __c2;}
|
||||||
|
|
||||||
static int compare(const char_type* __s1, const char_type* __s2, size_t __n);
|
static int compare(const char_type* __s1, const char_type* __s2, size_t __n);
|
||||||
@ -519,19 +519,20 @@ struct _LIBCPP_VISIBLE char_traits
|
|||||||
static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n);
|
static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n);
|
||||||
static char_type* assign(char_type* __s, size_t __n, char_type __a);
|
static char_type* assign(char_type* __s, size_t __n, char_type __a);
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY static int_type not_eof(int_type __c) _NOEXCEPT
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
static _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
|
||||||
{return eq_int_type(__c, eof()) ? ~eof() : __c;}
|
{return eq_int_type(__c, eof()) ? ~eof() : __c;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static char_type to_char_type(int_type __c) _NOEXCEPT
|
static _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
|
||||||
{return char_type(__c);}
|
{return char_type(__c);}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static int_type to_int_type(char_type __c) _NOEXCEPT
|
static _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
|
||||||
{return int_type(__c);}
|
{return int_type(__c);}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
|
static _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
|
||||||
{return __c1 == __c2;}
|
{return __c1 == __c2;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static int_type eof() _NOEXCEPT
|
static _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
|
||||||
{return int_type(EOF);}
|
{return int_type(EOF);}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -631,10 +632,10 @@ struct _LIBCPP_VISIBLE char_traits<char>
|
|||||||
static void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
|
static void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
|
||||||
{__c1 = __c2;}
|
{__c1 = __c2;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static bool eq(char_type __c1, char_type __c2) _NOEXCEPT
|
static _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
|
||||||
{return __c1 == __c2;}
|
{return __c1 == __c2;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static bool lt(char_type __c1, char_type __c2) _NOEXCEPT
|
static _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
|
||||||
{return (unsigned char)__c1 < (unsigned char)__c2;}
|
{return (unsigned char)__c1 < (unsigned char)__c2;}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@ -655,19 +656,20 @@ struct _LIBCPP_VISIBLE char_traits<char>
|
|||||||
static char_type* assign(char_type* __s, size_t __n, char_type __a)
|
static char_type* assign(char_type* __s, size_t __n, char_type __a)
|
||||||
{return (char_type*)memset(__s, to_int_type(__a), __n);}
|
{return (char_type*)memset(__s, to_int_type(__a), __n);}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY static int_type not_eof(int_type __c) _NOEXCEPT
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
static _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
|
||||||
{return eq_int_type(__c, eof()) ? ~eof() : __c;}
|
{return eq_int_type(__c, eof()) ? ~eof() : __c;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static char_type to_char_type(int_type __c) _NOEXCEPT
|
static _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
|
||||||
{return char_type(__c);}
|
{return char_type(__c);}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static int_type to_int_type(char_type __c) _NOEXCEPT
|
static _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
|
||||||
{return int_type((unsigned char)__c);}
|
{return int_type((unsigned char)__c);}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
|
static _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
|
||||||
{return __c1 == __c2;}
|
{return __c1 == __c2;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static int_type eof() _NOEXCEPT
|
static _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
|
||||||
{return int_type(EOF);}
|
{return int_type(EOF);}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -686,10 +688,10 @@ struct _LIBCPP_VISIBLE char_traits<wchar_t>
|
|||||||
static void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
|
static void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
|
||||||
{__c1 = __c2;}
|
{__c1 = __c2;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static bool eq(char_type __c1, char_type __c2) _NOEXCEPT
|
static _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
|
||||||
{return __c1 == __c2;}
|
{return __c1 == __c2;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static bool lt(char_type __c1, char_type __c2) _NOEXCEPT
|
static _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
|
||||||
{return __c1 < __c2;}
|
{return __c1 < __c2;}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@ -712,19 +714,19 @@ struct _LIBCPP_VISIBLE char_traits<wchar_t>
|
|||||||
{return (char_type*)wmemset(__s, __a, __n);}
|
{return (char_type*)wmemset(__s, __a, __n);}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static int_type not_eof(int_type __c) _NOEXCEPT
|
static _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
|
||||||
{return eq_int_type(__c, eof()) ? ~eof() : __c;}
|
{return eq_int_type(__c, eof()) ? ~eof() : __c;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static char_type to_char_type(int_type __c) _NOEXCEPT
|
static _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
|
||||||
{return char_type(__c);}
|
{return char_type(__c);}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static int_type to_int_type(char_type __c) _NOEXCEPT
|
static _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
|
||||||
{return int_type(__c);}
|
{return int_type(__c);}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
|
static _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
|
||||||
{return __c1 == __c2;}
|
{return __c1 == __c2;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static int_type eof() _NOEXCEPT
|
static _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
|
||||||
{return int_type(WEOF);}
|
{return int_type(WEOF);}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -743,10 +745,10 @@ struct _LIBCPP_VISIBLE char_traits<char16_t>
|
|||||||
static void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
|
static void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
|
||||||
{__c1 = __c2;}
|
{__c1 = __c2;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static bool eq(char_type __c1, char_type __c2) _NOEXCEPT
|
static _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
|
||||||
{return __c1 == __c2;}
|
{return __c1 == __c2;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static bool lt(char_type __c1, char_type __c2) _NOEXCEPT
|
static _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
|
||||||
{return __c1 < __c2;}
|
{return __c1 < __c2;}
|
||||||
|
|
||||||
static int compare(const char_type* __s1, const char_type* __s2, size_t __n);
|
static int compare(const char_type* __s1, const char_type* __s2, size_t __n);
|
||||||
@ -757,19 +759,19 @@ struct _LIBCPP_VISIBLE char_traits<char16_t>
|
|||||||
static char_type* assign(char_type* __s, size_t __n, char_type __a);
|
static char_type* assign(char_type* __s, size_t __n, char_type __a);
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static int_type not_eof(int_type __c) _NOEXCEPT
|
static _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
|
||||||
{return eq_int_type(__c, eof()) ? ~eof() : __c;}
|
{return eq_int_type(__c, eof()) ? ~eof() : __c;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static char_type to_char_type(int_type __c) _NOEXCEPT
|
static _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
|
||||||
{return char_type(__c);}
|
{return char_type(__c);}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static int_type to_int_type(char_type __c) _NOEXCEPT
|
static _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
|
||||||
{return int_type(__c);}
|
{return int_type(__c);}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
|
static _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
|
||||||
{return __c1 == __c2;}
|
{return __c1 == __c2;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static int_type eof() _NOEXCEPT
|
static _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
|
||||||
{return int_type(0xDFFF);}
|
{return int_type(0xDFFF);}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -863,10 +865,10 @@ struct _LIBCPP_VISIBLE char_traits<char32_t>
|
|||||||
static void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
|
static void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
|
||||||
{__c1 = __c2;}
|
{__c1 = __c2;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static bool eq(char_type __c1, char_type __c2) _NOEXCEPT
|
static _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
|
||||||
{return __c1 == __c2;}
|
{return __c1 == __c2;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static bool lt(char_type __c1, char_type __c2) _NOEXCEPT
|
static _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
|
||||||
{return __c1 < __c2;}
|
{return __c1 < __c2;}
|
||||||
|
|
||||||
static int compare(const char_type* __s1, const char_type* __s2, size_t __n);
|
static int compare(const char_type* __s1, const char_type* __s2, size_t __n);
|
||||||
@ -877,19 +879,19 @@ struct _LIBCPP_VISIBLE char_traits<char32_t>
|
|||||||
static char_type* assign(char_type* __s, size_t __n, char_type __a);
|
static char_type* assign(char_type* __s, size_t __n, char_type __a);
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static int_type not_eof(int_type __c) _NOEXCEPT
|
static _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
|
||||||
{return eq_int_type(__c, eof()) ? ~eof() : __c;}
|
{return eq_int_type(__c, eof()) ? ~eof() : __c;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static char_type to_char_type(int_type __c) _NOEXCEPT
|
static _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
|
||||||
{return char_type(__c);}
|
{return char_type(__c);}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static int_type to_int_type(char_type __c) _NOEXCEPT
|
static _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
|
||||||
{return int_type(__c);}
|
{return int_type(__c);}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
|
static _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
|
||||||
{return __c1 == __c2;}
|
{return __c1 == __c2;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
static int_type eof() _NOEXCEPT
|
static _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
|
||||||
{return int_type(0xFFFFFFFF);}
|
{return int_type(0xFFFFFFFF);}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2206,6 +2208,7 @@ basic_string<_CharT, _Traits, _Allocator>::assign(_InputIterator __first, _Input
|
|||||||
clear();
|
clear();
|
||||||
for (; __first != __last; ++__first)
|
for (; __first != __last; ++__first)
|
||||||
push_back(*__first);
|
push_back(*__first);
|
||||||
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _CharT, class _Traits, class _Allocator>
|
template <class _CharT, class _Traits, class _Allocator>
|
||||||
|
@ -354,12 +354,12 @@ struct _LIBCPP_VISIBLE is_error_condition_enum<errc::_>
|
|||||||
: true_type { };
|
: true_type { };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class error_condition;
|
class _LIBCPP_VISIBLE error_condition;
|
||||||
class error_code;
|
class _LIBCPP_VISIBLE error_code;
|
||||||
|
|
||||||
// class error_category
|
// class error_category
|
||||||
|
|
||||||
class __do_message;
|
class _LIBCPP_HIDDEN __do_message;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE error_category
|
class _LIBCPP_VISIBLE error_category
|
||||||
{
|
{
|
||||||
@ -387,7 +387,7 @@ public:
|
|||||||
_LIBCPP_ALWAYS_INLINE
|
_LIBCPP_ALWAYS_INLINE
|
||||||
bool operator< (const error_category& __rhs) const _NOEXCEPT {return this < &__rhs;}
|
bool operator< (const error_category& __rhs) const _NOEXCEPT {return this < &__rhs;}
|
||||||
|
|
||||||
friend class __do_message;
|
friend class _LIBCPP_HIDDEN __do_message;
|
||||||
};
|
};
|
||||||
|
|
||||||
class _LIBCPP_HIDDEN __do_message
|
class _LIBCPP_HIDDEN __do_message
|
||||||
|
@ -26,41 +26,41 @@ public:
|
|||||||
class id;
|
class id;
|
||||||
typedef pthread_t native_handle_type;
|
typedef pthread_t native_handle_type;
|
||||||
|
|
||||||
thread();
|
thread() noexcept;
|
||||||
template <class F, class ...Args> explicit thread(F&& f, Args&&... args);
|
template <class F, class ...Args> explicit thread(F&& f, Args&&... args);
|
||||||
~thread();
|
~thread();
|
||||||
|
|
||||||
thread(const thread&) = delete;
|
thread(const thread&) = delete;
|
||||||
thread(thread&& t);
|
thread(thread&& t) noexcept;
|
||||||
|
|
||||||
thread& operator=(const thread&) = delete;
|
thread& operator=(const thread&) = delete;
|
||||||
thread& operator=(thread&& t);
|
thread& operator=(thread&& t) noexcept;
|
||||||
|
|
||||||
void swap(thread& t);
|
void swap(thread& t) noexcept;
|
||||||
|
|
||||||
bool joinable() const;
|
bool joinable() const noexcept;
|
||||||
void join();
|
void join();
|
||||||
void detach();
|
void detach();
|
||||||
id get_id() const;
|
id get_id() const noexcept;
|
||||||
native_handle_type native_handle();
|
native_handle_type native_handle();
|
||||||
|
|
||||||
static unsigned hardware_concurrency();
|
static unsigned hardware_concurrency() noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
void swap(thread& x, thread& y);
|
void swap(thread& x, thread& y) noexcept;
|
||||||
|
|
||||||
class thread::id
|
class thread::id
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
id();
|
id() noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool operator==(thread::id x, thread::id y);
|
bool operator==(thread::id x, thread::id y) noexcept;
|
||||||
bool operator!=(thread::id x, thread::id y);
|
bool operator!=(thread::id x, thread::id y) noexcept;
|
||||||
bool operator< (thread::id x, thread::id y);
|
bool operator< (thread::id x, thread::id y) noexcept;
|
||||||
bool operator<=(thread::id x, thread::id y);
|
bool operator<=(thread::id x, thread::id y) noexcept;
|
||||||
bool operator> (thread::id x, thread::id y);
|
bool operator> (thread::id x, thread::id y) noexcept;
|
||||||
bool operator>=(thread::id x, thread::id y);
|
bool operator>=(thread::id x, thread::id y) noexcept;
|
||||||
|
|
||||||
template<class charT, class traits>
|
template<class charT, class traits>
|
||||||
basic_ostream<charT, traits>&
|
basic_ostream<charT, traits>&
|
||||||
@ -69,9 +69,9 @@ operator<<(basic_ostream<charT, traits>& out, thread::id id);
|
|||||||
namespace this_thread
|
namespace this_thread
|
||||||
{
|
{
|
||||||
|
|
||||||
thread::id get_id();
|
thread::id get_id() noexcept;
|
||||||
|
|
||||||
void yield();
|
void yield() noexcept;
|
||||||
|
|
||||||
template <class Clock, class Duration>
|
template <class Clock, class Duration>
|
||||||
void sleep_until(const chrono::time_point<Clock, Duration>& abs_time);
|
void sleep_until(const chrono::time_point<Clock, Duration>& abs_time);
|
||||||
@ -173,13 +173,13 @@ __thread_specific_ptr<_Tp>::reset(pointer __p)
|
|||||||
delete __p_old;
|
delete __p_old;
|
||||||
}
|
}
|
||||||
|
|
||||||
class thread;
|
class _LIBCPP_VISIBLE thread;
|
||||||
class __thread_id;
|
class _LIBCPP_VISIBLE __thread_id;
|
||||||
|
|
||||||
namespace this_thread
|
namespace this_thread
|
||||||
{
|
{
|
||||||
|
|
||||||
__thread_id get_id();
|
_LIBCPP_INLINE_VISIBILITY __thread_id get_id() _NOEXCEPT;
|
||||||
|
|
||||||
} // this_thread
|
} // this_thread
|
||||||
|
|
||||||
@ -195,25 +195,25 @@ class _LIBCPP_VISIBLE __thread_id
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
__thread_id() : __id_(0) {}
|
__thread_id() _NOEXCEPT : __id_(0) {}
|
||||||
|
|
||||||
friend _LIBCPP_INLINE_VISIBILITY
|
friend _LIBCPP_INLINE_VISIBILITY
|
||||||
bool operator==(__thread_id __x, __thread_id __y)
|
bool operator==(__thread_id __x, __thread_id __y) _NOEXCEPT
|
||||||
{return __x.__id_ == __y.__id_;}
|
{return __x.__id_ == __y.__id_;}
|
||||||
friend _LIBCPP_INLINE_VISIBILITY
|
friend _LIBCPP_INLINE_VISIBILITY
|
||||||
bool operator!=(__thread_id __x, __thread_id __y)
|
bool operator!=(__thread_id __x, __thread_id __y) _NOEXCEPT
|
||||||
{return !(__x == __y);}
|
{return !(__x == __y);}
|
||||||
friend _LIBCPP_INLINE_VISIBILITY
|
friend _LIBCPP_INLINE_VISIBILITY
|
||||||
bool operator< (__thread_id __x, __thread_id __y)
|
bool operator< (__thread_id __x, __thread_id __y) _NOEXCEPT
|
||||||
{return __x.__id_ < __y.__id_;}
|
{return __x.__id_ < __y.__id_;}
|
||||||
friend _LIBCPP_INLINE_VISIBILITY
|
friend _LIBCPP_INLINE_VISIBILITY
|
||||||
bool operator<=(__thread_id __x, __thread_id __y)
|
bool operator<=(__thread_id __x, __thread_id __y) _NOEXCEPT
|
||||||
{return !(__y < __x);}
|
{return !(__y < __x);}
|
||||||
friend _LIBCPP_INLINE_VISIBILITY
|
friend _LIBCPP_INLINE_VISIBILITY
|
||||||
bool operator> (__thread_id __x, __thread_id __y)
|
bool operator> (__thread_id __x, __thread_id __y) _NOEXCEPT
|
||||||
{return __y < __x ;}
|
{return __y < __x ;}
|
||||||
friend _LIBCPP_INLINE_VISIBILITY
|
friend _LIBCPP_INLINE_VISIBILITY
|
||||||
bool operator>=(__thread_id __x, __thread_id __y)
|
bool operator>=(__thread_id __x, __thread_id __y) _NOEXCEPT
|
||||||
{return !(__x < __y);}
|
{return !(__x < __y);}
|
||||||
|
|
||||||
template<class _CharT, class _Traits>
|
template<class _CharT, class _Traits>
|
||||||
@ -227,7 +227,7 @@ private:
|
|||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
__thread_id(pthread_t __id) : __id_(__id) {}
|
__thread_id(pthread_t __id) : __id_(__id) {}
|
||||||
|
|
||||||
friend __thread_id this_thread::get_id();
|
friend __thread_id this_thread::get_id() _NOEXCEPT;
|
||||||
friend class _LIBCPP_VISIBLE thread;
|
friend class _LIBCPP_VISIBLE thread;
|
||||||
friend struct _LIBCPP_VISIBLE hash<__thread_id>;
|
friend struct _LIBCPP_VISIBLE hash<__thread_id>;
|
||||||
};
|
};
|
||||||
@ -248,7 +248,7 @@ namespace this_thread
|
|||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
__thread_id
|
__thread_id
|
||||||
get_id()
|
get_id() _NOEXCEPT
|
||||||
{
|
{
|
||||||
return pthread_self();
|
return pthread_self();
|
||||||
}
|
}
|
||||||
@ -266,7 +266,7 @@ public:
|
|||||||
typedef pthread_t native_handle_type;
|
typedef pthread_t native_handle_type;
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
thread() : __t_(0) {}
|
thread() _NOEXCEPT : __t_(0) {}
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||||
template <class _Fp, class ..._Args,
|
template <class _Fp, class ..._Args,
|
||||||
class = typename enable_if
|
class = typename enable_if
|
||||||
@ -282,23 +282,23 @@ public:
|
|||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
thread(thread&& __t) : __t_(__t.__t_) {__t.__t_ = 0;}
|
thread(thread&& __t) _NOEXCEPT : __t_(__t.__t_) {__t.__t_ = 0;}
|
||||||
thread& operator=(thread&& __t);
|
thread& operator=(thread&& __t) _NOEXCEPT;
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void swap(thread& __t) {_VSTD::swap(__t_, __t.__t_);}
|
void swap(thread& __t) _NOEXCEPT {_VSTD::swap(__t_, __t.__t_);}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
bool joinable() const {return __t_ != 0;}
|
bool joinable() const _NOEXCEPT {return __t_ != 0;}
|
||||||
void join();
|
void join();
|
||||||
void detach();
|
void detach();
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
id get_id() const {return __t_;}
|
id get_id() const _NOEXCEPT {return __t_;}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
native_handle_type native_handle() {return __t_;}
|
native_handle_type native_handle() _NOEXCEPT {return __t_;}
|
||||||
|
|
||||||
static unsigned hardware_concurrency();
|
static unsigned hardware_concurrency() _NOEXCEPT;
|
||||||
};
|
};
|
||||||
|
|
||||||
class __assoc_sub_state;
|
class __assoc_sub_state;
|
||||||
@ -386,7 +386,7 @@ thread::thread(_Fp __f)
|
|||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
thread&
|
thread&
|
||||||
thread::operator=(thread&& __t)
|
thread::operator=(thread&& __t) _NOEXCEPT
|
||||||
{
|
{
|
||||||
if (__t_ != 0)
|
if (__t_ != 0)
|
||||||
terminate();
|
terminate();
|
||||||
@ -398,7 +398,7 @@ thread::operator=(thread&& __t)
|
|||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
void swap(thread& __x, thread& __y) {__x.swap(__y);}
|
void swap(thread& __x, thread& __y) _NOEXCEPT {__x.swap(__y);}
|
||||||
|
|
||||||
namespace this_thread
|
namespace this_thread
|
||||||
{
|
{
|
||||||
@ -410,10 +410,20 @@ void
|
|||||||
sleep_for(const chrono::duration<_Rep, _Period>& __d)
|
sleep_for(const chrono::duration<_Rep, _Period>& __d)
|
||||||
{
|
{
|
||||||
using namespace chrono;
|
using namespace chrono;
|
||||||
nanoseconds __ns = duration_cast<nanoseconds>(__d);
|
if (__d > duration<_Rep, _Period>::zero())
|
||||||
if (__ns < __d)
|
{
|
||||||
++__ns;
|
_LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max();
|
||||||
sleep_for(__ns);
|
nanoseconds __ns;
|
||||||
|
if (__d < _Max)
|
||||||
|
{
|
||||||
|
__ns = duration_cast<nanoseconds>(__d);
|
||||||
|
if (__ns < __d)
|
||||||
|
++__ns;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
__ns = nanoseconds::max();
|
||||||
|
sleep_for(__ns);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _Clock, class _Duration>
|
template <class _Clock, class _Duration>
|
||||||
@ -438,7 +448,7 @@ sleep_until(const chrono::time_point<chrono::steady_clock, _Duration>& __t)
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
void yield() {sched_yield();}
|
void yield() _NOEXCEPT {sched_yield();}
|
||||||
|
|
||||||
} // this_thread
|
} // this_thread
|
||||||
|
|
||||||
|
@ -130,7 +130,11 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||||||
|
|
||||||
struct _LIBCPP_VISIBLE allocator_arg_t { };
|
struct _LIBCPP_VISIBLE allocator_arg_t { };
|
||||||
|
|
||||||
|
#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_MEMORY)
|
||||||
extern const allocator_arg_t allocator_arg;
|
extern const allocator_arg_t allocator_arg;
|
||||||
|
#else
|
||||||
|
constexpr allocator_arg_t allocator_arg = allocator_arg_t();
|
||||||
|
#endif
|
||||||
|
|
||||||
// uses_allocator
|
// uses_allocator
|
||||||
|
|
||||||
@ -227,7 +231,8 @@ class __tuple_leaf
|
|||||||
|
|
||||||
__tuple_leaf& operator=(const __tuple_leaf&);
|
__tuple_leaf& operator=(const __tuple_leaf&);
|
||||||
public:
|
public:
|
||||||
_LIBCPP_INLINE_VISIBILITY __tuple_leaf() : value()
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR __tuple_leaf()
|
||||||
|
_NOEXCEPT_(is_nothrow_default_constructible<_Hp>::value) : value()
|
||||||
{static_assert(!is_reference<_Hp>::value,
|
{static_assert(!is_reference<_Hp>::value,
|
||||||
"Attempted to default construct a reference element in a tuple");}
|
"Attempted to default construct a reference element in a tuple");}
|
||||||
|
|
||||||
@ -255,7 +260,7 @@ public:
|
|||||||
template <class _Tp,
|
template <class _Tp,
|
||||||
class = typename enable_if<is_constructible<_Hp, _Tp>::value>::type>
|
class = typename enable_if<is_constructible<_Hp, _Tp>::value>::type>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
explicit __tuple_leaf(_Tp&& __t)
|
explicit __tuple_leaf(_Tp&& __t) _NOEXCEPT_((is_nothrow_constructible<_Hp, _Tp>::value))
|
||||||
: value(_VSTD::forward<_Tp>(__t))
|
: value(_VSTD::forward<_Tp>(__t))
|
||||||
{static_assert(!is_reference<_Hp>::value ||
|
{static_assert(!is_reference<_Hp>::value ||
|
||||||
(is_lvalue_reference<_Hp>::value &&
|
(is_lvalue_reference<_Hp>::value &&
|
||||||
@ -311,19 +316,20 @@ public:
|
|||||||
>::value)),
|
>::value)),
|
||||||
"Attempted to construct a reference element in a tuple with an rvalue");}
|
"Attempted to construct a reference element in a tuple with an rvalue");}
|
||||||
|
|
||||||
__tuple_leaf(const __tuple_leaf& __t)
|
__tuple_leaf(const __tuple_leaf& __t) _NOEXCEPT_(is_nothrow_copy_constructible<_Hp>::value)
|
||||||
: value(__t.get())
|
: value(__t.get())
|
||||||
{static_assert(!is_rvalue_reference<_Hp>::value, "Can not copy a tuple with rvalue reference member");}
|
{static_assert(!is_rvalue_reference<_Hp>::value, "Can not copy a tuple with rvalue reference member");}
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
explicit __tuple_leaf(const __tuple_leaf<_Ip, _Tp>& __t)
|
explicit __tuple_leaf(const __tuple_leaf<_Ip, _Tp>& __t)
|
||||||
|
_NOEXCEPT_((is_nothrow_constructible<_Hp, const _Tp&>::value))
|
||||||
: value(__t.get()) {}
|
: value(__t.get()) {}
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
__tuple_leaf&
|
__tuple_leaf&
|
||||||
operator=(_Tp&& __t)
|
operator=(_Tp&& __t) _NOEXCEPT_((is_nothrow_assignable<_Hp&, _Tp>::value))
|
||||||
{
|
{
|
||||||
value = _VSTD::forward<_Tp>(__t);
|
value = _VSTD::forward<_Tp>(__t);
|
||||||
return *this;
|
return *this;
|
||||||
@ -336,8 +342,8 @@ public:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY _Hp& get() {return value;}
|
_LIBCPP_INLINE_VISIBILITY _Hp& get() _NOEXCEPT {return value;}
|
||||||
_LIBCPP_INLINE_VISIBILITY const _Hp& get() const {return value;}
|
_LIBCPP_INLINE_VISIBILITY const _Hp& get() const _NOEXCEPT {return value;}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <size_t _Ip, class _Hp>
|
template <size_t _Ip, class _Hp>
|
||||||
@ -347,7 +353,8 @@ class __tuple_leaf<_Ip, _Hp, true>
|
|||||||
|
|
||||||
__tuple_leaf& operator=(const __tuple_leaf&);
|
__tuple_leaf& operator=(const __tuple_leaf&);
|
||||||
public:
|
public:
|
||||||
_LIBCPP_INLINE_VISIBILITY __tuple_leaf() {}
|
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR __tuple_leaf()
|
||||||
|
_NOEXCEPT_(is_nothrow_default_constructible<_Hp>::value) {}
|
||||||
|
|
||||||
template <class _Alloc>
|
template <class _Alloc>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@ -366,7 +373,7 @@ public:
|
|||||||
template <class _Tp,
|
template <class _Tp,
|
||||||
class = typename enable_if<is_constructible<_Hp, _Tp>::value>::type>
|
class = typename enable_if<is_constructible<_Hp, _Tp>::value>::type>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
explicit __tuple_leaf(_Tp&& __t)
|
explicit __tuple_leaf(_Tp&& __t) _NOEXCEPT_((is_nothrow_constructible<_Hp, _Tp>::value))
|
||||||
: _Hp(_VSTD::forward<_Tp>(__t)) {}
|
: _Hp(_VSTD::forward<_Tp>(__t)) {}
|
||||||
|
|
||||||
template <class _Tp, class _Alloc>
|
template <class _Tp, class _Alloc>
|
||||||
@ -387,12 +394,13 @@ public:
|
|||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
explicit __tuple_leaf(const __tuple_leaf<_Ip, _Tp>& __t)
|
explicit __tuple_leaf(const __tuple_leaf<_Ip, _Tp>& __t)
|
||||||
|
_NOEXCEPT_((is_nothrow_constructible<_Hp, const _Tp&>::value))
|
||||||
: _Hp(__t.get()) {}
|
: _Hp(__t.get()) {}
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
__tuple_leaf&
|
__tuple_leaf&
|
||||||
operator=(_Tp&& __t)
|
operator=(_Tp&& __t) _NOEXCEPT_((is_nothrow_assignable<_Hp&, _Tp>::value))
|
||||||
{
|
{
|
||||||
_Hp::operator=(_VSTD::forward<_Tp>(__t));
|
_Hp::operator=(_VSTD::forward<_Tp>(__t));
|
||||||
return *this;
|
return *this;
|
||||||
@ -406,13 +414,13 @@ public:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY _Hp& get() {return static_cast<_Hp&>(*this);}
|
_LIBCPP_INLINE_VISIBILITY _Hp& get() _NOEXCEPT {return static_cast<_Hp&>(*this);}
|
||||||
_LIBCPP_INLINE_VISIBILITY const _Hp& get() const {return static_cast<const _Hp&>(*this);}
|
_LIBCPP_INLINE_VISIBILITY const _Hp& get() const _NOEXCEPT {return static_cast<const _Hp&>(*this);}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class ..._Tp>
|
template <class ..._Tp>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void __swallow(_Tp&&...) {}
|
void __swallow(_Tp&&...) _NOEXCEPT {}
|
||||||
|
|
||||||
template <bool ...> struct __all;
|
template <bool ...> struct __all;
|
||||||
|
|
||||||
@ -436,13 +444,19 @@ template<size_t ..._Indx, class ..._Tp>
|
|||||||
struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
|
struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
|
||||||
: public __tuple_leaf<_Indx, _Tp>...
|
: public __tuple_leaf<_Indx, _Tp>...
|
||||||
{
|
{
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
_LIBCPP_CONSTEXPR __tuple_impl()
|
||||||
|
_NOEXCEPT_(__all<is_nothrow_default_constructible<_Tp>::value...>::value) {}
|
||||||
|
|
||||||
template <size_t ..._Uf, class ..._Tf,
|
template <size_t ..._Uf, class ..._Tf,
|
||||||
size_t ..._Ul, class ..._Tl, class ..._Up>
|
size_t ..._Ul, class ..._Tl, class ..._Up>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
explicit
|
explicit
|
||||||
__tuple_impl(__tuple_indices<_Uf...>, __tuple_types<_Tf...>,
|
__tuple_impl(__tuple_indices<_Uf...>, __tuple_types<_Tf...>,
|
||||||
__tuple_indices<_Ul...>, __tuple_types<_Tl...>,
|
__tuple_indices<_Ul...>, __tuple_types<_Tl...>,
|
||||||
_Up&&... __u) :
|
_Up&&... __u)
|
||||||
|
_NOEXCEPT_((__all<is_nothrow_constructible<_Tf, _Up>::value...>::value &&
|
||||||
|
__all<is_nothrow_default_constructible<_Tl>::value...>::value)) :
|
||||||
__tuple_leaf<_Uf, _Tf>(_VSTD::forward<_Up>(__u))...,
|
__tuple_leaf<_Uf, _Tf>(_VSTD::forward<_Up>(__u))...,
|
||||||
__tuple_leaf<_Ul, _Tl>()...
|
__tuple_leaf<_Ul, _Tl>()...
|
||||||
{}
|
{}
|
||||||
@ -467,7 +481,8 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
|
|||||||
>::type
|
>::type
|
||||||
>
|
>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
__tuple_impl(_Tuple&& __t)
|
__tuple_impl(_Tuple&& __t) _NOEXCEPT_((__all<is_nothrow_constructible<_Tp, typename tuple_element<_Indx,
|
||||||
|
typename __make_tuple_types<_Tuple>::type>::type>::value...>::value))
|
||||||
: __tuple_leaf<_Indx, _Tp>(_VSTD::forward<typename tuple_element<_Indx,
|
: __tuple_leaf<_Indx, _Tp>(_VSTD::forward<typename tuple_element<_Indx,
|
||||||
typename __make_tuple_types<_Tuple>::type>::type>(_VSTD::get<_Indx>(__t)))...
|
typename __make_tuple_types<_Tuple>::type>::type>(_VSTD::get<_Indx>(__t)))...
|
||||||
{}
|
{}
|
||||||
@ -493,7 +508,8 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
|
|||||||
__tuple_assignable<_Tuple, tuple<_Tp...> >::value,
|
__tuple_assignable<_Tuple, tuple<_Tp...> >::value,
|
||||||
__tuple_impl&
|
__tuple_impl&
|
||||||
>::type
|
>::type
|
||||||
operator=(_Tuple&& __t)
|
operator=(_Tuple&& __t) _NOEXCEPT_((__all<is_nothrow_assignable<_Tp&, typename tuple_element<_Indx,
|
||||||
|
typename __make_tuple_types<_Tuple>::type>::type>::value...>::value))
|
||||||
{
|
{
|
||||||
__swallow(__tuple_leaf<_Indx, _Tp>::operator=(_VSTD::forward<typename tuple_element<_Indx,
|
__swallow(__tuple_leaf<_Indx, _Tp>::operator=(_VSTD::forward<typename tuple_element<_Indx,
|
||||||
typename __make_tuple_types<_Tuple>::type>::type>(_VSTD::get<_Indx>(__t)))...);
|
typename __make_tuple_types<_Tuple>::type>::type>(_VSTD::get<_Indx>(__t)))...);
|
||||||
@ -502,7 +518,7 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
|
|||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
__tuple_impl&
|
__tuple_impl&
|
||||||
operator=(const __tuple_impl& __t)
|
operator=(const __tuple_impl& __t) _NOEXCEPT_((__all<is_nothrow_copy_assignable<_Tp>::value...>::value))
|
||||||
{
|
{
|
||||||
__swallow(__tuple_leaf<_Indx, _Tp>::operator=(static_cast<const __tuple_leaf<_Indx, _Tp>&>(__t).get())...);
|
__swallow(__tuple_leaf<_Indx, _Tp>::operator=(static_cast<const __tuple_leaf<_Indx, _Tp>&>(__t).get())...);
|
||||||
return *this;
|
return *this;
|
||||||
@ -532,7 +548,11 @@ class _LIBCPP_VISIBLE tuple
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
explicit tuple(const _Tp& ... __t)
|
_LIBCPP_CONSTEXPR tuple()
|
||||||
|
_NOEXCEPT_(__all<is_nothrow_default_constructible<_Tp>::value...>::value) {}
|
||||||
|
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
|
explicit tuple(const _Tp& ... __t) _NOEXCEPT_((__all<is_nothrow_copy_constructible<_Tp>::value...>::value))
|
||||||
: base_(typename __make_tuple_indices<sizeof...(_Tp)>::type(),
|
: base_(typename __make_tuple_indices<sizeof...(_Tp)>::type(),
|
||||||
typename __make_tuple_types<tuple, sizeof...(_Tp)>::type(),
|
typename __make_tuple_types<tuple, sizeof...(_Tp)>::type(),
|
||||||
typename __make_tuple_indices<0>::type(),
|
typename __make_tuple_indices<0>::type(),
|
||||||
@ -568,6 +588,15 @@ public:
|
|||||||
>
|
>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
tuple(_Up&&... __u)
|
tuple(_Up&&... __u)
|
||||||
|
_NOEXCEPT_((
|
||||||
|
is_nothrow_constructible<
|
||||||
|
typename __make_tuple_indices<sizeof...(_Up)>::type,
|
||||||
|
typename __make_tuple_types<tuple, sizeof...(_Up)>::type,
|
||||||
|
typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type,
|
||||||
|
typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type,
|
||||||
|
_Up...
|
||||||
|
>::value
|
||||||
|
))
|
||||||
: base_(typename __make_tuple_indices<sizeof...(_Up)>::type(),
|
: base_(typename __make_tuple_indices<sizeof...(_Up)>::type(),
|
||||||
typename __make_tuple_types<tuple, sizeof...(_Up)>::type(),
|
typename __make_tuple_types<tuple, sizeof...(_Up)>::type(),
|
||||||
typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(),
|
typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(),
|
||||||
@ -600,6 +629,15 @@ public:
|
|||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
explicit
|
explicit
|
||||||
tuple(_Up&&... __u)
|
tuple(_Up&&... __u)
|
||||||
|
_NOEXCEPT_((
|
||||||
|
is_nothrow_constructible<
|
||||||
|
typename __make_tuple_indices<sizeof...(_Up)>::type,
|
||||||
|
typename __make_tuple_types<tuple, sizeof...(_Up)>::type,
|
||||||
|
typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type,
|
||||||
|
typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type,
|
||||||
|
_Up...
|
||||||
|
>::value
|
||||||
|
))
|
||||||
: base_(typename __make_tuple_indices<sizeof...(_Up)>::type(),
|
: base_(typename __make_tuple_indices<sizeof...(_Up)>::type(),
|
||||||
typename __make_tuple_types<tuple, sizeof...(_Up)>::type(),
|
typename __make_tuple_types<tuple, sizeof...(_Up)>::type(),
|
||||||
typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(),
|
typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(),
|
||||||
@ -637,7 +675,7 @@ public:
|
|||||||
>::type = false
|
>::type = false
|
||||||
>
|
>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
tuple(_Tuple&& __t)
|
tuple(_Tuple&& __t) _NOEXCEPT_((is_nothrow_constructible<base, _Tuple>::value))
|
||||||
: base_(_VSTD::forward<_Tuple>(__t)) {}
|
: base_(_VSTD::forward<_Tuple>(__t)) {}
|
||||||
|
|
||||||
template <class _Tuple,
|
template <class _Tuple,
|
||||||
@ -650,7 +688,7 @@ public:
|
|||||||
>
|
>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
explicit
|
explicit
|
||||||
tuple(_Tuple&& __t)
|
tuple(_Tuple&& __t) _NOEXCEPT_((is_nothrow_constructible<base, _Tuple>::value))
|
||||||
: base_(_VSTD::forward<_Tuple>(__t)) {}
|
: base_(_VSTD::forward<_Tuple>(__t)) {}
|
||||||
|
|
||||||
template <class _Alloc, class _Tuple,
|
template <class _Alloc, class _Tuple,
|
||||||
@ -671,7 +709,7 @@ public:
|
|||||||
>
|
>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
tuple&
|
tuple&
|
||||||
operator=(_Tuple&& __t)
|
operator=(_Tuple&& __t) _NOEXCEPT_((is_nothrow_assignable<base&, _Tuple>::value))
|
||||||
{
|
{
|
||||||
base_.operator=(_VSTD::forward<_Tuple>(__t));
|
base_.operator=(_VSTD::forward<_Tuple>(__t));
|
||||||
return *this;
|
return *this;
|
||||||
@ -687,19 +725,19 @@ class _LIBCPP_VISIBLE tuple<>
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
tuple() {}
|
_LIBCPP_CONSTEXPR tuple() _NOEXCEPT {}
|
||||||
template <class _Alloc>
|
template <class _Alloc>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
tuple(allocator_arg_t, const _Alloc&) {}
|
tuple(allocator_arg_t, const _Alloc&) _NOEXCEPT {}
|
||||||
template <class _Alloc>
|
template <class _Alloc>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
tuple(allocator_arg_t, const _Alloc&, const tuple&) {}
|
tuple(allocator_arg_t, const _Alloc&, const tuple&) _NOEXCEPT {}
|
||||||
template <class _Up>
|
template <class _Up>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
tuple(array<_Up, 0>) {}
|
tuple(array<_Up, 0>) _NOEXCEPT {}
|
||||||
template <class _Alloc, class _Up>
|
template <class _Alloc, class _Up>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
tuple(allocator_arg_t, const _Alloc&, array<_Up, 0>) {}
|
tuple(allocator_arg_t, const _Alloc&, array<_Up, 0>) _NOEXCEPT {}
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
void swap(tuple&) _NOEXCEPT {}
|
void swap(tuple&) _NOEXCEPT {}
|
||||||
};
|
};
|
||||||
@ -750,7 +788,7 @@ get(tuple<_Tp...>&& __t) _NOEXCEPT
|
|||||||
template <class ..._Tp>
|
template <class ..._Tp>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
tuple<_Tp&...>
|
tuple<_Tp&...>
|
||||||
tie(_Tp&... __t)
|
tie(_Tp&... __t) _NOEXCEPT
|
||||||
{
|
{
|
||||||
return tuple<_Tp&...>(__t...);
|
return tuple<_Tp&...>(__t...);
|
||||||
}
|
}
|
||||||
@ -765,7 +803,7 @@ struct __ignore_t
|
|||||||
|
|
||||||
namespace { const __ignore_t<unsigned char> ignore = __ignore_t<unsigned char>(); }
|
namespace { const __ignore_t<unsigned char> ignore = __ignore_t<unsigned char>(); }
|
||||||
|
|
||||||
template <class _Tp> class reference_wrapper;
|
template <class _Tp> class _LIBCPP_VISIBLE reference_wrapper;
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct ___make_tuple_return
|
struct ___make_tuple_return
|
||||||
@ -796,7 +834,7 @@ make_tuple(_Tp&&... __t)
|
|||||||
template <class... _Tp>
|
template <class... _Tp>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
tuple<_Tp&&...>
|
tuple<_Tp&&...>
|
||||||
forward_as_tuple(_Tp&&... __t)
|
forward_as_tuple(_Tp&&... __t) _NOEXCEPT
|
||||||
{
|
{
|
||||||
return tuple<_Tp&&...>(_VSTD::forward<_Tp>(__t)...);
|
return tuple<_Tp&&...>(_VSTD::forward<_Tp>(__t)...);
|
||||||
}
|
}
|
||||||
|
@ -607,22 +607,33 @@ template <class _Tp> struct __libcpp_abstract<_Tp, false> : public false_type {}
|
|||||||
|
|
||||||
template <class _Tp> struct _LIBCPP_VISIBLE is_abstract : public __libcpp_abstract<_Tp> {};
|
template <class _Tp> struct _LIBCPP_VISIBLE is_abstract : public __libcpp_abstract<_Tp> {};
|
||||||
|
|
||||||
|
// is_base_of
|
||||||
|
|
||||||
|
#ifdef _LIBCP_HAS_IS_BASE_OF
|
||||||
|
|
||||||
|
template <class _Bp, class _Dp>
|
||||||
|
struct _LIBCPP_VISIBLE is_base_of
|
||||||
|
: public integral_constant<bool, __is_base_of(_Bp, _Dp)> {};
|
||||||
|
|
||||||
|
#else // __has_feature(is_base_of)
|
||||||
|
|
||||||
|
#error is_base_of not implemented.
|
||||||
|
|
||||||
|
#endif // __has_feature(is_base_of)
|
||||||
|
|
||||||
// is_convertible
|
// is_convertible
|
||||||
|
|
||||||
#if __has_feature(is_convertible_to)
|
#if __has_feature(is_convertible_to)
|
||||||
|
|
||||||
template <class _T1, class _T2> struct _LIBCPP_VISIBLE is_convertible
|
template <class _T1, class _T2> struct _LIBCPP_VISIBLE is_convertible
|
||||||
: public integral_constant<bool, __is_convertible_to(_T1, _T2)> {};
|
: public integral_constant<bool, __is_convertible_to(_T1, _T2) &&
|
||||||
|
!is_abstract<_T2>::value> {};
|
||||||
|
|
||||||
#else // __has_feature(is_convertible_to)
|
#else // __has_feature(is_convertible_to)
|
||||||
|
|
||||||
namespace __is_convertible_imp
|
namespace __is_convertible_imp
|
||||||
{
|
{
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
template <class _Tp> char __test(const volatile typename remove_reference<_Tp>::type&&);
|
|
||||||
#else
|
|
||||||
template <class _Tp> char __test(_Tp);
|
template <class _Tp> char __test(_Tp);
|
||||||
#endif
|
|
||||||
template <class _Tp> __two __test(...);
|
template <class _Tp> __two __test(...);
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
template <class _Tp> _Tp&& __source();
|
template <class _Tp> _Tp&& __source();
|
||||||
@ -657,7 +668,17 @@ template <class _T1, class _T2,
|
|||||||
unsigned _T2_is_array_function_or_void = __is_convertible_imp::__is_array_function_or_void<_T2>::value>
|
unsigned _T2_is_array_function_or_void = __is_convertible_imp::__is_array_function_or_void<_T2>::value>
|
||||||
struct __is_convertible
|
struct __is_convertible
|
||||||
: public integral_constant<bool,
|
: public integral_constant<bool,
|
||||||
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
sizeof(__is_convertible_imp::__test<_T2>(__is_convertible_imp::__source<_T1>())) == 1
|
sizeof(__is_convertible_imp::__test<_T2>(__is_convertible_imp::__source<_T1>())) == 1
|
||||||
|
#else
|
||||||
|
sizeof(__is_convertible_imp::__test<_T2>(__is_convertible_imp::__source<_T1>())) == 1
|
||||||
|
&& !(!is_function<_T1>::value && !is_reference<_T1>::value && is_reference<_T2>::value
|
||||||
|
&& (!is_const<typename remove_reference<_T2>::type>::value
|
||||||
|
|| is_volatile<typename remove_reference<_T2>::type>::value)
|
||||||
|
&& (is_same<typename remove_cv<_T1>::type,
|
||||||
|
typename remove_cv<typename remove_reference<_T2>::type>::type>::value
|
||||||
|
|| is_base_of<typename remove_reference<_T2>::type, _T1>::value))
|
||||||
|
#endif
|
||||||
>
|
>
|
||||||
{};
|
{};
|
||||||
|
|
||||||
@ -687,6 +708,7 @@ template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 2, 0>
|
|||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
template <class _T1> struct __is_convertible<_T1, _T1&&, 2, 0> : public true_type {};
|
template <class _T1> struct __is_convertible<_T1, _T1&&, 2, 0> : public true_type {};
|
||||||
#endif
|
#endif
|
||||||
|
template <class _T1> struct __is_convertible<_T1, _T1&, 2, 0> : public true_type {};
|
||||||
template <class _T1> struct __is_convertible<_T1, _T1*, 2, 0> : public true_type {};
|
template <class _T1> struct __is_convertible<_T1, _T1*, 2, 0> : public true_type {};
|
||||||
template <class _T1> struct __is_convertible<_T1, _T1*const, 2, 0> : public true_type {};
|
template <class _T1> struct __is_convertible<_T1, _T1*const, 2, 0> : public true_type {};
|
||||||
template <class _T1> struct __is_convertible<_T1, _T1*volatile, 2, 0> : public true_type {};
|
template <class _T1> struct __is_convertible<_T1, _T1*volatile, 2, 0> : public true_type {};
|
||||||
@ -718,20 +740,6 @@ template <class _T1, class _T2> struct _LIBCPP_VISIBLE is_convertible
|
|||||||
|
|
||||||
#endif // __has_feature(is_convertible_to)
|
#endif // __has_feature(is_convertible_to)
|
||||||
|
|
||||||
// is_base_of
|
|
||||||
|
|
||||||
#ifdef _LIBCP_HAS_IS_BASE_OF
|
|
||||||
|
|
||||||
template <class _Bp, class _Dp>
|
|
||||||
struct _LIBCPP_VISIBLE is_base_of
|
|
||||||
: public integral_constant<bool, __is_base_of(_Bp, _Dp)> {};
|
|
||||||
|
|
||||||
#else // __has_feature(is_base_of)
|
|
||||||
|
|
||||||
#error is_base_of not implemented.
|
|
||||||
|
|
||||||
#endif // __has_feature(is_base_of)
|
|
||||||
|
|
||||||
// is_empty
|
// is_empty
|
||||||
|
|
||||||
#if __has_feature(is_empty)
|
#if __has_feature(is_empty)
|
||||||
@ -1609,77 +1617,13 @@ struct __member_pointer_traits
|
|||||||
|
|
||||||
template <class _Callable> class result_of;
|
template <class _Callable> class result_of;
|
||||||
|
|
||||||
|
#ifdef _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
template <class _Fn, bool, bool>
|
template <class _Fn, bool, bool>
|
||||||
class __result_of
|
class __result_of
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
|
||||||
|
|
||||||
template <class _Fn, class ..._ArgTypes>
|
|
||||||
class __result_of<_Fn(_ArgTypes...), true, false>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
typedef decltype(declval<_Fn>()(declval<_ArgTypes>()...)) type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class _MP, class _Tp, bool _IsMemberFunctionPtr>
|
|
||||||
struct __result_of_mp;
|
|
||||||
|
|
||||||
// member function pointer
|
|
||||||
|
|
||||||
template <class _MP, class _Tp>
|
|
||||||
struct __result_of_mp<_MP, _Tp, true>
|
|
||||||
: public common_type<typename __member_pointer_traits<_MP>::_ReturnType>
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
// member data pointer
|
|
||||||
|
|
||||||
template <class _MP, class _Tp, bool>
|
|
||||||
struct __result_of_mdp;
|
|
||||||
|
|
||||||
template <class _Rp, class _Class, class _Tp>
|
|
||||||
struct __result_of_mdp<_Rp _Class::*, _Tp, false>
|
|
||||||
{
|
|
||||||
typedef typename __apply_cv<decltype(*_VSTD::declval<_Tp>()), _Rp>::type&& type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class _Rp, class _Class, class _Tp>
|
|
||||||
struct __result_of_mdp<_Rp _Class::*, _Tp, true>
|
|
||||||
{
|
|
||||||
typedef typename __apply_cv<_Tp, _Rp>::type&& type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class _Rp, class _Class, class _Tp>
|
|
||||||
struct __result_of_mp<_Rp _Class::*, _Tp, false>
|
|
||||||
: public __result_of_mdp<_Rp _Class::*, _Tp,
|
|
||||||
is_base_of<_Class, typename remove_reference<_Tp>::type>::value>
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class _Fn, class _Tp, class ..._ArgTypes>
|
|
||||||
class __result_of<_Fn(_Tp, _ArgTypes...), false, true> // _Fn must be member pointer
|
|
||||||
: public __result_of_mp<typename remove_reference<_Fn>::type,
|
|
||||||
_Tp,
|
|
||||||
is_member_function_pointer<typename remove_reference<_Fn>::type>::value>
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
// result_of
|
|
||||||
|
|
||||||
template <class _Fn, class ..._ArgTypes>
|
|
||||||
class _LIBCPP_VISIBLE result_of<_Fn(_ArgTypes...)>
|
|
||||||
: public __result_of<_Fn(_ArgTypes...),
|
|
||||||
is_class<typename remove_reference<_Fn>::type>::value ||
|
|
||||||
is_function<typename remove_reference<_Fn>::type>::value,
|
|
||||||
is_member_pointer<typename remove_reference<_Fn>::type>::value
|
|
||||||
>
|
|
||||||
{
|
|
||||||
};
|
|
||||||
|
|
||||||
#else // _LIBCPP_HAS_NO_VARIADICS
|
|
||||||
|
|
||||||
template <class _Fn>
|
template <class _Fn>
|
||||||
class __result_of<_Fn(), true, false>
|
class __result_of<_Fn(), true, false>
|
||||||
{
|
{
|
||||||
@ -2781,37 +2725,37 @@ struct __check_complete<_Tp&&>
|
|||||||
|
|
||||||
template <class _Rp, class ..._Param>
|
template <class _Rp, class ..._Param>
|
||||||
struct __check_complete<_Rp (*)(_Param...)>
|
struct __check_complete<_Rp (*)(_Param...)>
|
||||||
: private __check_complete<_Param...>
|
: private __check_complete<_Rp>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Rp, class ..._Param>
|
template <class _Rp, class ..._Param>
|
||||||
struct __check_complete<_Rp (_Param...)>
|
struct __check_complete<_Rp (_Param...)>
|
||||||
: private __check_complete<_Param...>
|
: private __check_complete<_Rp>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Rp, class _Class, class ..._Param>
|
template <class _Rp, class _Class, class ..._Param>
|
||||||
struct __check_complete<_Rp (_Class::*)(_Param...)>
|
struct __check_complete<_Rp (_Class::*)(_Param...)>
|
||||||
: private __check_complete<_Class, _Param...>
|
: private __check_complete<_Class>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Rp, class _Class, class ..._Param>
|
template <class _Rp, class _Class, class ..._Param>
|
||||||
struct __check_complete<_Rp (_Class::*)(_Param...) const>
|
struct __check_complete<_Rp (_Class::*)(_Param...) const>
|
||||||
: private __check_complete<_Class, _Param...>
|
: private __check_complete<_Class>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Rp, class _Class, class ..._Param>
|
template <class _Rp, class _Class, class ..._Param>
|
||||||
struct __check_complete<_Rp (_Class::*)(_Param...) volatile>
|
struct __check_complete<_Rp (_Class::*)(_Param...) volatile>
|
||||||
: private __check_complete<_Class, _Param...>
|
: private __check_complete<_Class>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Rp, class _Class, class ..._Param>
|
template <class _Rp, class _Class, class ..._Param>
|
||||||
struct __check_complete<_Rp (_Class::*)(_Param...) const volatile>
|
struct __check_complete<_Rp (_Class::*)(_Param...) const volatile>
|
||||||
: private __check_complete<_Class, _Param...>
|
: private __check_complete<_Class>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2819,49 +2763,49 @@ struct __check_complete<_Rp (_Class::*)(_Param...) const volatile>
|
|||||||
|
|
||||||
template <class _Rp, class _Class, class ..._Param>
|
template <class _Rp, class _Class, class ..._Param>
|
||||||
struct __check_complete<_Rp (_Class::*)(_Param...) &>
|
struct __check_complete<_Rp (_Class::*)(_Param...) &>
|
||||||
: private __check_complete<_Class, _Param...>
|
: private __check_complete<_Class>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Rp, class _Class, class ..._Param>
|
template <class _Rp, class _Class, class ..._Param>
|
||||||
struct __check_complete<_Rp (_Class::*)(_Param...) const&>
|
struct __check_complete<_Rp (_Class::*)(_Param...) const&>
|
||||||
: private __check_complete<_Class, _Param...>
|
: private __check_complete<_Class>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Rp, class _Class, class ..._Param>
|
template <class _Rp, class _Class, class ..._Param>
|
||||||
struct __check_complete<_Rp (_Class::*)(_Param...) volatile&>
|
struct __check_complete<_Rp (_Class::*)(_Param...) volatile&>
|
||||||
: private __check_complete<_Class, _Param...>
|
: private __check_complete<_Class>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Rp, class _Class, class ..._Param>
|
template <class _Rp, class _Class, class ..._Param>
|
||||||
struct __check_complete<_Rp (_Class::*)(_Param...) const volatile&>
|
struct __check_complete<_Rp (_Class::*)(_Param...) const volatile&>
|
||||||
: private __check_complete<_Class, _Param...>
|
: private __check_complete<_Class>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Rp, class _Class, class ..._Param>
|
template <class _Rp, class _Class, class ..._Param>
|
||||||
struct __check_complete<_Rp (_Class::*)(_Param...) &&>
|
struct __check_complete<_Rp (_Class::*)(_Param...) &&>
|
||||||
: private __check_complete<_Class, _Param...>
|
: private __check_complete<_Class>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Rp, class _Class, class ..._Param>
|
template <class _Rp, class _Class, class ..._Param>
|
||||||
struct __check_complete<_Rp (_Class::*)(_Param...) const&&>
|
struct __check_complete<_Rp (_Class::*)(_Param...) const&&>
|
||||||
: private __check_complete<_Class, _Param...>
|
: private __check_complete<_Class>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Rp, class _Class, class ..._Param>
|
template <class _Rp, class _Class, class ..._Param>
|
||||||
struct __check_complete<_Rp (_Class::*)(_Param...) volatile&&>
|
struct __check_complete<_Rp (_Class::*)(_Param...) volatile&&>
|
||||||
: private __check_complete<_Class, _Param...>
|
: private __check_complete<_Class>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Rp, class _Class, class ..._Param>
|
template <class _Rp, class _Class, class ..._Param>
|
||||||
struct __check_complete<_Rp (_Class::*)(_Param...) const volatile&&>
|
struct __check_complete<_Rp (_Class::*)(_Param...) const volatile&&>
|
||||||
: private __check_complete<_Class, _Param...>
|
: private __check_complete<_Class>
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2885,11 +2829,13 @@ __invoke(__any, _Args&& ...__args)
|
|||||||
// bullets 1 and 2
|
// bullets 1 and 2
|
||||||
|
|
||||||
template <class _Fp, class _A0, class ..._Args>
|
template <class _Fp, class _A0, class ..._Args>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
auto
|
auto
|
||||||
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
|
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
|
||||||
-> decltype((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...));
|
-> decltype((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...));
|
||||||
|
|
||||||
template <class _Fp, class _A0, class ..._Args>
|
template <class _Fp, class _A0, class ..._Args>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
auto
|
auto
|
||||||
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
|
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
|
||||||
-> decltype(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...));
|
-> decltype(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...));
|
||||||
@ -2897,11 +2843,13 @@ __invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
|
|||||||
// bullets 3 and 4
|
// bullets 3 and 4
|
||||||
|
|
||||||
template <class _Fp, class _A0>
|
template <class _Fp, class _A0>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
auto
|
auto
|
||||||
__invoke(_Fp&& __f, _A0&& __a0)
|
__invoke(_Fp&& __f, _A0&& __a0)
|
||||||
-> decltype(_VSTD::forward<_A0>(__a0).*__f);
|
-> decltype(_VSTD::forward<_A0>(__a0).*__f);
|
||||||
|
|
||||||
template <class _Fp, class _A0>
|
template <class _Fp, class _A0>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
auto
|
auto
|
||||||
__invoke(_Fp&& __f, _A0&& __a0)
|
__invoke(_Fp&& __f, _A0&& __a0)
|
||||||
-> decltype((*_VSTD::forward<_A0>(__a0)).*__f);
|
-> decltype((*_VSTD::forward<_A0>(__a0)).*__f);
|
||||||
@ -2909,6 +2857,7 @@ __invoke(_Fp&& __f, _A0&& __a0)
|
|||||||
// bullet 5
|
// bullet 5
|
||||||
|
|
||||||
template <class _Fp, class ..._Args>
|
template <class _Fp, class ..._Args>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
auto
|
auto
|
||||||
__invoke(_Fp&& __f, _Args&& ...__args)
|
__invoke(_Fp&& __f, _Args&& ...__args)
|
||||||
-> decltype(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...));
|
-> decltype(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...));
|
||||||
@ -2917,7 +2866,7 @@ __invoke(_Fp&& __f, _Args&& ...__args)
|
|||||||
|
|
||||||
template <class _Fp, class ..._Args>
|
template <class _Fp, class ..._Args>
|
||||||
struct __invokable_imp
|
struct __invokable_imp
|
||||||
: private __check_complete<_Fp, _Args...>
|
: private __check_complete<_Fp>
|
||||||
{
|
{
|
||||||
typedef decltype(
|
typedef decltype(
|
||||||
__invoke(_VSTD::declval<_Fp>(), _VSTD::declval<_Args>()...)
|
__invoke(_VSTD::declval<_Fp>(), _VSTD::declval<_Args>()...)
|
||||||
@ -2951,6 +2900,12 @@ struct __invoke_of
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <class _Fp, class ..._Args>
|
||||||
|
class _LIBCPP_VISIBLE result_of<_Fp(_Args...)>
|
||||||
|
: public __invoke_of<_Fp, _Args...>
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
|
@ -786,42 +786,15 @@ public:
|
|||||||
const_iterator cend() const _NOEXCEPT {return __table_.end();}
|
const_iterator cend() const _NOEXCEPT {return __table_.end();}
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
|
||||||
pair<iterator, bool> emplace()
|
|
||||||
{return __table_.__emplace_unique();}
|
|
||||||
|
|
||||||
template <class _A0,
|
|
||||||
class = typename enable_if<is_constructible<value_type, _A0>::value>::type>
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
|
||||||
pair<iterator, bool> emplace(_A0&& __a0)
|
|
||||||
{return __table_.__emplace_unique(_VSTD::forward<_A0>(__a0));}
|
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
template <class _A0, class... _Args,
|
template <class... _Args>
|
||||||
class = typename enable_if<is_constructible<key_type, _A0>::value>::type>
|
pair<iterator, bool> emplace(_Args&&... __args);
|
||||||
pair<iterator, bool> emplace(_A0&& __a0, _Args&&... __args);
|
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
template <class... _Args>
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
|
||||||
iterator emplace_hint(const_iterator)
|
|
||||||
{return __table_.__emplace_unique().first;}
|
|
||||||
|
|
||||||
template <class _A0,
|
|
||||||
class = typename enable_if<is_constructible<value_type, _A0>::value>::type>
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
iterator emplace_hint(const_iterator, _A0&& __a0)
|
iterator emplace_hint(const_iterator, _Args&&... __args)
|
||||||
{return __table_.__emplace_unique(_VSTD::forward<_A0>(__a0)).first;}
|
{return emplace(_VSTD::forward<_Args>(__args)...).first;}
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
|
||||||
|
|
||||||
template <class _A0, class... _Args,
|
|
||||||
class = typename enable_if<is_constructible<key_type, _A0>::value>::type>
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
|
||||||
iterator emplace_hint(const_iterator, _A0&& __a0, _Args&&... __args)
|
|
||||||
{return emplace(_VSTD::forward<_A0>(__a0),
|
|
||||||
_VSTD::forward<_Args>(__args)...).first;}
|
|
||||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@ -932,14 +905,25 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
|
__node_holder __construct_node();
|
||||||
|
template <class _A0>
|
||||||
|
typename enable_if
|
||||||
|
<
|
||||||
|
is_constructible<value_type, _A0>::value,
|
||||||
|
__node_holder
|
||||||
|
>::type
|
||||||
|
__construct_node(_A0&& __a0);
|
||||||
|
template <class _A0>
|
||||||
|
typename enable_if
|
||||||
|
<
|
||||||
|
is_constructible<key_type, _A0>::value,
|
||||||
|
__node_holder
|
||||||
|
>::type
|
||||||
|
__construct_node(_A0&& __a0);
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||||
template <class _A0, class... _Args,
|
template <class _A0, class _A1, class ..._Args>
|
||||||
class = typename enable_if<is_constructible<key_type, _A0>::value>::type>
|
__node_holder __construct_node(_A0&& __a0, _A1&& __a1, _Args&& ...__args);
|
||||||
__node_holder __construct_node(_A0&& __a0, _Args&&... __args);
|
|
||||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||||
template <class _A0,
|
|
||||||
class = typename enable_if<is_constructible<value_type, _A0>::value>::type>
|
|
||||||
__node_holder __construct_node(_A0&& __a0);
|
|
||||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
__node_holder __construct_node(const key_type& __k);
|
__node_holder __construct_node(const key_type& __k);
|
||||||
#endif
|
#endif
|
||||||
@ -1106,34 +1090,26 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(
|
|||||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
|
||||||
|
|
||||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||||
template <class _A0, class... _Args,
|
|
||||||
class // = typename enable_if<is_constructible<key_type, _A0>::value>::type
|
|
||||||
>
|
|
||||||
typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
|
typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
|
||||||
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0,
|
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node()
|
||||||
_Args&&... __args)
|
|
||||||
{
|
{
|
||||||
__node_allocator& __na = __table_.__node_alloc();
|
__node_allocator& __na = __table_.__node_alloc();
|
||||||
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
|
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
|
||||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.first),
|
__node_traits::construct(__na, _VSTD::addressof(__h->__value_));
|
||||||
_VSTD::forward<_A0>(__a0));
|
|
||||||
__h.get_deleter().__first_constructed = true;
|
__h.get_deleter().__first_constructed = true;
|
||||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second),
|
|
||||||
_VSTD::forward<_Args>(__args)...);
|
|
||||||
__h.get_deleter().__second_constructed = true;
|
__h.get_deleter().__second_constructed = true;
|
||||||
return __h;
|
return __h;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
|
||||||
|
|
||||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||||
template <class _A0,
|
template <class _A0>
|
||||||
class // = typename enable_if<is_constructible<value_type, _A0>::value>::type
|
typename enable_if
|
||||||
>
|
<
|
||||||
typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
|
is_constructible<pair<const _Key, _Tp>, _A0>::value,
|
||||||
|
typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
|
||||||
|
>::type
|
||||||
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0)
|
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0)
|
||||||
{
|
{
|
||||||
__node_allocator& __na = __table_.__node_alloc();
|
__node_allocator& __na = __table_.__node_alloc();
|
||||||
@ -1145,17 +1121,50 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0)
|
|||||||
return __h;
|
return __h;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||||
|
template <class _A0>
|
||||||
|
typename enable_if
|
||||||
|
<
|
||||||
|
is_constructible<_Key, _A0>::value,
|
||||||
|
typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
|
||||||
|
>::type
|
||||||
|
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0)
|
||||||
|
{
|
||||||
|
__node_allocator& __na = __table_.__node_alloc();
|
||||||
|
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
|
||||||
|
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.first),
|
||||||
|
_VSTD::forward<_A0>(__a0));
|
||||||
|
__h.get_deleter().__first_constructed = true;
|
||||||
|
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
|
||||||
|
__h.get_deleter().__second_constructed = true;
|
||||||
|
return __h;
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||||
template <class _A0, class... _Args,
|
template <class _A0, class _A1, class ..._Args>
|
||||||
class // = typename enable_if<is_constructible<key_type, _A0>::value>::type
|
typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
|
||||||
>
|
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0,
|
||||||
pair<typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::iterator, bool>
|
_A1&& __a1,
|
||||||
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::emplace(_A0&& __a0, _Args&&... __args)
|
_Args&&... __args)
|
||||||
{
|
{
|
||||||
__node_holder __h = __construct_node(_VSTD::forward<_A0>(__a0),
|
__node_allocator& __na = __table_.__node_alloc();
|
||||||
_VSTD::forward<_Args>(__args)...);
|
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
|
||||||
|
__node_traits::construct(__na, _VSTD::addressof(__h->__value_),
|
||||||
|
_VSTD::forward<_A0>(__a0), _VSTD::forward<_A1>(__a1),
|
||||||
|
_VSTD::forward<_Args>(__args)...);
|
||||||
|
__h.get_deleter().__first_constructed = true;
|
||||||
|
__h.get_deleter().__second_constructed = true;
|
||||||
|
return __h;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||||
|
template <class... _Args>
|
||||||
|
pair<typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::iterator, bool>
|
||||||
|
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::emplace(_Args&&... __args)
|
||||||
|
{
|
||||||
|
__node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
|
||||||
pair<iterator, bool> __r = __table_.__node_insert_unique(__h.get());
|
pair<iterator, bool> __r = __table_.__node_insert_unique(__h.get());
|
||||||
if (__r.second)
|
if (__r.second)
|
||||||
__h.release();
|
__h.release();
|
||||||
@ -1409,39 +1418,13 @@ public:
|
|||||||
const_iterator cend() const _NOEXCEPT {return __table_.end();}
|
const_iterator cend() const _NOEXCEPT {return __table_.end();}
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
|
||||||
iterator emplace()
|
|
||||||
{return __table_.__emplace_multi();}
|
|
||||||
|
|
||||||
template <class _A0,
|
|
||||||
class = typename enable_if<is_constructible<value_type, _A0>::value>::type>
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
|
||||||
iterator emplace(_A0&& __a0)
|
|
||||||
{return __table_.__emplace_multi(_VSTD::forward<_A0>(__a0));}
|
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
template <class _A0, class... _Args,
|
template <class... _Args>
|
||||||
class = typename enable_if<is_constructible<key_type, _A0>::value>::type>
|
iterator emplace(_Args&&... __args);
|
||||||
iterator emplace(_A0&& __a0, _Args&&... __args);
|
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
template <class... _Args>
|
||||||
|
iterator emplace_hint(const_iterator __p, _Args&&... __args);
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
|
||||||
iterator emplace_hint(const_iterator __p)
|
|
||||||
{return __table_.__emplace_hint_multi(__p.__i_);}
|
|
||||||
|
|
||||||
template <class _A0,
|
|
||||||
class = typename enable_if<is_constructible<value_type, _A0>::value>::type>
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
|
||||||
iterator emplace_hint(const_iterator __p, _A0&& __a0)
|
|
||||||
{return __table_.__emplace_hint_multi(__p.__i_, _VSTD::forward<_A0>(__a0));}
|
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
|
||||||
|
|
||||||
template <class _A0, class... _Args,
|
|
||||||
class = typename enable_if<is_constructible<key_type, _A0>::value>::type>
|
|
||||||
iterator emplace_hint(const_iterator __p, _A0&& __a0, _Args&&... __args);
|
|
||||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
@ -1543,14 +1526,27 @@ public:
|
|||||||
void reserve(size_type __n) {__table_.reserve(__n);}
|
void reserve(size_type __n) {__table_.reserve(__n);}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
template <class _A0, class... _Args,
|
__node_holder __construct_node();
|
||||||
class = typename enable_if<is_constructible<key_type, _A0>::value>::type>
|
template <class _A0>
|
||||||
__node_holder __construct_node(_A0&& __a0, _Args&&... __args);
|
typename enable_if
|
||||||
template <class _A0,
|
<
|
||||||
class = typename enable_if<is_constructible<value_type, _A0>::value>::type>
|
is_constructible<value_type, _A0>::value,
|
||||||
__node_holder __construct_node(_A0&& __a0);
|
__node_holder
|
||||||
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
>::type
|
||||||
|
__construct_node(_A0&& __a0);
|
||||||
|
template <class _A0>
|
||||||
|
typename enable_if
|
||||||
|
<
|
||||||
|
is_constructible<key_type, _A0>::value,
|
||||||
|
__node_holder
|
||||||
|
>::type
|
||||||
|
__construct_node(_A0&& __a0);
|
||||||
|
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
template <class _A0, class _A1, class ..._Args>
|
||||||
|
__node_holder __construct_node(_A0&& __a0, _A1&& __a1, _Args&& ...__args);
|
||||||
|
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||||
@ -1716,34 +1712,26 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(
|
|||||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
|
||||||
|
|
||||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||||
template <class _A0, class... _Args,
|
|
||||||
class // = typename enable_if<is_constructible<key_type, _A0>::value>::type
|
|
||||||
>
|
|
||||||
typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
|
typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
|
||||||
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(
|
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node()
|
||||||
_A0&& __a0, _Args&&... __args)
|
|
||||||
{
|
{
|
||||||
__node_allocator& __na = __table_.__node_alloc();
|
__node_allocator& __na = __table_.__node_alloc();
|
||||||
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
|
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
|
||||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.first),
|
__node_traits::construct(__na, _VSTD::addressof(__h->__value_));
|
||||||
_VSTD::forward<_A0>(__a0));
|
|
||||||
__h.get_deleter().__first_constructed = true;
|
__h.get_deleter().__first_constructed = true;
|
||||||
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second),
|
|
||||||
_VSTD::forward<_Args>(__args)...);
|
|
||||||
__h.get_deleter().__second_constructed = true;
|
__h.get_deleter().__second_constructed = true;
|
||||||
return __h;
|
return __h;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
|
||||||
|
|
||||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||||
template <class _A0,
|
template <class _A0>
|
||||||
class // = typename enable_if<is_constructible<value_type, _A0>::value>::type
|
typename enable_if
|
||||||
>
|
<
|
||||||
typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
|
is_constructible<pair<const _Key, _Tp>, _A0>::value,
|
||||||
|
typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
|
||||||
|
>::type
|
||||||
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0)
|
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0)
|
||||||
{
|
{
|
||||||
__node_allocator& __na = __table_.__node_alloc();
|
__node_allocator& __na = __table_.__node_alloc();
|
||||||
@ -1755,32 +1743,61 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0
|
|||||||
return __h;
|
return __h;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||||
|
template <class _A0>
|
||||||
|
typename enable_if
|
||||||
|
<
|
||||||
|
is_constructible<_Key, _A0>::value,
|
||||||
|
typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
|
||||||
|
>::type
|
||||||
|
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(_A0&& __a0)
|
||||||
|
{
|
||||||
|
__node_allocator& __na = __table_.__node_alloc();
|
||||||
|
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
|
||||||
|
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.first),
|
||||||
|
_VSTD::forward<_A0>(__a0));
|
||||||
|
__h.get_deleter().__first_constructed = true;
|
||||||
|
__node_traits::construct(__na, _VSTD::addressof(__h->__value_.second));
|
||||||
|
__h.get_deleter().__second_constructed = true;
|
||||||
|
return __h;
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||||
|
|
||||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||||
template <class _A0, class... _Args,
|
template <class _A0, class _A1, class ..._Args>
|
||||||
class // = typename enable_if<is_constructible<key_type, _A0>::value>::type
|
typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
|
||||||
>
|
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(
|
||||||
typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::iterator
|
_A0&& __a0, _A1&& __a1, _Args&&... __args)
|
||||||
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::emplace(_A0&& __a0, _Args&&... __args)
|
|
||||||
{
|
{
|
||||||
__node_holder __h = __construct_node(_VSTD::forward<_A0>(__a0),
|
__node_allocator& __na = __table_.__node_alloc();
|
||||||
_VSTD::forward<_Args>(__args)...);
|
__node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
|
||||||
|
__node_traits::construct(__na, _VSTD::addressof(__h->__value_),
|
||||||
|
_VSTD::forward<_A0>(__a0), _VSTD::forward<_A1>(__a1),
|
||||||
|
_VSTD::forward<_Args>(__args)...);
|
||||||
|
__h.get_deleter().__first_constructed = true;
|
||||||
|
__h.get_deleter().__second_constructed = true;
|
||||||
|
return __h;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||||
|
template <class... _Args>
|
||||||
|
typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::iterator
|
||||||
|
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::emplace(_Args&&... __args)
|
||||||
|
{
|
||||||
|
__node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
|
||||||
iterator __r = __table_.__node_insert_multi(__h.get());
|
iterator __r = __table_.__node_insert_multi(__h.get());
|
||||||
__h.release();
|
__h.release();
|
||||||
return __r;
|
return __r;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
|
||||||
template <class _A0, class... _Args,
|
template <class... _Args>
|
||||||
class // = typename enable_if<is_constructible<key_type, _A0>::value>::type
|
|
||||||
>
|
|
||||||
typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::iterator
|
typename unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::iterator
|
||||||
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::emplace_hint(
|
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::emplace_hint(
|
||||||
const_iterator __p, _A0&& __a0, _Args&&... __args)
|
const_iterator __p, _Args&&... __args)
|
||||||
{
|
{
|
||||||
__node_holder __h = __construct_node(_VSTD::forward<_A0>(__a0),
|
__node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
|
||||||
_VSTD::forward<_Args>(__args)...);
|
|
||||||
iterator __r = __table_.__node_insert_multi(__p.__i_, __h.get());
|
iterator __r = __table_.__node_insert_multi(__p.__i_, __h.get());
|
||||||
__h.release();
|
__h.release();
|
||||||
return __r;
|
return __r;
|
||||||
|
@ -233,8 +233,8 @@ struct _LIBCPP_VISIBLE pair
|
|||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
pair(const pair<_U1, _U2>& __p
|
pair(const pair<_U1, _U2>& __p
|
||||||
#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
||||||
,typename enable_if<is_constructible<_T1, _U1>::value &&
|
,typename enable_if<is_convertible<const _U1&, _T1>::value &&
|
||||||
is_constructible<_T2, _U2>::value>::type* = 0
|
is_convertible<const _U2&, _T2>::value>::type* = 0
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
: first(__p.first), second(__p.second) {}
|
: first(__p.first), second(__p.second) {}
|
||||||
@ -261,8 +261,8 @@ struct _LIBCPP_VISIBLE pair
|
|||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
|
|
||||||
template <class _U1, class _U2,
|
template <class _U1, class _U2,
|
||||||
class = typename enable_if<is_constructible<first_type, _U1 >::value &&
|
class = typename enable_if<is_convertible<_U1, first_type>::value &&
|
||||||
is_constructible<second_type, _U2>::value>::type>
|
is_convertible<_U2, second_type>::value>::type>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
pair(_U1&& __u1, _U2&& __u2)
|
pair(_U1&& __u1, _U2&& __u2)
|
||||||
: first(_VSTD::forward<_U1>(__u1)),
|
: first(_VSTD::forward<_U1>(__u1)),
|
||||||
@ -272,8 +272,8 @@ struct _LIBCPP_VISIBLE pair
|
|||||||
template<class _U1, class _U2>
|
template<class _U1, class _U2>
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
pair(pair<_U1, _U2>&& __p,
|
pair(pair<_U1, _U2>&& __p,
|
||||||
typename enable_if<is_constructible<_T1, _U1>::value &&
|
typename enable_if<is_convertible<_U1, _T1>::value &&
|
||||||
is_constructible<_T2, _U2>::value>::type* = 0)
|
is_convertible<_U2, _T2>::value>::type* = 0)
|
||||||
: first(_VSTD::forward<_U1>(__p.first)),
|
: first(_VSTD::forward<_U1>(__p.first)),
|
||||||
second(_VSTD::forward<_U2>(__p.second)) {}
|
second(_VSTD::forward<_U2>(__p.second)) {}
|
||||||
|
|
||||||
@ -419,7 +419,7 @@ swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
|
|||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
|
|
||||||
template <class _Tp> class reference_wrapper;
|
template <class _Tp> class _LIBCPP_VISIBLE reference_wrapper;
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
struct ___make_pair_return
|
struct ___make_pair_return
|
||||||
|
@ -29,7 +29,7 @@ public:
|
|||||||
valarray(const value_type& x, size_t n);
|
valarray(const value_type& x, size_t n);
|
||||||
valarray(const value_type* px, size_t n);
|
valarray(const value_type* px, size_t n);
|
||||||
valarray(const valarray& v);
|
valarray(const valarray& v);
|
||||||
valarray(valarray&& v);
|
valarray(valarray&& v) noexcept;
|
||||||
valarray(const slice_array<value_type>& sa);
|
valarray(const slice_array<value_type>& sa);
|
||||||
valarray(const gslice_array<value_type>& ga);
|
valarray(const gslice_array<value_type>& ga);
|
||||||
valarray(const mask_array<value_type>& ma);
|
valarray(const mask_array<value_type>& ma);
|
||||||
@ -39,7 +39,7 @@ public:
|
|||||||
|
|
||||||
// assignment:
|
// assignment:
|
||||||
valarray& operator=(const valarray& v);
|
valarray& operator=(const valarray& v);
|
||||||
valarray& operator=(valarray&& v);
|
valarray& operator=(valarray&& v) noexcept;
|
||||||
valarray& operator=(initializer_list<value_type> il);
|
valarray& operator=(initializer_list<value_type> il);
|
||||||
valarray& operator=(const value_type& x);
|
valarray& operator=(const value_type& x);
|
||||||
valarray& operator=(const slice_array<value_type>& sa);
|
valarray& operator=(const slice_array<value_type>& sa);
|
||||||
@ -91,7 +91,7 @@ public:
|
|||||||
valarray& operator>>=(const valarray& v);
|
valarray& operator>>=(const valarray& v);
|
||||||
|
|
||||||
// member functions:
|
// member functions:
|
||||||
void swap(valarray& v);
|
void swap(valarray& v) noexcept;
|
||||||
|
|
||||||
size_t size() const;
|
size_t size() const;
|
||||||
|
|
||||||
@ -231,7 +231,7 @@ public:
|
|||||||
indirect_array() = delete;
|
indirect_array() = delete;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class T> void swap(valarray<T>& x, valarray<T>& y);
|
template<class T> void swap(valarray<T>& x, valarray<T>& y) noexcept;
|
||||||
|
|
||||||
template<class T> valarray<T> operator* (const valarray<T>& x, const valarray<T>& y);
|
template<class T> valarray<T> operator* (const valarray<T>& x, const valarray<T>& y);
|
||||||
template<class T> valarray<T> operator* (const valarray<T>& x, const T& y);
|
template<class T> valarray<T> operator* (const valarray<T>& x, const T& y);
|
||||||
@ -354,7 +354,7 @@ template <class T> unspecified2 end(const valarray<T>& v);
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
template<class _Tp> class valarray;
|
template<class _Tp> class _LIBCPP_VISIBLE valarray;
|
||||||
|
|
||||||
class _LIBCPP_VISIBLE slice
|
class _LIBCPP_VISIBLE slice
|
||||||
{
|
{
|
||||||
@ -381,25 +381,29 @@ public:
|
|||||||
_LIBCPP_INLINE_VISIBILITY size_t stride() const {return __stride_;}
|
_LIBCPP_INLINE_VISIBILITY size_t stride() const {return __stride_;}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class _Tp> class slice_array;
|
template <class _Tp> class _LIBCPP_VISIBLE slice_array;
|
||||||
class gslice;
|
class _LIBCPP_VISIBLE gslice;
|
||||||
template <class _Tp> class gslice_array;
|
template <class _Tp> class _LIBCPP_VISIBLE gslice_array;
|
||||||
template <class _Tp> class mask_array;
|
template <class _Tp> class _LIBCPP_VISIBLE mask_array;
|
||||||
template <class _Tp> class indirect_array;
|
template <class _Tp> class _LIBCPP_VISIBLE indirect_array;
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
_Tp*
|
_Tp*
|
||||||
begin(valarray<_Tp>& __v);
|
begin(valarray<_Tp>& __v);
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
const _Tp*
|
const _Tp*
|
||||||
begin(const valarray<_Tp>& __v);
|
begin(const valarray<_Tp>& __v);
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
_Tp*
|
_Tp*
|
||||||
end(valarray<_Tp>& __v);
|
end(valarray<_Tp>& __v);
|
||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
const _Tp*
|
const _Tp*
|
||||||
end(const valarray<_Tp>& __v);
|
end(const valarray<_Tp>& __v);
|
||||||
|
|
||||||
@ -801,7 +805,7 @@ public:
|
|||||||
valarray(const value_type* __p, size_t __n);
|
valarray(const value_type* __p, size_t __n);
|
||||||
valarray(const valarray& __v);
|
valarray(const valarray& __v);
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
valarray(valarray&& __v);
|
valarray(valarray&& __v) _NOEXCEPT;
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||||
valarray(initializer_list<value_type> __il);
|
valarray(initializer_list<value_type> __il);
|
||||||
@ -815,7 +819,7 @@ public:
|
|||||||
// assignment:
|
// assignment:
|
||||||
valarray& operator=(const valarray& __v);
|
valarray& operator=(const valarray& __v);
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
valarray& operator=(valarray&& __v);
|
valarray& operator=(valarray&& __v) _NOEXCEPT;
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
||||||
valarray& operator=(initializer_list<value_type>);
|
valarray& operator=(initializer_list<value_type>);
|
||||||
@ -956,7 +960,7 @@ public:
|
|||||||
operator>>= (const _Expr& __v);
|
operator>>= (const _Expr& __v);
|
||||||
|
|
||||||
// member functions:
|
// member functions:
|
||||||
void swap(valarray& __v);
|
void swap(valarray& __v) _NOEXCEPT;
|
||||||
|
|
||||||
_LIBCPP_INLINE_VISIBILITY
|
_LIBCPP_INLINE_VISIBILITY
|
||||||
size_t size() const {return static_cast<size_t>(__end_ - __begin_);}
|
size_t size() const {return static_cast<size_t>(__end_ - __begin_);}
|
||||||
@ -2709,7 +2713,7 @@ valarray<_Tp>::valarray(const valarray& __v)
|
|||||||
|
|
||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
valarray<_Tp>::valarray(valarray&& __v)
|
valarray<_Tp>::valarray(valarray&& __v) _NOEXCEPT
|
||||||
: __begin_(__v.__begin_),
|
: __begin_(__v.__begin_),
|
||||||
__end_(__v.__end_)
|
__end_(__v.__end_)
|
||||||
{
|
{
|
||||||
@ -2886,7 +2890,7 @@ valarray<_Tp>::operator=(const valarray& __v)
|
|||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
valarray<_Tp>&
|
valarray<_Tp>&
|
||||||
valarray<_Tp>::operator=(valarray&& __v)
|
valarray<_Tp>::operator=(valarray&& __v) _NOEXCEPT
|
||||||
{
|
{
|
||||||
resize(0);
|
resize(0);
|
||||||
__begin_ = __v.__begin_;
|
__begin_ = __v.__begin_;
|
||||||
@ -3446,7 +3450,7 @@ valarray<_Tp>::operator>>=(const _Expr& __v)
|
|||||||
template <class _Tp>
|
template <class _Tp>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
void
|
void
|
||||||
valarray<_Tp>::swap(valarray& __v)
|
valarray<_Tp>::swap(valarray& __v) _NOEXCEPT
|
||||||
{
|
{
|
||||||
_VSTD::swap(__begin_, __v.__begin_);
|
_VSTD::swap(__begin_, __v.__begin_);
|
||||||
_VSTD::swap(__end_, __v.__end_);
|
_VSTD::swap(__end_, __v.__end_);
|
||||||
@ -3613,7 +3617,7 @@ valarray<_Tp>::resize(size_t __n, value_type __x)
|
|||||||
template<class _Tp>
|
template<class _Tp>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
void
|
void
|
||||||
swap(valarray<_Tp>& __x, valarray<_Tp>& __y)
|
swap(valarray<_Tp>& __x, valarray<_Tp>& __y) _NOEXCEPT
|
||||||
{
|
{
|
||||||
__x.swap(__y);
|
__x.swap(__y);
|
||||||
}
|
}
|
||||||
|
@ -1681,8 +1681,9 @@ vector<_Tp, _Allocator>::emplace(const_iterator __position, _Args&&... __args)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
value_type __tmp(_VSTD::forward<_Args>(__args)...);
|
||||||
__move_range(__p, this->__end_, __p + 1);
|
__move_range(__p, this->__end_, __p + 1);
|
||||||
*__p = value_type(_VSTD::forward<_Args>(__args)...);
|
*__p = _VSTD::move(__tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1970,6 +1971,7 @@ public:
|
|||||||
typedef allocator_traits<allocator_type> __alloc_traits;
|
typedef allocator_traits<allocator_type> __alloc_traits;
|
||||||
typedef typename __alloc_traits::size_type size_type;
|
typedef typename __alloc_traits::size_type size_type;
|
||||||
typedef typename __alloc_traits::difference_type difference_type;
|
typedef typename __alloc_traits::difference_type difference_type;
|
||||||
|
typedef size_type __storage_type;
|
||||||
typedef __bit_iterator<vector, false> pointer;
|
typedef __bit_iterator<vector, false> pointer;
|
||||||
typedef __bit_iterator<vector, true> const_pointer;
|
typedef __bit_iterator<vector, true> const_pointer;
|
||||||
#ifdef _LIBCPP_DEBUG
|
#ifdef _LIBCPP_DEBUG
|
||||||
@ -1991,7 +1993,6 @@ public:
|
|||||||
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
|
typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef size_type __storage_type;
|
|
||||||
typedef typename __alloc_traits::template
|
typedef typename __alloc_traits::template
|
||||||
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||||
rebind_alloc<__storage_type>
|
rebind_alloc<__storage_type>
|
||||||
@ -2317,7 +2318,7 @@ private:
|
|||||||
friend class __bit_const_reference<vector>;
|
friend class __bit_const_reference<vector>;
|
||||||
friend class __bit_iterator<vector, false>;
|
friend class __bit_iterator<vector, false>;
|
||||||
friend class __bit_iterator<vector, true>;
|
friend class __bit_iterator<vector, true>;
|
||||||
friend class __bit_array<vector>;
|
friend struct __bit_array<vector>;
|
||||||
friend struct _LIBCPP_VISIBLE hash<vector>;
|
friend struct _LIBCPP_VISIBLE hash<vector>;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2699,6 +2700,7 @@ vector<bool, _Allocator>::operator=(vector&& __v)
|
|||||||
{
|
{
|
||||||
__move_assign(__v, integral_constant<bool,
|
__move_assign(__v, integral_constant<bool,
|
||||||
__storage_traits::propagate_on_container_move_assignment::value>());
|
__storage_traits::propagate_on_container_move_assignment::value>());
|
||||||
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _Allocator>
|
template <class _Allocator>
|
||||||
|
@ -20,13 +20,13 @@ condition_variable::~condition_variable()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
condition_variable::notify_one()
|
condition_variable::notify_one() _NOEXCEPT
|
||||||
{
|
{
|
||||||
pthread_cond_signal(&__cv_);
|
pthread_cond_signal(&__cv_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
condition_variable::notify_all()
|
condition_variable::notify_all() _NOEXCEPT
|
||||||
{
|
{
|
||||||
pthread_cond_broadcast(&__cv_);
|
pthread_cond_broadcast(&__cv_);
|
||||||
}
|
}
|
||||||
@ -51,10 +51,22 @@ condition_variable::__do_timed_wait(unique_lock<mutex>& lk,
|
|||||||
__throw_system_error(EPERM,
|
__throw_system_error(EPERM,
|
||||||
"condition_variable::timed wait: mutex not locked");
|
"condition_variable::timed wait: mutex not locked");
|
||||||
nanoseconds d = tp.time_since_epoch();
|
nanoseconds d = tp.time_since_epoch();
|
||||||
|
if (d > nanoseconds(0x59682F000000E941))
|
||||||
|
d = nanoseconds(0x59682F000000E941);
|
||||||
timespec ts;
|
timespec ts;
|
||||||
seconds s = duration_cast<seconds>(d);
|
seconds s = duration_cast<seconds>(d);
|
||||||
ts.tv_sec = static_cast<decltype(ts.tv_sec)>(s.count());
|
typedef decltype(ts.tv_sec) ts_sec;
|
||||||
ts.tv_nsec = static_cast<decltype(ts.tv_nsec)>((d - s).count());
|
_LIBCPP_CONSTEXPR ts_sec ts_sec_max = numeric_limits<ts_sec>::max();
|
||||||
|
if (s.count() < ts_sec_max)
|
||||||
|
{
|
||||||
|
ts.tv_sec = static_cast<ts_sec>(s.count());
|
||||||
|
ts.tv_nsec = static_cast<decltype(ts.tv_nsec)>((d - s).count());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ts.tv_sec = ts_sec_max;
|
||||||
|
ts.tv_nsec = giga::num - 1;
|
||||||
|
}
|
||||||
int ec = pthread_cond_timedwait(&__cv_, lk.mutex()->native_handle(), &ts);
|
int ec = pthread_cond_timedwait(&__cv_, lk.mutex()->native_handle(), &ts);
|
||||||
if (ec != 0 && ec != ETIMEDOUT)
|
if (ec != 0 && ec != ETIMEDOUT)
|
||||||
__throw_system_error(ec, "condition_variable timed_wait failed");
|
__throw_system_error(ec, "condition_variable timed_wait failed");
|
||||||
|
@ -146,7 +146,11 @@ __libcpp_db::__insert_c(void* __c)
|
|||||||
size_t nc = __next_prime(2*static_cast<size_t>(__cend_ - __cbeg_) + 1);
|
size_t nc = __next_prime(2*static_cast<size_t>(__cend_ - __cbeg_) + 1);
|
||||||
__c_node** cbeg = (__c_node**)calloc(nc, sizeof(void*));
|
__c_node** cbeg = (__c_node**)calloc(nc, sizeof(void*));
|
||||||
if (cbeg == nullptr)
|
if (cbeg == nullptr)
|
||||||
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
throw bad_alloc();
|
throw bad_alloc();
|
||||||
|
#else
|
||||||
|
abort();
|
||||||
|
#endif
|
||||||
for (__c_node** p = __cbeg_; p != __cend_; ++p)
|
for (__c_node** p = __cbeg_; p != __cend_; ++p)
|
||||||
{
|
{
|
||||||
__c_node* q = *p;
|
__c_node* q = *p;
|
||||||
@ -167,7 +171,11 @@ __libcpp_db::__insert_c(void* __c)
|
|||||||
__c_node* p = __cbeg_[hc];
|
__c_node* p = __cbeg_[hc];
|
||||||
__c_node* r = __cbeg_[hc] = (__c_node*)malloc(sizeof(__c_node));
|
__c_node* r = __cbeg_[hc] = (__c_node*)malloc(sizeof(__c_node));
|
||||||
if (__cbeg_[hc] == nullptr)
|
if (__cbeg_[hc] == nullptr)
|
||||||
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
throw bad_alloc();
|
throw bad_alloc();
|
||||||
|
#else
|
||||||
|
abort();
|
||||||
|
#endif
|
||||||
r->__c_ = __c;
|
r->__c_ = __c;
|
||||||
r->__next_ = p;
|
r->__next_ = p;
|
||||||
++__csz_;
|
++__csz_;
|
||||||
@ -402,7 +410,11 @@ __c_node::__add(__i_node* i)
|
|||||||
nc = 1;
|
nc = 1;
|
||||||
__i_node** beg = (__i_node**)malloc(nc * sizeof(__i_node*));
|
__i_node** beg = (__i_node**)malloc(nc * sizeof(__i_node*));
|
||||||
if (beg == nullptr)
|
if (beg == nullptr)
|
||||||
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
throw bad_alloc();
|
throw bad_alloc();
|
||||||
|
#else
|
||||||
|
abort();
|
||||||
|
#endif
|
||||||
if (nc > 1)
|
if (nc > 1)
|
||||||
memcpy(beg, beg_, nc/2*sizeof(__i_node*));
|
memcpy(beg, beg_, nc/2*sizeof(__i_node*));
|
||||||
free(beg_);
|
free(beg_);
|
||||||
@ -424,7 +436,11 @@ __libcpp_db::__insert_iterator(void* __i)
|
|||||||
size_t nc = __next_prime(2*static_cast<size_t>(__iend_ - __ibeg_) + 1);
|
size_t nc = __next_prime(2*static_cast<size_t>(__iend_ - __ibeg_) + 1);
|
||||||
__i_node** ibeg = (__i_node**)calloc(nc, sizeof(void*));
|
__i_node** ibeg = (__i_node**)calloc(nc, sizeof(void*));
|
||||||
if (ibeg == nullptr)
|
if (ibeg == nullptr)
|
||||||
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
throw bad_alloc();
|
throw bad_alloc();
|
||||||
|
#else
|
||||||
|
abort();
|
||||||
|
#endif
|
||||||
for (__i_node** p = __ibeg_; p != __iend_; ++p)
|
for (__i_node** p = __ibeg_; p != __iend_; ++p)
|
||||||
{
|
{
|
||||||
__i_node* q = *p;
|
__i_node* q = *p;
|
||||||
@ -445,7 +461,11 @@ __libcpp_db::__insert_iterator(void* __i)
|
|||||||
__i_node* p = __ibeg_[hi];
|
__i_node* p = __ibeg_[hi];
|
||||||
__i_node* r = __ibeg_[hi] = (__i_node*)malloc(sizeof(__i_node));
|
__i_node* r = __ibeg_[hi] = (__i_node*)malloc(sizeof(__i_node));
|
||||||
if (r == nullptr)
|
if (r == nullptr)
|
||||||
|
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||||
throw bad_alloc();
|
throw bad_alloc();
|
||||||
|
#else
|
||||||
|
abort();
|
||||||
|
#endif
|
||||||
::new(r) __i_node(__i, p, nullptr);
|
::new(r) __i_node(__i, p, nullptr);
|
||||||
++__isz_;
|
++__isz_;
|
||||||
return r;
|
return r;
|
||||||
|
@ -10,6 +10,10 @@
|
|||||||
|
|
||||||
#include "exception"
|
#include "exception"
|
||||||
|
|
||||||
|
#ifndef __has_include
|
||||||
|
#define __has_include(inc) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#if __APPLE__
|
#if __APPLE__
|
||||||
#include <cxxabi.h>
|
#include <cxxabi.h>
|
||||||
|
|
||||||
@ -23,14 +27,16 @@
|
|||||||
#define __terminate_handler __cxxabiapple::__cxa_terminate_handler
|
#define __terminate_handler __cxxabiapple::__cxa_terminate_handler
|
||||||
#define __unexpected_handler __cxxabiapple::__cxa_unexpected_handler
|
#define __unexpected_handler __cxxabiapple::__cxa_unexpected_handler
|
||||||
#endif // _LIBCPPABI_VERSION
|
#endif // _LIBCPPABI_VERSION
|
||||||
#elif defined(LIBCXXRT)
|
#elif defined(LIBCXXRT) || __has_include(<cxxabi.h>)
|
||||||
#include <cxxabi.h>
|
#include <cxxabi.h>
|
||||||
using namespace __cxxabiv1;
|
using namespace __cxxabiv1;
|
||||||
#define HAVE_DEPENDENT_EH_ABI 1
|
#if defined(LIBCXXRT) || defined(_LIBCPPABI_VERSION)
|
||||||
#else // __APPLE__
|
#define HAVE_DEPENDENT_EH_ABI 1
|
||||||
|
#endif
|
||||||
|
#else // __has_include(<cxxabi.h>)
|
||||||
static std::terminate_handler __terminate_handler;
|
static std::terminate_handler __terminate_handler;
|
||||||
static std::unexpected_handler __unexpected_handler;
|
static std::unexpected_handler __unexpected_handler;
|
||||||
#endif // __APPLE__
|
#endif // __has_include(<cxxabi.h>)
|
||||||
|
|
||||||
namespace std
|
namespace std
|
||||||
{
|
{
|
||||||
@ -50,7 +56,7 @@ get_unexpected() _NOEXCEPT
|
|||||||
return __sync_fetch_and_add(&__unexpected_handler, (unexpected_handler)0);
|
return __sync_fetch_and_add(&__unexpected_handler, (unexpected_handler)0);
|
||||||
}
|
}
|
||||||
|
|
||||||
_ATTRIBUTE(noreturn)
|
_LIBCPP_NORETURN
|
||||||
void
|
void
|
||||||
unexpected()
|
unexpected()
|
||||||
{
|
{
|
||||||
@ -71,7 +77,7 @@ get_terminate() _NOEXCEPT
|
|||||||
return __sync_fetch_and_add(&__terminate_handler, (terminate_handler)0);
|
return __sync_fetch_and_add(&__terminate_handler, (terminate_handler)0);
|
||||||
}
|
}
|
||||||
|
|
||||||
_ATTRIBUTE(noreturn)
|
_LIBCPP_NORETURN
|
||||||
void
|
void
|
||||||
terminate() _NOEXCEPT
|
terminate() _NOEXCEPT
|
||||||
{
|
{
|
||||||
@ -96,12 +102,9 @@ terminate() _NOEXCEPT
|
|||||||
#ifndef LIBCXXRT
|
#ifndef LIBCXXRT
|
||||||
bool uncaught_exception() _NOEXCEPT
|
bool uncaught_exception() _NOEXCEPT
|
||||||
{
|
{
|
||||||
#if __APPLE__
|
#if __APPLE__ || defined(_LIBCPPABI_VERSION)
|
||||||
// on Darwin, there is a helper function so __cxa_get_globals is private
|
// on Darwin, there is a helper function so __cxa_get_globals is private
|
||||||
return __cxa_uncaught_exception();
|
return __cxa_uncaught_exception();
|
||||||
#elif LIBCXXRT
|
|
||||||
__cxa_eh_globals * globals = __cxa_get_globals();
|
|
||||||
return (globals->uncaughtExceptions != 0);
|
|
||||||
#else // __APPLE__
|
#else // __APPLE__
|
||||||
#warning uncaught_exception not yet implemented
|
#warning uncaught_exception not yet implemented
|
||||||
::abort();
|
::abort();
|
||||||
@ -181,7 +184,7 @@ nested_exception::~nested_exception() _NOEXCEPT
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
_ATTRIBUTE(noreturn)
|
_LIBCPP_NORETURN
|
||||||
void
|
void
|
||||||
nested_exception::rethrow_nested() const
|
nested_exception::rethrow_nested() const
|
||||||
{
|
{
|
||||||
@ -206,7 +209,7 @@ exception_ptr current_exception() _NOEXCEPT
|
|||||||
#endif // __APPLE__
|
#endif // __APPLE__
|
||||||
}
|
}
|
||||||
|
|
||||||
_ATTRIBUTE(noreturn)
|
_LIBCPP_NORETURN
|
||||||
void rethrow_exception(exception_ptr p)
|
void rethrow_exception(exception_ptr p)
|
||||||
{
|
{
|
||||||
#if HAVE_DEPENDENT_EH_ABI
|
#if HAVE_DEPENDENT_EH_ABI
|
||||||
|
@ -47,7 +47,7 @@ __future_error_category::message(int ev) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
const error_category&
|
const error_category&
|
||||||
future_category()
|
future_category() _NOEXCEPT
|
||||||
{
|
{
|
||||||
static __future_error_category __f;
|
static __future_error_category __f;
|
||||||
return __f;
|
return __f;
|
||||||
|
@ -401,7 +401,7 @@ ios_base::move(ios_base& rhs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ios_base::swap(ios_base& rhs)
|
ios_base::swap(ios_base& rhs) _NOEXCEPT
|
||||||
{
|
{
|
||||||
_VSTD::swap(__fmtflags_, rhs.__fmtflags_);
|
_VSTD::swap(__fmtflags_, rhs.__fmtflags_);
|
||||||
_VSTD::swap(__precision_, rhs.__precision_);
|
_VSTD::swap(__precision_, rhs.__precision_);
|
||||||
|
@ -13,21 +13,21 @@
|
|||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
alignas (__stdinbuf<char> ) static char __cin [sizeof(__stdinbuf <char>)];
|
_ALIGNAS_TYPE (__stdinbuf<char> ) static char __cin [sizeof(__stdinbuf <char>)];
|
||||||
alignas (__stdoutbuf<char>) static char __cout[sizeof(__stdoutbuf<char>)];
|
_ALIGNAS_TYPE (__stdoutbuf<char>) static char __cout[sizeof(__stdoutbuf<char>)];
|
||||||
alignas (__stdoutbuf<char>) static char __cerr[sizeof(__stdoutbuf<char>)];
|
_ALIGNAS_TYPE (__stdoutbuf<char>) static char __cerr[sizeof(__stdoutbuf<char>)];
|
||||||
alignas (__stdinbuf<wchar_t> ) static char __wcin [sizeof(__stdinbuf <wchar_t>)];
|
_ALIGNAS_TYPE (__stdinbuf<wchar_t> ) static char __wcin [sizeof(__stdinbuf <wchar_t>)];
|
||||||
alignas (__stdoutbuf<wchar_t>) static char __wcout[sizeof(__stdoutbuf<wchar_t>)];
|
_ALIGNAS_TYPE (__stdoutbuf<wchar_t>) static char __wcout[sizeof(__stdoutbuf<wchar_t>)];
|
||||||
alignas (__stdoutbuf<wchar_t>) static char __wcerr[sizeof(__stdoutbuf<wchar_t>)];
|
_ALIGNAS_TYPE (__stdoutbuf<wchar_t>) static char __wcerr[sizeof(__stdoutbuf<wchar_t>)];
|
||||||
|
|
||||||
alignas (istream) char cin [sizeof(istream)];
|
_ALIGNAS_TYPE (istream) char cin [sizeof(istream)];
|
||||||
alignas (ostream) char cout[sizeof(ostream)];
|
_ALIGNAS_TYPE (ostream) char cout[sizeof(ostream)];
|
||||||
alignas (ostream) char cerr[sizeof(ostream)];
|
_ALIGNAS_TYPE (ostream) char cerr[sizeof(ostream)];
|
||||||
alignas (ostream) char clog[sizeof(ostream)];
|
_ALIGNAS_TYPE (ostream) char clog[sizeof(ostream)];
|
||||||
alignas (wistream) char wcin [sizeof(wistream)];
|
_ALIGNAS_TYPE (wistream) char wcin [sizeof(wistream)];
|
||||||
alignas (wostream) char wcout[sizeof(wostream)];
|
_ALIGNAS_TYPE (wostream) char wcout[sizeof(wostream)];
|
||||||
alignas (wostream) char wcerr[sizeof(wostream)];
|
_ALIGNAS_TYPE (wostream) char wcerr[sizeof(wostream)];
|
||||||
alignas (wostream) char wclog[sizeof(wostream)];
|
_ALIGNAS_TYPE (wostream) char wclog[sizeof(wostream)];
|
||||||
|
|
||||||
ios_base::Init __start_std_streams;
|
ios_base::Init __start_std_streams;
|
||||||
|
|
||||||
|
@ -1052,17 +1052,17 @@ ctype_byname<wchar_t>::do_is(mask m, char_type c) const
|
|||||||
#ifdef _LIBCPP_WCTYPE_IS_MASK
|
#ifdef _LIBCPP_WCTYPE_IS_MASK
|
||||||
return static_cast<bool>(iswctype_l(c, m, __l));
|
return static_cast<bool>(iswctype_l(c, m, __l));
|
||||||
#else
|
#else
|
||||||
bool result = true;
|
bool result = false;
|
||||||
if (m & space && !iswspace_l(c, __l)) result = false;
|
if (m & space) result |= (iswspace_l(c, __l) != 0);
|
||||||
if (m & print && !iswprint_l(c, __l)) result = false;
|
if (m & print) result |= (iswprint_l(c, __l) != 0);
|
||||||
if (m & cntrl && !iswcntrl_l(c, __l)) result = false;
|
if (m & cntrl) result |= (iswcntrl_l(c, __l) != 0);
|
||||||
if (m & upper && !iswupper_l(c, __l)) result = false;
|
if (m & upper) result |= (iswupper_l(c, __l) != 0);
|
||||||
if (m & lower && !iswlower_l(c, __l)) result = false;
|
if (m & lower) result |= (iswlower_l(c, __l) != 0);
|
||||||
if (m & alpha && !iswalpha_l(c, __l)) result = false;
|
if (m & alpha) result |= (iswalpha_l(c, __l) != 0);
|
||||||
if (m & digit && !iswdigit_l(c, __l)) result = false;
|
if (m & digit) result |= (iswdigit_l(c, __l) != 0);
|
||||||
if (m & punct && !iswpunct_l(c, __l)) result = false;
|
if (m & punct) result |= (iswpunct_l(c, __l) != 0);
|
||||||
if (m & xdigit && !iswxdigit_l(c, __l)) result = false;
|
if (m & xdigit) result |= (iswxdigit_l(c, __l) != 0);
|
||||||
if (m & blank && !iswblank_l(c, __l)) result = false;
|
if (m & blank) result |= (iswblank_l(c, __l) != 0);
|
||||||
return result;
|
return result;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -1109,17 +1109,16 @@ ctype_byname<wchar_t>::do_scan_is(mask m, const char_type* low, const char_type*
|
|||||||
if (iswctype_l(*low, m, __l))
|
if (iswctype_l(*low, m, __l))
|
||||||
break;
|
break;
|
||||||
#else
|
#else
|
||||||
if (m & space && !iswspace_l(*low, __l)) continue;
|
if (m & space && iswspace_l(*low, __l)) break;
|
||||||
if (m & print && !iswprint_l(*low, __l)) continue;
|
if (m & print && iswprint_l(*low, __l)) break;
|
||||||
if (m & cntrl && !iswcntrl_l(*low, __l)) continue;
|
if (m & cntrl && iswcntrl_l(*low, __l)) break;
|
||||||
if (m & upper && !iswupper_l(*low, __l)) continue;
|
if (m & upper && iswupper_l(*low, __l)) break;
|
||||||
if (m & lower && !iswlower_l(*low, __l)) continue;
|
if (m & lower && iswlower_l(*low, __l)) break;
|
||||||
if (m & alpha && !iswalpha_l(*low, __l)) continue;
|
if (m & alpha && iswalpha_l(*low, __l)) break;
|
||||||
if (m & digit && !iswdigit_l(*low, __l)) continue;
|
if (m & digit && iswdigit_l(*low, __l)) break;
|
||||||
if (m & punct && !iswpunct_l(*low, __l)) continue;
|
if (m & punct && iswpunct_l(*low, __l)) break;
|
||||||
if (m & xdigit && !iswxdigit_l(*low, __l)) continue;
|
if (m & xdigit && iswxdigit_l(*low, __l)) break;
|
||||||
if (m & blank && !iswblank_l(*low, __l)) continue;
|
if (m & blank && iswblank_l(*low, __l)) break;
|
||||||
break;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return low;
|
return low;
|
||||||
@ -4865,7 +4864,7 @@ template <>
|
|||||||
void
|
void
|
||||||
__time_get_storage<char>::init(const ctype<char>& ct)
|
__time_get_storage<char>::init(const ctype<char>& ct)
|
||||||
{
|
{
|
||||||
tm t;
|
tm t = {0};
|
||||||
char buf[100];
|
char buf[100];
|
||||||
// __weeks_
|
// __weeks_
|
||||||
for (int i = 0; i < 7; ++i)
|
for (int i = 0; i < 7; ++i)
|
||||||
|
@ -7,7 +7,10 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#define _LIBCPP_BUILDING_MEMORY
|
||||||
#include "memory"
|
#include "memory"
|
||||||
|
#include "mutex"
|
||||||
|
#include "thread"
|
||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
@ -116,6 +119,53 @@ __shared_weak_count::__get_deleter(const type_info&) const _NOEXCEPT
|
|||||||
|
|
||||||
#endif // _LIBCPP_NO_RTTI
|
#endif // _LIBCPP_NO_RTTI
|
||||||
|
|
||||||
|
#if __has_feature(cxx_atomic)
|
||||||
|
|
||||||
|
static const std::size_t __sp_mut_count = 16;
|
||||||
|
static mutex mut_back[__sp_mut_count];
|
||||||
|
|
||||||
|
_LIBCPP_CONSTEXPR __sp_mut::__sp_mut(void* p) _NOEXCEPT
|
||||||
|
: _(p)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
__sp_mut::lock() _NOEXCEPT
|
||||||
|
{
|
||||||
|
mutex& m = *static_cast<mutex*>(_);
|
||||||
|
unsigned count = 0;
|
||||||
|
while (!m.try_lock())
|
||||||
|
{
|
||||||
|
if (++count > 16)
|
||||||
|
{
|
||||||
|
m.lock();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
this_thread::yield();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
__sp_mut::unlock() _NOEXCEPT
|
||||||
|
{
|
||||||
|
static_cast<mutex*>(_)->unlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
__sp_mut&
|
||||||
|
__get_sp_mut(const void* p)
|
||||||
|
{
|
||||||
|
static __sp_mut muts[__sp_mut_count]
|
||||||
|
{
|
||||||
|
&mut_back[ 0], &mut_back[ 1], &mut_back[ 2], &mut_back[ 3],
|
||||||
|
&mut_back[ 4], &mut_back[ 5], &mut_back[ 6], &mut_back[ 7],
|
||||||
|
&mut_back[ 8], &mut_back[ 9], &mut_back[10], &mut_back[11],
|
||||||
|
&mut_back[12], &mut_back[13], &mut_back[14], &mut_back[15]
|
||||||
|
};
|
||||||
|
return muts[hash<const void*>()(p) & (__sp_mut_count-1)];
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // __has_feature(cxx_atomic)
|
||||||
|
|
||||||
void
|
void
|
||||||
declare_reachable(void*)
|
declare_reachable(void*)
|
||||||
{
|
{
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
#define _LIBCPP_BUILDING_MUTEX
|
||||||
#include "mutex"
|
#include "mutex"
|
||||||
#include "limits"
|
#include "limits"
|
||||||
#include "system_error"
|
#include "system_error"
|
||||||
@ -32,13 +33,13 @@ mutex::lock()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
mutex::try_lock()
|
mutex::try_lock() _NOEXCEPT
|
||||||
{
|
{
|
||||||
return pthread_mutex_trylock(&__m_) == 0;
|
return pthread_mutex_trylock(&__m_) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mutex::unlock()
|
mutex::unlock() _NOEXCEPT
|
||||||
{
|
{
|
||||||
int ec = pthread_mutex_unlock(&__m_);
|
int ec = pthread_mutex_unlock(&__m_);
|
||||||
assert(ec == 0);
|
assert(ec == 0);
|
||||||
@ -90,14 +91,14 @@ recursive_mutex::lock()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
recursive_mutex::unlock()
|
recursive_mutex::unlock() _NOEXCEPT
|
||||||
{
|
{
|
||||||
int e = pthread_mutex_unlock(&__m_);
|
int e = pthread_mutex_unlock(&__m_);
|
||||||
assert(e == 0);
|
assert(e == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
recursive_mutex::try_lock()
|
recursive_mutex::try_lock() _NOEXCEPT
|
||||||
{
|
{
|
||||||
return pthread_mutex_trylock(&__m_) == 0;
|
return pthread_mutex_trylock(&__m_) == 0;
|
||||||
}
|
}
|
||||||
@ -124,7 +125,7 @@ timed_mutex::lock()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
timed_mutex::try_lock()
|
timed_mutex::try_lock() _NOEXCEPT
|
||||||
{
|
{
|
||||||
unique_lock<mutex> lk(__m_, try_to_lock);
|
unique_lock<mutex> lk(__m_, try_to_lock);
|
||||||
if (lk.owns_lock() && !__locked_)
|
if (lk.owns_lock() && !__locked_)
|
||||||
@ -136,7 +137,7 @@ timed_mutex::try_lock()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
timed_mutex::unlock()
|
timed_mutex::unlock() _NOEXCEPT
|
||||||
{
|
{
|
||||||
lock_guard<mutex> _(__m_);
|
lock_guard<mutex> _(__m_);
|
||||||
__locked_ = false;
|
__locked_ = false;
|
||||||
@ -175,7 +176,7 @@ recursive_timed_mutex::lock()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
recursive_timed_mutex::try_lock()
|
recursive_timed_mutex::try_lock() _NOEXCEPT
|
||||||
{
|
{
|
||||||
pthread_t id = pthread_self();
|
pthread_t id = pthread_self();
|
||||||
unique_lock<mutex> lk(__m_, try_to_lock);
|
unique_lock<mutex> lk(__m_, try_to_lock);
|
||||||
@ -191,7 +192,7 @@ recursive_timed_mutex::try_lock()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
recursive_timed_mutex::unlock()
|
recursive_timed_mutex::unlock() _NOEXCEPT
|
||||||
{
|
{
|
||||||
unique_lock<mutex> lk(__m_);
|
unique_lock<mutex> lk(__m_);
|
||||||
if (--__count_ == 0)
|
if (--__count_ == 0)
|
||||||
|
@ -11,6 +11,10 @@
|
|||||||
|
|
||||||
#include "new"
|
#include "new"
|
||||||
|
|
||||||
|
#ifndef __has_include
|
||||||
|
#define __has_include(inc) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#if __APPLE__
|
#if __APPLE__
|
||||||
#include <cxxabi.h>
|
#include <cxxabi.h>
|
||||||
|
|
||||||
@ -21,7 +25,12 @@
|
|||||||
#define __new_handler __cxxabiapple::__cxa_new_handler
|
#define __new_handler __cxxabiapple::__cxa_new_handler
|
||||||
#endif
|
#endif
|
||||||
#else // __APPLE__
|
#else // __APPLE__
|
||||||
static std::new_handler __new_handler;
|
#if defined(LIBCXXRT) || __has_include(<cxxabi.h>)
|
||||||
|
#include <cxxabi.h>
|
||||||
|
#endif // __has_include(<cxxabi.h>)
|
||||||
|
#ifndef _LIBCPPABI_VERSION
|
||||||
|
static std::new_handler __new_handler;
|
||||||
|
#endif // _LIBCPPABI_VERSION
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Implement all new and delete operators as weak definitions
|
// Implement all new and delete operators as weak definitions
|
||||||
|
@ -40,7 +40,7 @@ random_device::operator()()
|
|||||||
}
|
}
|
||||||
|
|
||||||
double
|
double
|
||||||
random_device::entropy() const
|
random_device::entropy() const _NOEXCEPT
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -16,8 +16,13 @@
|
|||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include "system_error"
|
#include "system_error"
|
||||||
|
|
||||||
// Use <cxxabi.h> to determine whether we're linking against libc++abi.
|
#ifndef __has_include
|
||||||
#if __has_include(<cxxabi.h>)
|
#define __has_include(inc) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if __APPLE__
|
||||||
|
#include <cxxabi.h>
|
||||||
|
#elif defined(LIBCXXRT) || __has_include(<cxxabi.h>)
|
||||||
#include <cxxabi.h>
|
#include <cxxabi.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -34,7 +39,7 @@ class __libcpp_nmstr
|
|||||||
const char* str_;
|
const char* str_;
|
||||||
|
|
||||||
typedef std::size_t unused_t;
|
typedef std::size_t unused_t;
|
||||||
typedef std::int32_t count_t;
|
typedef std::ptrdiff_t count_t;
|
||||||
|
|
||||||
static const std::ptrdiff_t offset = static_cast<std::ptrdiff_t>(2*sizeof(unused_t) +
|
static const std::ptrdiff_t offset = static_cast<std::ptrdiff_t>(2*sizeof(unused_t) +
|
||||||
sizeof(count_t));
|
sizeof(count_t));
|
||||||
@ -72,7 +77,7 @@ __libcpp_nmstr::operator=(const __libcpp_nmstr& s)
|
|||||||
const char* p = str_;
|
const char* p = str_;
|
||||||
str_ = s.str_;
|
str_ = s.str_;
|
||||||
__sync_add_and_fetch(&count(), 1);
|
__sync_add_and_fetch(&count(), 1);
|
||||||
if (__sync_add_and_fetch((count_t*)(p-sizeof(count_t)), -1) < 0)
|
if (__sync_add_and_fetch((count_t*)(p-sizeof(count_t)), count_t(-1)) < 0)
|
||||||
delete [] (p-offset);
|
delete [] (p-offset);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@ -80,7 +85,7 @@ __libcpp_nmstr::operator=(const __libcpp_nmstr& s)
|
|||||||
inline
|
inline
|
||||||
__libcpp_nmstr::~__libcpp_nmstr()
|
__libcpp_nmstr::~__libcpp_nmstr()
|
||||||
{
|
{
|
||||||
if (__sync_add_and_fetch(&count(), -1) < 0)
|
if (__sync_add_and_fetch(&count(), count_t(-1)) < 0)
|
||||||
delete [] (str_ - offset);
|
delete [] (str_ - offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,94 +0,0 @@
|
|||||||
// -*- C++ -*-
|
|
||||||
//===-------------------- support/win32/locale_win32.cpp ------------------===//
|
|
||||||
//
|
|
||||||
// The LLVM Compiler Infrastructure
|
|
||||||
//
|
|
||||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
|
||||||
// Source Licenses. See LICENSE.TXT for details.
|
|
||||||
//
|
|
||||||
//===----------------------------------------------------------------------===//
|
|
||||||
|
|
||||||
#include "support/win32/locale_win32.h"
|
|
||||||
|
|
||||||
#include <stdarg.h> // va_start, va_end
|
|
||||||
|
|
||||||
// FIXME: base currently unused. Needs manual work to construct the new locale
|
|
||||||
locale_t newlocale( int mask, const char * locale, locale_t /*base*/ )
|
|
||||||
{
|
|
||||||
return _create_locale( mask, locale );
|
|
||||||
}
|
|
||||||
locale_t uselocale( locale_t newloc )
|
|
||||||
{
|
|
||||||
locale_t old_locale = _get_current_locale();
|
|
||||||
// uselocale sets the thread's locale by definition, so unconditionally use thread-local locale
|
|
||||||
_configthreadlocale( _ENABLE_PER_THREAD_LOCALE );
|
|
||||||
// uselocale sets all categories
|
|
||||||
setlocale( LC_ALL, newloc->locinfo->lc_category[LC_ALL].locale );
|
|
||||||
// uselocale returns the old locale_t
|
|
||||||
return old_locale;
|
|
||||||
}
|
|
||||||
lconv *localeconv_l( locale_t loc )
|
|
||||||
{
|
|
||||||
__locale_raii __current( uselocale(loc), uselocale );
|
|
||||||
return localeconv();
|
|
||||||
}
|
|
||||||
size_t mbrlen_l( const char *__restrict__ s, size_t n,
|
|
||||||
mbstate_t *__restrict__ ps, locale_t loc )
|
|
||||||
{
|
|
||||||
__locale_raii __current( uselocale(loc), uselocale );
|
|
||||||
return mbrlen( s, n, ps );
|
|
||||||
}
|
|
||||||
size_t mbsrtowcs_l( wchar_t *__restrict__ dst, const char **__restrict__ src,
|
|
||||||
size_t len, mbstate_t *__restrict__ ps, locale_t loc )
|
|
||||||
{
|
|
||||||
__locale_raii __current( uselocale(loc), uselocale );
|
|
||||||
return mbsrtowcs( dst, src, len, ps );
|
|
||||||
}
|
|
||||||
size_t wcrtomb_l( char *__restrict__ s, wchar_t wc, mbstate_t *__restrict__ ps,
|
|
||||||
locale_t loc )
|
|
||||||
{
|
|
||||||
__locale_raii __current( uselocale(loc), uselocale );
|
|
||||||
return wcrtomb( s, wc, ps );
|
|
||||||
}
|
|
||||||
size_t mbrtowc_l( wchar_t *__restrict__ pwc, const char *__restrict__ s,
|
|
||||||
size_t n, mbstate_t *__restrict__ ps, locale_t loc )
|
|
||||||
{
|
|
||||||
__locale_raii __current( uselocale(loc), uselocale );
|
|
||||||
return mbrtowc( pwc, s, n, ps );
|
|
||||||
}
|
|
||||||
size_t mbsnrtowcs_l( wchar_t *__restrict__ dst, const char **__restrict__ src,
|
|
||||||
size_t nms, size_t len, mbstate_t *__restrict__ ps, locale_t loc )
|
|
||||||
{
|
|
||||||
__locale_raii __current( uselocale(loc), uselocale );
|
|
||||||
return mbsnrtowcs( dst, src, nms, len, ps );
|
|
||||||
}
|
|
||||||
size_t wcsnrtombs_l( char *__restrict__ dst, const wchar_t **__restrict__ src,
|
|
||||||
size_t nwc, size_t len, mbstate_t *__restrict__ ps, locale_t loc )
|
|
||||||
{
|
|
||||||
__locale_raii __current( uselocale(loc), uselocale );
|
|
||||||
return wcsnrtombs( dst, src, nwc, len, ps );
|
|
||||||
}
|
|
||||||
wint_t btowc_l( int c, locale_t loc )
|
|
||||||
{
|
|
||||||
__locale_raii __current( uselocale(loc), uselocale );
|
|
||||||
return btowc( c );
|
|
||||||
}
|
|
||||||
int wctob_l( wint_t c, locale_t loc )
|
|
||||||
{
|
|
||||||
__locale_raii __current( uselocale(loc), uselocale );
|
|
||||||
return wctob( c );
|
|
||||||
}
|
|
||||||
|
|
||||||
int asprintf_l( char **ret, locale_t loc, const char *format, ... )
|
|
||||||
{
|
|
||||||
va_list ap;
|
|
||||||
va_start( ap, format );
|
|
||||||
int result = vasprintf_l( ret, loc, format, ap );
|
|
||||||
va_end(ap);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
int vasprintf_l( char **ret, locale_t loc, const char *format, va_list ap )
|
|
||||||
{
|
|
||||||
__locale_raii __current( uselocale(loc), uselocale );
|
|
||||||
return vasprintf( ret, format, ap );
|
|
||||||
}
|
|
@ -1,70 +0,0 @@
|
|||||||
// -*- C++ -*-
|
|
||||||
//===----------------------- support/win32/support.h ----------------------===//
|
|
||||||
//
|
|
||||||
// The LLVM Compiler Infrastructure
|
|
||||||
//
|
|
||||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
|
||||||
// Source Licenses. See LICENSE.TXT for details.
|
|
||||||
//
|
|
||||||
//===----------------------------------------------------------------------===//
|
|
||||||
|
|
||||||
#include <support/win32/support.h>
|
|
||||||
#include <stdarg.h> // va_start, va_end
|
|
||||||
#include <stddef.h> // size_t
|
|
||||||
#include <stdlib.h> // malloc
|
|
||||||
#include <stdio.h> // vsprintf, vsnprintf
|
|
||||||
#include <string.h> // strcpy, wcsncpy
|
|
||||||
|
|
||||||
int asprintf(char **sptr, const char *__restrict fmt, ...)
|
|
||||||
{
|
|
||||||
va_list ap;
|
|
||||||
va_start(ap, fmt);
|
|
||||||
int result = vasprintf(sptr, fmt, ap);
|
|
||||||
va_end(ap);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
int vasprintf( char **sptr, const char *__restrict fmt, va_list ap )
|
|
||||||
{
|
|
||||||
*sptr = NULL;
|
|
||||||
int count = vsnprintf( *sptr, 0, fmt, ap );
|
|
||||||
if( (count >= 0) && ((*sptr = (char*)malloc(count+1)) != NULL) )
|
|
||||||
{
|
|
||||||
vsprintf( *sptr, fmt, ap );
|
|
||||||
sptr[count] = '\0';
|
|
||||||
}
|
|
||||||
|
|
||||||
return count;
|
|
||||||
}
|
|
||||||
|
|
||||||
// FIXME: use wcrtomb and avoid copy
|
|
||||||
// use mbsrtowcs which is available, first copy first nwc elements of src
|
|
||||||
size_t mbsnrtowcs( wchar_t *__restrict dst, const char **__restrict src,
|
|
||||||
size_t nmc, size_t len, mbstate_t *__restrict ps )
|
|
||||||
{
|
|
||||||
char* local_src = new char[nmc+1];
|
|
||||||
char* nmcsrc = local_src;
|
|
||||||
strncpy( nmcsrc, *src, nmc );
|
|
||||||
nmcsrc[nmc] = '\0';
|
|
||||||
const size_t result = mbsrtowcs( dst, const_cast<const char **>(&nmcsrc), len, ps );
|
|
||||||
// propagate error
|
|
||||||
if( nmcsrc == NULL )
|
|
||||||
*src = NULL;
|
|
||||||
delete[] local_src;
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
// FIXME: use wcrtomb and avoid copy
|
|
||||||
// use wcsrtombs which is available, first copy first nwc elements of src
|
|
||||||
size_t wcsnrtombs( char *__restrict dst, const wchar_t **__restrict src,
|
|
||||||
size_t nwc, size_t len, mbstate_t *__restrict ps )
|
|
||||||
{
|
|
||||||
wchar_t* local_src = new wchar_t[nwc];
|
|
||||||
wchar_t* nwcsrc = local_src;
|
|
||||||
wcsncpy(nwcsrc, *src, nwc);
|
|
||||||
nwcsrc[nwc] = '\0';
|
|
||||||
const size_t result = wcsrtombs( dst, const_cast<const wchar_t **>(&nwcsrc), len, ps );
|
|
||||||
// propogate error
|
|
||||||
if( nwcsrc == NULL )
|
|
||||||
*src = NULL;
|
|
||||||
delete[] nwcsrc;
|
|
||||||
return result;
|
|
||||||
}
|
|
@ -11,10 +11,15 @@
|
|||||||
#include "exception"
|
#include "exception"
|
||||||
#include "vector"
|
#include "vector"
|
||||||
#include "future"
|
#include "future"
|
||||||
|
#include "limits"
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#if !_WIN32 && !__sun__
|
#if !_WIN32
|
||||||
|
#if !__sun__ && !__linux__
|
||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
#endif // _WIN32
|
#else
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif // !__sun__ && !__linux__
|
||||||
|
#endif // !_WIN32
|
||||||
|
|
||||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||||
|
|
||||||
@ -52,7 +57,7 @@ thread::detach()
|
|||||||
}
|
}
|
||||||
|
|
||||||
unsigned
|
unsigned
|
||||||
thread::hardware_concurrency()
|
thread::hardware_concurrency() _NOEXCEPT
|
||||||
{
|
{
|
||||||
#if defined(CTL_HW) && defined(HW_NCPU)
|
#if defined(CTL_HW) && defined(HW_NCPU)
|
||||||
unsigned n;
|
unsigned n;
|
||||||
@ -60,6 +65,11 @@ thread::hardware_concurrency()
|
|||||||
std::size_t s = sizeof(n);
|
std::size_t s = sizeof(n);
|
||||||
sysctl(mib, 2, &n, &s, 0, 0);
|
sysctl(mib, 2, &n, &s, 0, 0);
|
||||||
return n;
|
return n;
|
||||||
|
#elif defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L) && defined(_SC_NPROCESSORS_ONLN)
|
||||||
|
long result = sysconf(_SC_NPROCESSORS_ONLN);
|
||||||
|
if (result < 0 || result > UINT_MAX)
|
||||||
|
result = 0;
|
||||||
|
return result;
|
||||||
#else // defined(CTL_HW) && defined(HW_NCPU)
|
#else // defined(CTL_HW) && defined(HW_NCPU)
|
||||||
// TODO: grovel through /proc or check cpuid on x86 and similar
|
// TODO: grovel through /proc or check cpuid on x86 and similar
|
||||||
// instructions on other architectures.
|
// instructions on other architectures.
|
||||||
@ -74,11 +84,22 @@ void
|
|||||||
sleep_for(const chrono::nanoseconds& ns)
|
sleep_for(const chrono::nanoseconds& ns)
|
||||||
{
|
{
|
||||||
using namespace chrono;
|
using namespace chrono;
|
||||||
if (ns >= nanoseconds::zero())
|
if (ns > nanoseconds::zero())
|
||||||
{
|
{
|
||||||
|
seconds s = duration_cast<seconds>(ns);
|
||||||
timespec ts;
|
timespec ts;
|
||||||
ts.tv_sec = static_cast<decltype(ts.tv_sec)>(duration_cast<seconds>(ns).count());
|
typedef decltype(ts.tv_sec) ts_sec;
|
||||||
ts.tv_nsec = static_cast<decltype(ts.tv_nsec)>((ns - seconds(ts.tv_sec)).count());
|
_LIBCPP_CONSTEXPR ts_sec ts_sec_max = numeric_limits<ts_sec>::max();
|
||||||
|
if (s.count() < ts_sec_max)
|
||||||
|
{
|
||||||
|
ts.tv_sec = static_cast<ts_sec>(s.count());
|
||||||
|
ts.tv_nsec = static_cast<decltype(ts.tv_nsec)>((ns-s).count());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ts.tv_sec = ts_sec_max;
|
||||||
|
ts.tv_nsec = giga::num - 1;
|
||||||
|
}
|
||||||
nanosleep(&ts, 0);
|
nanosleep(&ts, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,8 +7,15 @@
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#ifndef __has_include
|
||||||
|
#define __has_include(inc) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#if __APPLE__
|
#if __APPLE__
|
||||||
#include <cxxabi.h>
|
#include <cxxabi.h>
|
||||||
|
#elif defined(LIBCXXRT) || __has_include(<cxxabi.h>)
|
||||||
|
#include <cxxabi.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "typeinfo"
|
#include "typeinfo"
|
||||||
|
Loading…
Reference in New Issue
Block a user