Merge libc++ trunk r321017 to contrib/libc++.
This commit is contained in:
commit
b2c7081bd7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/projects/clang600-import/; revision=327039
@ -41,6 +41,10 @@ N: Jonathan B Coe
|
||||
E: jbcoe@me.com
|
||||
D: Implementation of propagate_const.
|
||||
|
||||
N: Glen Joseph Fernandes
|
||||
E: glenjofe@gmail.com
|
||||
D: Implementation of to_address.
|
||||
|
||||
N: Eric Fiselier
|
||||
E: eric@efcs.ca
|
||||
D: LFTS support, patches and bug fixes.
|
||||
|
@ -33,7 +33,7 @@
|
||||
#define _GNUC_VER_NEW 0
|
||||
#endif
|
||||
|
||||
#define _LIBCPP_VERSION 5000
|
||||
#define _LIBCPP_VERSION 6000
|
||||
|
||||
#ifndef _LIBCPP_ABI_VERSION
|
||||
#define _LIBCPP_ABI_VERSION 1
|
||||
@ -45,6 +45,8 @@
|
||||
#define _LIBCPP_OBJECT_FORMAT_MACHO 1
|
||||
#elif defined(_WIN32)
|
||||
#define _LIBCPP_OBJECT_FORMAT_COFF 1
|
||||
#elif defined(__wasm__)
|
||||
#define _LIBCPP_OBJECT_FORMAT_WASM 1
|
||||
#else
|
||||
#error Unknown object file format
|
||||
#endif
|
||||
@ -55,11 +57,11 @@
|
||||
#define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
|
||||
// Fix deque iterator type in order to support incomplete types.
|
||||
#define _LIBCPP_ABI_INCOMPLETE_TYPES_IN_DEQUE
|
||||
// Fix undefined behavior in how std::list stores it's linked nodes.
|
||||
// Fix undefined behavior in how std::list stores its linked nodes.
|
||||
#define _LIBCPP_ABI_LIST_REMOVE_NODE_POINTER_UB
|
||||
// Fix undefined behavior in how __tree stores its end and parent nodes.
|
||||
#define _LIBCPP_ABI_TREE_REMOVE_NODE_POINTER_UB
|
||||
// Fix undefined behavior in how __hash_table stores it's pointer types
|
||||
// Fix undefined behavior in how __hash_table stores its pointer types.
|
||||
#define _LIBCPP_ABI_FIX_UNORDERED_NODE_POINTER_UB
|
||||
#define _LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB
|
||||
#define _LIBCPP_ABI_FIX_UNORDERED_CONTAINER_SIZE_TYPE
|
||||
@ -76,9 +78,11 @@
|
||||
// its vtable and typeinfo to libc++ rather than having all other libraries
|
||||
// using that class define their own copies.
|
||||
#define _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
|
||||
|
||||
// Enable optimized version of __do_get_(un)signed which avoids redundant copies.
|
||||
#define _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET
|
||||
// Use the smallest possible integer type to represent the index of the variant.
|
||||
// Previously libc++ used "unsigned int" exclusivly.
|
||||
#define _LIBCPP_ABI_VARIANT_INDEX_TYPE_OPTIMIZATION
|
||||
#elif _LIBCPP_ABI_VERSION == 1
|
||||
#if !defined(_LIBCPP_OBJECT_FORMAT_COFF)
|
||||
// Enable compiling copies of now inline methods into the dylib to support
|
||||
@ -121,6 +125,9 @@
|
||||
#ifndef __has_feature
|
||||
#define __has_feature(__x) 0
|
||||
#endif
|
||||
#ifndef __has_cpp_attribute
|
||||
#define __has_cpp_attribute(__x) 0
|
||||
#endif
|
||||
// '__is_identifier' returns '0' if '__x' is a reserved identifier provided by
|
||||
// the compiler and '1' otherwise.
|
||||
#ifndef __is_identifier
|
||||
@ -157,11 +164,21 @@
|
||||
|
||||
// FIXME: ABI detection should be done via compiler builtin macros. This
|
||||
// is just a placeholder until Clang implements such macros. For now assume
|
||||
// that Windows compilers pretending to be MSVC++ target the microsoft ABI.
|
||||
#if defined(_WIN32) && defined(_MSC_VER)
|
||||
// that Windows compilers pretending to be MSVC++ target the Microsoft ABI,
|
||||
// and allow the user to explicitly specify the ABI to handle cases where this
|
||||
// heuristic falls short.
|
||||
#if defined(_LIBCPP_ABI_FORCE_ITANIUM) && defined(_LIBCPP_ABI_FORCE_MICROSOFT)
|
||||
# error "Only one of _LIBCPP_ABI_FORCE_ITANIUM and _LIBCPP_ABI_FORCE_MICROSOFT can be defined"
|
||||
#elif defined(_LIBCPP_ABI_FORCE_ITANIUM)
|
||||
# define _LIBCPP_ABI_ITANIUM
|
||||
#elif defined(_LIBCPP_ABI_FORCE_MICROSOFT)
|
||||
# define _LIBCPP_ABI_MICROSOFT
|
||||
#else
|
||||
# if defined(_WIN32) && defined(_MSC_VER)
|
||||
# define _LIBCPP_ABI_MICROSOFT
|
||||
# else
|
||||
# define _LIBCPP_ABI_ITANIUM
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// Need to detect which libc we're using if we're on Linux.
|
||||
@ -174,36 +191,30 @@
|
||||
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
#if __LITTLE_ENDIAN__
|
||||
#define _LIBCPP_LITTLE_ENDIAN 1
|
||||
#define _LIBCPP_BIG_ENDIAN 0
|
||||
#define _LIBCPP_LITTLE_ENDIAN
|
||||
#endif // __LITTLE_ENDIAN__
|
||||
#endif // __LITTLE_ENDIAN__
|
||||
|
||||
#ifdef __BIG_ENDIAN__
|
||||
#if __BIG_ENDIAN__
|
||||
#define _LIBCPP_LITTLE_ENDIAN 0
|
||||
#define _LIBCPP_BIG_ENDIAN 1
|
||||
#define _LIBCPP_BIG_ENDIAN
|
||||
#endif // __BIG_ENDIAN__
|
||||
#endif // __BIG_ENDIAN__
|
||||
|
||||
#ifdef __BYTE_ORDER__
|
||||
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||
#define _LIBCPP_LITTLE_ENDIAN 1
|
||||
#define _LIBCPP_BIG_ENDIAN 0
|
||||
#define _LIBCPP_LITTLE_ENDIAN
|
||||
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
||||
#define _LIBCPP_LITTLE_ENDIAN 0
|
||||
#define _LIBCPP_BIG_ENDIAN 1
|
||||
#define _LIBCPP_BIG_ENDIAN
|
||||
#endif // __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
||||
#endif // __BYTE_ORDER__
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
# include <sys/endian.h>
|
||||
# if _BYTE_ORDER == _LITTLE_ENDIAN
|
||||
# define _LIBCPP_LITTLE_ENDIAN 1
|
||||
# define _LIBCPP_BIG_ENDIAN 0
|
||||
# define _LIBCPP_LITTLE_ENDIAN
|
||||
# else // _BYTE_ORDER == _LITTLE_ENDIAN
|
||||
# define _LIBCPP_LITTLE_ENDIAN 0
|
||||
# define _LIBCPP_BIG_ENDIAN 1
|
||||
# define _LIBCPP_BIG_ENDIAN
|
||||
# endif // _BYTE_ORDER == _LITTLE_ENDIAN
|
||||
# ifndef __LONG_LONG_SUPPORTED
|
||||
# define _LIBCPP_HAS_NO_LONG_LONG
|
||||
@ -213,19 +224,16 @@
|
||||
#ifdef __NetBSD__
|
||||
# include <sys/endian.h>
|
||||
# if _BYTE_ORDER == _LITTLE_ENDIAN
|
||||
# define _LIBCPP_LITTLE_ENDIAN 1
|
||||
# define _LIBCPP_BIG_ENDIAN 0
|
||||
# define _LIBCPP_LITTLE_ENDIAN
|
||||
# else // _BYTE_ORDER == _LITTLE_ENDIAN
|
||||
# define _LIBCPP_LITTLE_ENDIAN 0
|
||||
# define _LIBCPP_BIG_ENDIAN 1
|
||||
# define _LIBCPP_BIG_ENDIAN
|
||||
# endif // _BYTE_ORDER == _LITTLE_ENDIAN
|
||||
# define _LIBCPP_HAS_QUICK_EXIT
|
||||
#endif // __NetBSD__
|
||||
|
||||
#if defined(_WIN32)
|
||||
# define _LIBCPP_WIN32API
|
||||
# define _LIBCPP_LITTLE_ENDIAN 1
|
||||
# define _LIBCPP_BIG_ENDIAN 0
|
||||
# define _LIBCPP_LITTLE_ENDIAN
|
||||
# define _LIBCPP_SHORT_WCHAR 1
|
||||
// Both MinGW and native MSVC provide a "MSVC"-like enviroment
|
||||
# define _LIBCPP_MSVCRT_LIKE
|
||||
@ -255,11 +263,9 @@
|
||||
#ifdef __sun__
|
||||
# include <sys/isa_defs.h>
|
||||
# ifdef _LITTLE_ENDIAN
|
||||
# define _LIBCPP_LITTLE_ENDIAN 1
|
||||
# define _LIBCPP_BIG_ENDIAN 0
|
||||
# define _LIBCPP_LITTLE_ENDIAN
|
||||
# else
|
||||
# define _LIBCPP_LITTLE_ENDIAN 0
|
||||
# define _LIBCPP_BIG_ENDIAN 1
|
||||
# define _LIBCPP_BIG_ENDIAN
|
||||
# endif
|
||||
#endif // __sun__
|
||||
|
||||
@ -269,6 +275,8 @@
|
||||
// random data even when using sandboxing mechanisms such as chroots,
|
||||
// Capsicum, etc.
|
||||
# define _LIBCPP_USING_ARC4_RANDOM
|
||||
#elif defined(__Fuchsia__)
|
||||
# define _LIBCPP_USING_GETENTROPY
|
||||
#elif defined(__native_client__)
|
||||
// NaCl's sandbox (which PNaCl also runs in) doesn't allow filesystem access,
|
||||
// including accesses to the special files under /dev. C++11's
|
||||
@ -280,18 +288,16 @@
|
||||
# define _LIBCPP_USING_DEV_RANDOM
|
||||
#endif
|
||||
|
||||
#if !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN)
|
||||
#if !defined(_LIBCPP_LITTLE_ENDIAN) && !defined(_LIBCPP_BIG_ENDIAN)
|
||||
# include <endian.h>
|
||||
# if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
# define _LIBCPP_LITTLE_ENDIAN 1
|
||||
# define _LIBCPP_BIG_ENDIAN 0
|
||||
# define _LIBCPP_LITTLE_ENDIAN
|
||||
# elif __BYTE_ORDER == __BIG_ENDIAN
|
||||
# define _LIBCPP_LITTLE_ENDIAN 0
|
||||
# define _LIBCPP_BIG_ENDIAN 1
|
||||
# define _LIBCPP_BIG_ENDIAN
|
||||
# else // __BYTE_ORDER == __BIG_ENDIAN
|
||||
# error unable to determine endian
|
||||
# endif
|
||||
#endif // !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN)
|
||||
#endif // !defined(_LIBCPP_LITTLE_ENDIAN) && !defined(_LIBCPP_BIG_ENDIAN)
|
||||
|
||||
#if __has_attribute(__no_sanitize__) && !defined(_LIBCPP_COMPILER_GCC)
|
||||
#define _LIBCPP_NO_CFI __attribute__((__no_sanitize__("cfi")))
|
||||
@ -454,6 +460,10 @@ namespace std {
|
||||
#define _LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK __attribute__((__no_sanitize__("unsigned-integer-overflow")))
|
||||
#endif
|
||||
|
||||
#if __has_builtin(__builtin_launder)
|
||||
#define _LIBCPP_COMPILER_HAS_BUILTIN_LAUNDER
|
||||
#endif
|
||||
|
||||
#elif defined(_LIBCPP_COMPILER_GCC)
|
||||
|
||||
#define _ALIGNAS(x) __attribute__((__aligned__(x)))
|
||||
@ -536,6 +546,10 @@ namespace std {
|
||||
#define _LIBCPP_HAS_NO_ASAN
|
||||
#endif
|
||||
|
||||
#if _GNUC_VER >= 700
|
||||
#define _LIBCPP_COMPILER_HAS_BUILTIN_LAUNDER
|
||||
#endif
|
||||
|
||||
#elif defined(_LIBCPP_COMPILER_MSVC)
|
||||
|
||||
#define _LIBCPP_TOSTRING2(x) #x
|
||||
@ -880,7 +894,7 @@ template <unsigned> struct __static_assert_check {};
|
||||
#define _LIBCPP_NONUNIQUE_RTTI_BIT (1ULL << 63)
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_LIBCPP_MSVCRT) || \
|
||||
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_LIBCPP_MSVCRT_LIKE) || \
|
||||
defined(__sun__) || defined(__NetBSD__) || defined(__CloudABI__)
|
||||
#define _LIBCPP_LOCALE__L_EXTENSIONS 1
|
||||
#endif
|
||||
@ -954,6 +968,18 @@ template <unsigned> struct __static_assert_check {};
|
||||
#define _LIBCPP_CONSTEXPR_AFTER_CXX14
|
||||
#endif
|
||||
|
||||
#if _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR)
|
||||
#define _LIBCPP_CONSTEXPR_AFTER_CXX17 constexpr
|
||||
#else
|
||||
#define _LIBCPP_CONSTEXPR_AFTER_CXX17
|
||||
#endif
|
||||
|
||||
#if __has_cpp_attribute(nodiscard) && _LIBCPP_STD_VER > 17 && !defined(_LIBCPP_DISABLE_NODISCARD_AFTER_CXX17)
|
||||
#define _LIBCPP_NODISCARD_AFTER_CXX17 [[nodiscard]]
|
||||
#else
|
||||
#define _LIBCPP_NODISCARD_AFTER_CXX17
|
||||
#endif
|
||||
|
||||
// FIXME: Remove all usages of this macro once compilers catch up.
|
||||
#if !defined(__cpp_inline_variables) || (__cpp_inline_variables < 201606L)
|
||||
# define _LIBCPP_HAS_NO_INLINE_VARIABLES
|
||||
@ -1241,6 +1267,13 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
|
||||
# endif
|
||||
#endif // defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO)
|
||||
|
||||
#if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY)
|
||||
# if defined(_DLL)
|
||||
# pragma(lib, "c++.lib")
|
||||
# else
|
||||
# pragma(lib, "libc++.lib")
|
||||
# endif
|
||||
#endif // defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY)
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
|
@ -1 +1 @@
|
||||
5000
|
||||
6000
|
||||
|
@ -49,7 +49,7 @@
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !defined(_LIBCPP_LOCALE__L_EXTENSIONS) || defined(_LIBCPP_MSVCRT)
|
||||
#if !defined(_LIBCPP_LOCALE__L_EXTENSIONS)
|
||||
struct __libcpp_locale_guard {
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__libcpp_locale_guard(locale_t& __loc) : __old_loc_(uselocale(__loc)) {}
|
||||
@ -65,6 +65,32 @@ private:
|
||||
__libcpp_locale_guard(__libcpp_locale_guard const&);
|
||||
__libcpp_locale_guard& operator=(__libcpp_locale_guard const&);
|
||||
};
|
||||
#elif defined(_LIBCPP_MSVCRT_LIKE)
|
||||
struct __libcpp_locale_guard {
|
||||
__libcpp_locale_guard(locale_t __l) :
|
||||
__status(_configthreadlocale(_ENABLE_PER_THREAD_LOCALE)),
|
||||
__locale_collate(setlocale(LC_COLLATE, __l.__get_locale())),
|
||||
__locale_ctype(setlocale(LC_CTYPE, __l.__get_locale())),
|
||||
__locale_monetary(setlocale(LC_MONETARY, __l.__get_locale())),
|
||||
__locale_numeric(setlocale(LC_NUMERIC, __l.__get_locale())),
|
||||
__locale_time(setlocale(LC_TIME, __l.__get_locale()))
|
||||
// LC_MESSAGES is not supported on Windows.
|
||||
{}
|
||||
~__libcpp_locale_guard() {
|
||||
setlocale(LC_COLLATE, __locale_collate);
|
||||
setlocale(LC_CTYPE, __locale_ctype);
|
||||
setlocale(LC_MONETARY, __locale_monetary);
|
||||
setlocale(LC_NUMERIC, __locale_numeric);
|
||||
setlocale(LC_TIME, __locale_time);
|
||||
_configthreadlocale(__status);
|
||||
}
|
||||
int __status;
|
||||
char* __locale_collate;
|
||||
char* __locale_ctype;
|
||||
char* __locale_monetary;
|
||||
char* __locale_numeric;
|
||||
char* __locale_time;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -84,7 +84,7 @@ __tree_is_left_child(_NodePtr __x) _NOEXCEPT
|
||||
return __x == __x->__parent_->__left_;
|
||||
}
|
||||
|
||||
// Determintes if the subtree rooted at __x is a proper red black subtree. If
|
||||
// Determines if the subtree rooted at __x is a proper red black subtree. If
|
||||
// __x is a proper subtree, returns the black height (null counts as 1). If
|
||||
// __x is an improper subtree, returns 0.
|
||||
template <class _NodePtr>
|
||||
@ -119,7 +119,7 @@ __tree_sub_invariant(_NodePtr __x)
|
||||
return __h + __x->__is_black_; // return black height of this node
|
||||
}
|
||||
|
||||
// Determintes if the red black tree rooted at __root is a proper red black tree.
|
||||
// Determines if the red black tree rooted at __root is a proper red black tree.
|
||||
// __root == nullptr is a proper tree. Returns true is __root is a proper
|
||||
// red black tree, else returns false.
|
||||
template <class _NodePtr>
|
||||
|
@ -734,15 +734,15 @@ struct __less<_T1, const _T1>
|
||||
};
|
||||
|
||||
template <class _Predicate>
|
||||
class __negate
|
||||
class __invert // invert the sense of a comparison
|
||||
{
|
||||
private:
|
||||
_Predicate __p_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY __negate() {}
|
||||
_LIBCPP_INLINE_VISIBILITY __invert() {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __negate(_Predicate __p) : __p_(__p) {}
|
||||
explicit __invert(_Predicate __p) : __p_(__p) {}
|
||||
|
||||
template <class _T1>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@ -750,7 +750,7 @@ public:
|
||||
|
||||
template <class _T1, class _T2>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const _T1& __x, const _T2& __y) {return !__p_(__x, __y);}
|
||||
bool operator()(const _T1& __x, const _T2& __y) {return __p_(__y, __x);}
|
||||
};
|
||||
|
||||
#ifdef _LIBCPP_DEBUG
|
||||
@ -797,7 +797,7 @@ unsigned __ctz(unsigned __x) {
|
||||
unsigned long where;
|
||||
// Search from LSB to MSB for first set bit.
|
||||
// Returns zero if no set bit is found.
|
||||
if (_BitScanForward(&where, mask))
|
||||
if (_BitScanForward(&where, __x))
|
||||
return where;
|
||||
return 32;
|
||||
#endif
|
||||
@ -823,15 +823,15 @@ unsigned long long __ctz(unsigned long long __x) {
|
||||
// Returns zero if no set bit is found.
|
||||
#if defined(_LIBCPP_HAS_BITSCAN64)
|
||||
(defined(_M_AMD64) || defined(__x86_64__))
|
||||
if (_BitScanForward64(&where, mask))
|
||||
if (_BitScanForward64(&where, __x))
|
||||
return static_cast<int>(where);
|
||||
#else
|
||||
// Win32 doesn't have _BitScanForward64 so emulate it with two 32 bit calls.
|
||||
// Scan the Low Word.
|
||||
if (_BitScanForward(&where, static_cast<unsigned long>(mask)))
|
||||
if (_BitScanForward(&where, static_cast<unsigned long>(__x)))
|
||||
return where;
|
||||
// Scan the High Word.
|
||||
if (_BitScanForward(&where, static_cast<unsigned long>(mask >> 32)))
|
||||
if (_BitScanForward(&where, static_cast<unsigned long>(__x >> 32)))
|
||||
return where + 32; // Create a bit offset from the LSB.
|
||||
#endif
|
||||
return 64;
|
||||
@ -849,7 +849,7 @@ unsigned __clz(unsigned __x) {
|
||||
unsigned long where;
|
||||
// Search from LSB to MSB for first set bit.
|
||||
// Returns zero if no set bit is found.
|
||||
if (_BitScanReverse(&where, mask))
|
||||
if (_BitScanReverse(&where, __x))
|
||||
return 31 - where;
|
||||
return 32; // Undefined Behavior.
|
||||
#endif
|
||||
@ -874,14 +874,14 @@ unsigned long long __clz(unsigned long long __x) {
|
||||
// BitScanReverse scans from MSB to LSB for first set bit.
|
||||
// Returns 0 if no set bit is found.
|
||||
#if defined(_LIBCPP_HAS_BITSCAN64)
|
||||
if (_BitScanReverse64(&where, mask))
|
||||
if (_BitScanReverse64(&where, __x))
|
||||
return static_cast<int>(63 - where);
|
||||
#else
|
||||
// Scan the high 32 bits.
|
||||
if (_BitScanReverse(&where, static_cast<unsigned long>(mask >> 32)))
|
||||
if (_BitScanReverse(&where, static_cast<unsigned long>(__x >> 32)))
|
||||
return 63 - (where + 32); // Create a bit offset from the MSB.
|
||||
// Scan the low 32 bits.
|
||||
if (_BitScanReverse(&where, static_cast<unsigned long>(mask)))
|
||||
if (_BitScanReverse(&where, static_cast<unsigned long>(__x)))
|
||||
return 63 - where;
|
||||
#endif
|
||||
return 64; // Undefined Behavior.
|
||||
@ -3210,28 +3210,28 @@ template <class _PopulationIterator, class _SampleIterator, class _Distance,
|
||||
class _UniformRandomNumberGenerator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_SampleIterator __sample(_PopulationIterator __first,
|
||||
_PopulationIterator __last, _SampleIterator __output,
|
||||
_PopulationIterator __last, _SampleIterator __output_iter,
|
||||
_Distance __n,
|
||||
_UniformRandomNumberGenerator & __g,
|
||||
input_iterator_tag) {
|
||||
|
||||
_Distance __k = 0;
|
||||
for (; __first != __last && __k < __n; ++__first, (void)++__k)
|
||||
__output[__k] = *__first;
|
||||
__output_iter[__k] = *__first;
|
||||
_Distance __sz = __k;
|
||||
for (; __first != __last; ++__first, (void)++__k) {
|
||||
_Distance __r = _VSTD::uniform_int_distribution<_Distance>(0, __k)(__g);
|
||||
if (__r < __sz)
|
||||
__output[__r] = *__first;
|
||||
__output_iter[__r] = *__first;
|
||||
}
|
||||
return __output + _VSTD::min(__n, __k);
|
||||
return __output_iter + _VSTD::min(__n, __k);
|
||||
}
|
||||
|
||||
template <class _PopulationIterator, class _SampleIterator, class _Distance,
|
||||
class _UniformRandomNumberGenerator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_SampleIterator __sample(_PopulationIterator __first,
|
||||
_PopulationIterator __last, _SampleIterator __output,
|
||||
_PopulationIterator __last, _SampleIterator __output_iter,
|
||||
_Distance __n,
|
||||
_UniformRandomNumberGenerator& __g,
|
||||
forward_iterator_tag) {
|
||||
@ -3240,18 +3240,18 @@ _SampleIterator __sample(_PopulationIterator __first,
|
||||
_Distance __r =
|
||||
_VSTD::uniform_int_distribution<_Distance>(0, --__unsampled_sz)(__g);
|
||||
if (__r < __n) {
|
||||
*__output++ = *__first;
|
||||
*__output_iter++ = *__first;
|
||||
--__n;
|
||||
}
|
||||
}
|
||||
return __output;
|
||||
return __output_iter;
|
||||
}
|
||||
|
||||
template <class _PopulationIterator, class _SampleIterator, class _Distance,
|
||||
class _UniformRandomNumberGenerator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_SampleIterator __sample(_PopulationIterator __first,
|
||||
_PopulationIterator __last, _SampleIterator __output,
|
||||
_PopulationIterator __last, _SampleIterator __output_iter,
|
||||
_Distance __n, _UniformRandomNumberGenerator& __g) {
|
||||
typedef typename iterator_traits<_PopulationIterator>::iterator_category
|
||||
_PopCategory;
|
||||
@ -3263,7 +3263,7 @@ _SampleIterator __sample(_PopulationIterator __first,
|
||||
typedef typename common_type<_Distance, _Difference>::type _CommonType;
|
||||
_LIBCPP_ASSERT(__n >= 0, "N must be a positive number.");
|
||||
return _VSTD::__sample(
|
||||
__first, __last, __output, _CommonType(__n),
|
||||
__first, __last, __output_iter, _CommonType(__n),
|
||||
__g, _PopCategory());
|
||||
}
|
||||
|
||||
@ -3272,9 +3272,9 @@ template <class _PopulationIterator, class _SampleIterator, class _Distance,
|
||||
class _UniformRandomNumberGenerator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_SampleIterator sample(_PopulationIterator __first,
|
||||
_PopulationIterator __last, _SampleIterator __output,
|
||||
_PopulationIterator __last, _SampleIterator __output_iter,
|
||||
_Distance __n, _UniformRandomNumberGenerator&& __g) {
|
||||
return _VSTD::__sample(__first, __last, __output, __n, __g);
|
||||
return _VSTD::__sample(__first, __last, __output_iter, __n, __g);
|
||||
}
|
||||
#endif // _LIBCPP_STD_VER > 14
|
||||
|
||||
@ -4568,7 +4568,7 @@ __buffered_inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator
|
||||
typedef reverse_iterator<value_type*> _Rv;
|
||||
__half_inplace_merge(_Rv(__p), _Rv(__buff),
|
||||
_RBi(__middle), _RBi(__first),
|
||||
_RBi(__last), __negate<_Compare>(__comp));
|
||||
_RBi(__last), __invert<_Compare>(__comp));
|
||||
}
|
||||
}
|
||||
|
||||
@ -5547,9 +5547,9 @@ __set_union(_InputIterator1 __first1, _InputIterator1 __last1,
|
||||
}
|
||||
else
|
||||
{
|
||||
*__result = *__first1;
|
||||
if (!__comp(*__first1, *__first2))
|
||||
++__first2;
|
||||
*__result = *__first1;
|
||||
++__first1;
|
||||
}
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ struct _LIBCPP_TEMPLATE_VIS array
|
||||
_LIBCPP_CONSTEXPR size_type size() const _NOEXCEPT {return _Size;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_CONSTEXPR size_type max_size() const _NOEXCEPT {return _Size;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_CONSTEXPR bool empty() const _NOEXCEPT {return _Size == 0;}
|
||||
|
||||
// element access:
|
||||
|
@ -235,8 +235,13 @@ void
|
||||
__bitset<_N_words, _Size>::__init(unsigned long long __v, false_type) _NOEXCEPT
|
||||
{
|
||||
__storage_type __t[sizeof(unsigned long long) / sizeof(__storage_type)];
|
||||
for (size_t __i = 0; __i < sizeof(__t)/sizeof(__t[0]); ++__i, __v >>= __bits_per_word)
|
||||
size_t __sz = _Size;
|
||||
for (size_t __i = 0; __i < sizeof(__t)/sizeof(__t[0]); ++__i, __v >>= __bits_per_word, __sz -= __bits_per_word )
|
||||
if ( __sz < __bits_per_word)
|
||||
__t[__i] = static_cast<__storage_type>(__v) & ( 1ULL << __sz ) - 1;
|
||||
else
|
||||
__t[__i] = static_cast<__storage_type>(__v);
|
||||
|
||||
_VSTD::copy(__t, __t + sizeof(__t)/sizeof(__t[0]), __first_);
|
||||
_VSTD::fill(__first_ + sizeof(__t)/sizeof(__t[0]), __first_ + sizeof(__first_)/sizeof(__first_[0]),
|
||||
__storage_type(0));
|
||||
@ -248,6 +253,9 @@ void
|
||||
__bitset<_N_words, _Size>::__init(unsigned long long __v, true_type) _NOEXCEPT
|
||||
{
|
||||
__first_[0] = __v;
|
||||
if (_Size < __bits_per_word)
|
||||
__first_[0] &= ( 1ULL << _Size ) - 1;
|
||||
|
||||
_VSTD::fill(__first_ + 1, __first_ + sizeof(__first_)/sizeof(__first_[0]), __storage_type(0));
|
||||
}
|
||||
|
||||
@ -261,7 +269,9 @@ __bitset<_N_words, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
|
||||
#if __SIZEOF_SIZE_T__ == 8
|
||||
: __first_{__v}
|
||||
#elif __SIZEOF_SIZE_T__ == 4
|
||||
: __first_{static_cast<__storage_type>(__v), static_cast<__storage_type>(__v >> __bits_per_word)}
|
||||
: __first_{static_cast<__storage_type>(__v),
|
||||
_Size >= 2 * __bits_per_word ? static_cast<__storage_type>(__v >> __bits_per_word)
|
||||
: static_cast<__storage_type>((__v >> __bits_per_word) & (__storage_type(1) << (_Size - __bits_per_word)) - 1)}
|
||||
#else
|
||||
#error This constructor has not been ported to this platform
|
||||
#endif
|
||||
@ -503,7 +513,10 @@ template <size_t _Size>
|
||||
inline
|
||||
_LIBCPP_CONSTEXPR
|
||||
__bitset<1, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
|
||||
: __first_(static_cast<__storage_type>(__v))
|
||||
: __first_(
|
||||
_Size == __bits_per_word ? static_cast<__storage_type>(__v)
|
||||
: static_cast<__storage_type>(__v) & ((__storage_type(1) << _Size) - 1)
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -283,18 +283,18 @@ typedef steady_clock high_resolution_clock;
|
||||
|
||||
} // chrono
|
||||
|
||||
constexpr chrono::hours operator "" h(unsigned long long); // C++14
|
||||
constexpr chrono::duration<unspecified , ratio<3600,1>> operator "" h(long double); // C++14
|
||||
constexpr chrono::minutes operator "" min(unsigned long long); // C++14
|
||||
constexpr chrono::duration<unspecified , ratio<60,1>> operator "" min(long double); // C++14
|
||||
constexpr chrono::seconds operator "" s(unsigned long long); // C++14
|
||||
constexpr chrono::duration<unspecified > operator "" s(long double); // C++14
|
||||
constexpr chrono::milliseconds operator "" ms(unsigned long long); // C++14
|
||||
constexpr chrono::duration<unspecified , milli> operator "" ms(long double); // C++14
|
||||
constexpr chrono::microseconds operator "" us(unsigned long long); // C++14
|
||||
constexpr chrono::duration<unspecified , micro> operator "" us(long double); // C++14
|
||||
constexpr chrono::nanoseconds operator "" ns(unsigned long long); // C++14
|
||||
constexpr chrono::duration<unspecified , nano> operator "" ns(long double); // C++14
|
||||
constexpr chrono::hours operator ""h(unsigned long long); // C++14
|
||||
constexpr chrono::duration<unspecified , ratio<3600,1>> operator ""h(long double); // C++14
|
||||
constexpr chrono::minutes operator ""min(unsigned long long); // C++14
|
||||
constexpr chrono::duration<unspecified , ratio<60,1>> operator ""min(long double); // C++14
|
||||
constexpr chrono::seconds operator ""s(unsigned long long); // C++14
|
||||
constexpr chrono::duration<unspecified > operator ""s(long double); // C++14
|
||||
constexpr chrono::milliseconds operator ""ms(unsigned long long); // C++14
|
||||
constexpr chrono::duration<unspecified , milli> operator ""ms(long double); // C++14
|
||||
constexpr chrono::microseconds operator ""us(unsigned long long); // C++14
|
||||
constexpr chrono::duration<unspecified , micro> operator ""us(long double); // C++14
|
||||
constexpr chrono::nanoseconds operator ""ns(unsigned long long); // C++14
|
||||
constexpr chrono::duration<unspecified , nano> operator ""ns(long double); // C++14
|
||||
|
||||
} // std
|
||||
*/
|
||||
@ -1087,67 +1087,67 @@ inline namespace literals
|
||||
inline namespace chrono_literals
|
||||
{
|
||||
|
||||
constexpr chrono::hours operator"" h(unsigned long long __h)
|
||||
constexpr chrono::hours operator""h(unsigned long long __h)
|
||||
{
|
||||
return chrono::hours(static_cast<chrono::hours::rep>(__h));
|
||||
}
|
||||
|
||||
constexpr chrono::duration<long double, ratio<3600,1>> operator"" h(long double __h)
|
||||
constexpr chrono::duration<long double, ratio<3600,1>> operator""h(long double __h)
|
||||
{
|
||||
return chrono::duration<long double, ratio<3600,1>>(__h);
|
||||
}
|
||||
|
||||
|
||||
constexpr chrono::minutes operator"" min(unsigned long long __m)
|
||||
constexpr chrono::minutes operator""min(unsigned long long __m)
|
||||
{
|
||||
return chrono::minutes(static_cast<chrono::minutes::rep>(__m));
|
||||
}
|
||||
|
||||
constexpr chrono::duration<long double, ratio<60,1>> operator"" min(long double __m)
|
||||
constexpr chrono::duration<long double, ratio<60,1>> operator""min(long double __m)
|
||||
{
|
||||
return chrono::duration<long double, ratio<60,1>> (__m);
|
||||
}
|
||||
|
||||
|
||||
constexpr chrono::seconds operator"" s(unsigned long long __s)
|
||||
constexpr chrono::seconds operator""s(unsigned long long __s)
|
||||
{
|
||||
return chrono::seconds(static_cast<chrono::seconds::rep>(__s));
|
||||
}
|
||||
|
||||
constexpr chrono::duration<long double> operator"" s(long double __s)
|
||||
constexpr chrono::duration<long double> operator""s(long double __s)
|
||||
{
|
||||
return chrono::duration<long double> (__s);
|
||||
}
|
||||
|
||||
|
||||
constexpr chrono::milliseconds operator"" ms(unsigned long long __ms)
|
||||
constexpr chrono::milliseconds operator""ms(unsigned long long __ms)
|
||||
{
|
||||
return chrono::milliseconds(static_cast<chrono::milliseconds::rep>(__ms));
|
||||
}
|
||||
|
||||
constexpr chrono::duration<long double, milli> operator"" ms(long double __ms)
|
||||
constexpr chrono::duration<long double, milli> operator""ms(long double __ms)
|
||||
{
|
||||
return chrono::duration<long double, milli>(__ms);
|
||||
}
|
||||
|
||||
|
||||
constexpr chrono::microseconds operator"" us(unsigned long long __us)
|
||||
constexpr chrono::microseconds operator""us(unsigned long long __us)
|
||||
{
|
||||
return chrono::microseconds(static_cast<chrono::microseconds::rep>(__us));
|
||||
}
|
||||
|
||||
constexpr chrono::duration<long double, micro> operator"" us(long double __us)
|
||||
constexpr chrono::duration<long double, micro> operator""us(long double __us)
|
||||
{
|
||||
return chrono::duration<long double, micro> (__us);
|
||||
}
|
||||
|
||||
|
||||
constexpr chrono::nanoseconds operator"" ns(unsigned long long __ns)
|
||||
constexpr chrono::nanoseconds operator""ns(unsigned long long __ns)
|
||||
{
|
||||
return chrono::nanoseconds(static_cast<chrono::nanoseconds::rep>(__ns));
|
||||
}
|
||||
|
||||
constexpr chrono::duration<long double, nano> operator"" ns(long double __ns)
|
||||
constexpr chrono::duration<long double, nano> operator""ns(long double __ns)
|
||||
{
|
||||
return chrono::duration<long double, nano> (__ns);
|
||||
}
|
||||
|
@ -64,23 +64,46 @@ namespace std // purposefully not versioned
|
||||
{
|
||||
enum class byte : unsigned char {};
|
||||
|
||||
constexpr byte& operator|=(byte& __lhs, byte __rhs) noexcept
|
||||
{ return __lhs = byte(static_cast<unsigned char>(__lhs) | static_cast<unsigned char>(__rhs)); }
|
||||
constexpr byte operator| (byte __lhs, byte __rhs) noexcept
|
||||
{ return byte(static_cast<unsigned char>(__lhs) | static_cast<unsigned char>(__rhs)); }
|
||||
{
|
||||
return static_cast<byte>(
|
||||
static_cast<unsigned char>(
|
||||
static_cast<unsigned int>(__lhs) | static_cast<unsigned int>(__rhs)
|
||||
));
|
||||
}
|
||||
|
||||
constexpr byte& operator|=(byte& __lhs, byte __rhs) noexcept
|
||||
{ return __lhs = __lhs | __rhs; }
|
||||
|
||||
constexpr byte operator& (byte __lhs, byte __rhs) noexcept
|
||||
{
|
||||
return static_cast<byte>(
|
||||
static_cast<unsigned char>(
|
||||
static_cast<unsigned int>(__lhs) & static_cast<unsigned int>(__rhs)
|
||||
));
|
||||
}
|
||||
|
||||
constexpr byte& operator&=(byte& __lhs, byte __rhs) noexcept
|
||||
{ return __lhs = byte(static_cast<unsigned char>(__lhs) & static_cast<unsigned char>(__rhs)); }
|
||||
constexpr byte operator& (byte __lhs, byte __rhs) noexcept
|
||||
{ return byte(static_cast<unsigned char>(__lhs) & static_cast<unsigned char>(__rhs)); }
|
||||
{ return __lhs = __lhs & __rhs; }
|
||||
|
||||
constexpr byte operator^ (byte __lhs, byte __rhs) noexcept
|
||||
{
|
||||
return static_cast<byte>(
|
||||
static_cast<unsigned char>(
|
||||
static_cast<unsigned int>(__lhs) ^ static_cast<unsigned int>(__rhs)
|
||||
));
|
||||
}
|
||||
|
||||
constexpr byte& operator^=(byte& __lhs, byte __rhs) noexcept
|
||||
{ return __lhs = byte(static_cast<unsigned char>(__lhs) ^ static_cast<unsigned char>(__rhs)); }
|
||||
constexpr byte operator^ (byte __lhs, byte __rhs) noexcept
|
||||
{ return byte(static_cast<unsigned char>(__lhs) ^ static_cast<unsigned char>(__rhs)); }
|
||||
{ return __lhs = __lhs ^ __rhs; }
|
||||
|
||||
constexpr byte operator~ (byte __b) noexcept
|
||||
{ return byte(~static_cast<unsigned char>(__b)); }
|
||||
{
|
||||
return static_cast<byte>(
|
||||
static_cast<unsigned char>(
|
||||
~static_cast<unsigned int>(__b)
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1314,7 +1314,7 @@ public:
|
||||
void resize(size_type __n);
|
||||
void resize(size_type __n, const value_type& __v);
|
||||
void shrink_to_fit() _NOEXCEPT;
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const _NOEXCEPT {return __base::size() == 0;}
|
||||
|
||||
// element access:
|
||||
|
@ -82,7 +82,7 @@ template <class E> void rethrow_if_nested(const E& e);
|
||||
#include <cstdlib>
|
||||
#include <type_traits>
|
||||
|
||||
#if defined(_LIBCPP_ABI_MICROSOFT)
|
||||
#if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_NO_VCRUNTIME)
|
||||
#include <vcruntime_exception.h>
|
||||
#endif
|
||||
|
||||
@ -93,7 +93,7 @@ template <class E> void rethrow_if_nested(const E& e);
|
||||
namespace std // purposefully not using versioning namespace
|
||||
{
|
||||
|
||||
#if !defined(_LIBCPP_ABI_MICROSOFT)
|
||||
#if !defined(_LIBCPP_ABI_MICROSOFT) || defined(_LIBCPP_NO_VCRUNTIME)
|
||||
class _LIBCPP_EXCEPTION_ABI exception
|
||||
{
|
||||
public:
|
||||
@ -110,7 +110,7 @@ public:
|
||||
virtual ~bad_exception() _NOEXCEPT;
|
||||
virtual const char* what() const _NOEXCEPT;
|
||||
};
|
||||
#endif // !_LIBCPP_ABI_MICROSOFT
|
||||
#endif // !_LIBCPP_ABI_MICROSOFT || _LIBCPP_NO_VCRUNTIME
|
||||
|
||||
#if _LIBCPP_STD_VER <= 14 \
|
||||
|| defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS) \
|
||||
|
@ -61,9 +61,9 @@ template <class _PopulationIterator, class _SampleIterator, class _Distance,
|
||||
class _UniformRandomNumberGenerator>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_SampleIterator sample(_PopulationIterator __first, _PopulationIterator __last,
|
||||
_SampleIterator __output, _Distance __n,
|
||||
_SampleIterator __output_iter, _Distance __n,
|
||||
_UniformRandomNumberGenerator &&__g) {
|
||||
return _VSTD::__sample(__first, __last, __output, __n, __g);
|
||||
return _VSTD::__sample(__first, __last, __output_iter, __n, __g);
|
||||
}
|
||||
|
||||
_LIBCPP_END_NAMESPACE_LFTS
|
||||
|
@ -81,10 +81,10 @@
|
||||
path canonical(const path& p, const path& base, error_code& ec);
|
||||
|
||||
void copy(const path& from, const path& to);
|
||||
void copy(const path& from, const path& to, error_code& ec) _NOEXCEPT;
|
||||
void copy(const path& from, const path& to, error_code& ec);
|
||||
void copy(const path& from, const path& to, copy_options options);
|
||||
void copy(const path& from, const path& to, copy_options options,
|
||||
error_code& ec) _NOEXCEPT;
|
||||
error_code& ec);
|
||||
|
||||
bool copy_file(const path& from, const path& to);
|
||||
bool copy_file(const path& from, const path& to, error_code& ec) _NOEXCEPT;
|
||||
@ -972,7 +972,8 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY path extension() const { return string_type(__extension()); }
|
||||
|
||||
// query
|
||||
_LIBCPP_INLINE_VISIBILITY bool empty() const _NOEXCEPT { return __pn_.empty(); }
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const _NOEXCEPT { return __pn_.empty(); }
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY bool has_root_name() const { return !__root_name().empty(); }
|
||||
_LIBCPP_INLINE_VISIBILITY bool has_root_directory() const { return !__root_directory().empty(); }
|
||||
@ -1351,7 +1352,7 @@ void copy(const path& __from, const path& __to) {
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void copy(const path& __from, const path& __to, error_code& __ec) _NOEXCEPT {
|
||||
void copy(const path& __from, const path& __to, error_code& __ec) {
|
||||
__copy(__from, __to, copy_options::none, &__ec);
|
||||
}
|
||||
|
||||
@ -1362,7 +1363,7 @@ void copy(const path& __from, const path& __to, copy_options __opt) {
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void copy(const path& __from, const path& __to,
|
||||
copy_options __opt, error_code& __ec) _NOEXCEPT {
|
||||
copy_options __opt, error_code& __ec) {
|
||||
__copy(__from, __to, __opt, &__ec);
|
||||
}
|
||||
|
||||
@ -1561,7 +1562,7 @@ bool is_empty(const path& __p) {
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool is_empty(const path& __p, error_code& __ec) _NOEXCEPT {
|
||||
bool is_empty(const path& __p, error_code& __ec) {
|
||||
return __fs_is_empty(__p, &__ec);
|
||||
}
|
||||
|
||||
@ -1903,12 +1904,12 @@ public:
|
||||
: directory_iterator(__p, nullptr, __opts)
|
||||
{ }
|
||||
|
||||
directory_iterator(const path& __p, error_code& __ec) _NOEXCEPT
|
||||
directory_iterator(const path& __p, error_code& __ec)
|
||||
: directory_iterator(__p, &__ec)
|
||||
{ }
|
||||
|
||||
directory_iterator(const path& __p, directory_options __opts,
|
||||
error_code& __ec) _NOEXCEPT
|
||||
error_code& __ec)
|
||||
: directory_iterator(__p, &__ec, __opts)
|
||||
{ }
|
||||
|
||||
@ -1943,7 +1944,7 @@ public:
|
||||
return __p;
|
||||
}
|
||||
|
||||
directory_iterator& increment(error_code& __ec) _NOEXCEPT
|
||||
directory_iterator& increment(error_code& __ec)
|
||||
{ return __increment(&__ec); }
|
||||
|
||||
private:
|
||||
@ -2013,12 +2014,12 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
recursive_directory_iterator(const path& __p,
|
||||
directory_options __xoptions, error_code& __ec) _NOEXCEPT
|
||||
directory_options __xoptions, error_code& __ec)
|
||||
: recursive_directory_iterator(__p, __xoptions, &__ec)
|
||||
{ }
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
recursive_directory_iterator(const path& __p, error_code& __ec) _NOEXCEPT
|
||||
recursive_directory_iterator(const path& __p, error_code& __ec)
|
||||
: recursive_directory_iterator(__p, directory_options::none, &__ec)
|
||||
{ }
|
||||
|
||||
@ -2060,7 +2061,7 @@ public:
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
recursive_directory_iterator& increment(error_code& __ec) _NOEXCEPT
|
||||
recursive_directory_iterator& increment(error_code& __ec)
|
||||
{ return __increment(&__ec); }
|
||||
|
||||
_LIBCPP_FUNC_VIS directory_options options() const;
|
||||
|
@ -75,19 +75,19 @@ public:
|
||||
typedef void reference;
|
||||
|
||||
ostream_joiner(ostream_type& __os, _Delim&& __d)
|
||||
: __output(_VSTD::addressof(__os)), __delim(_VSTD::move(__d)), __first(true) {}
|
||||
: __output_iter(_VSTD::addressof(__os)), __delim(_VSTD::move(__d)), __first(true) {}
|
||||
|
||||
ostream_joiner(ostream_type& __os, const _Delim& __d)
|
||||
: __output(_VSTD::addressof(__os)), __delim(__d), __first(true) {}
|
||||
: __output_iter(_VSTD::addressof(__os)), __delim(__d), __first(true) {}
|
||||
|
||||
|
||||
template<typename _Tp>
|
||||
ostream_joiner& operator=(const _Tp& __v)
|
||||
{
|
||||
if (!__first)
|
||||
*__output << __delim;
|
||||
*__output_iter << __delim;
|
||||
__first = false;
|
||||
*__output << __v;
|
||||
*__output_iter << __v;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -96,7 +96,7 @@ public:
|
||||
ostream_joiner& operator++(int) _NOEXCEPT { return *this; }
|
||||
|
||||
private:
|
||||
ostream_type* __output;
|
||||
ostream_type* __output_iter;
|
||||
_Delim __delim;
|
||||
bool __first;
|
||||
};
|
||||
|
@ -728,7 +728,7 @@ public:
|
||||
const_iterator cbefore_begin() const _NOEXCEPT
|
||||
{return const_iterator(base::__before_begin());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const _NOEXCEPT
|
||||
{return base::__before_begin()->__next_ == nullptr;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
|
@ -315,7 +315,7 @@ basic_filebuf<_CharT, _Traits>::basic_filebuf(basic_filebuf&& __rhs)
|
||||
else
|
||||
this->setp((char_type*)__extbuf_,
|
||||
(char_type*)__extbuf_ + (__rhs. epptr() - __rhs.pbase()));
|
||||
this->pbump(__rhs. pptr() - __rhs.pbase());
|
||||
this->__pbump(__rhs. pptr() - __rhs.pbase());
|
||||
}
|
||||
else if (__rhs.eback())
|
||||
{
|
||||
@ -434,7 +434,7 @@ basic_filebuf<_CharT, _Traits>::swap(basic_filebuf& __rhs)
|
||||
ptrdiff_t __e = this->epptr() - this->pbase();
|
||||
this->setp((char_type*)__extbuf_min_,
|
||||
(char_type*)__extbuf_min_ + __e);
|
||||
this->pbump(__n);
|
||||
this->__pbump(__n);
|
||||
}
|
||||
if (__rhs.eback() == (char_type*)__extbuf_min_)
|
||||
{
|
||||
@ -450,7 +450,7 @@ basic_filebuf<_CharT, _Traits>::swap(basic_filebuf& __rhs)
|
||||
ptrdiff_t __e = __rhs.epptr() - __rhs.pbase();
|
||||
__rhs.setp((char_type*)__rhs.__extbuf_min_,
|
||||
(char_type*)__rhs.__extbuf_min_ + __e);
|
||||
__rhs.pbump(__n);
|
||||
__rhs.__pbump(__n);
|
||||
}
|
||||
}
|
||||
|
||||
@ -724,7 +724,7 @@ basic_filebuf<_CharT, _Traits>::overflow(int_type __c)
|
||||
if (__r == codecvt_base::partial)
|
||||
{
|
||||
this->setp(const_cast<char_type*>(__e), this->pptr());
|
||||
this->pbump(this->epptr() - this->pbase());
|
||||
this->__pbump(this->epptr() - this->pbase());
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -2335,6 +2335,7 @@ inline _LIBCPP_INLINE_VISIBILITY bool __does_policy_contain(launch __policy, lau
|
||||
{ return (int(__policy) & int(__value)) != 0; }
|
||||
|
||||
template <class _Fp, class... _Args>
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17
|
||||
future<typename __invoke_of<typename decay<_Fp>::type, typename decay<_Args>::type...>::type>
|
||||
async(launch __policy, _Fp&& __f, _Args&&... __args)
|
||||
{
|
||||
@ -2360,7 +2361,7 @@ async(launch __policy, _Fp&& __f, _Args&&... __args)
|
||||
}
|
||||
|
||||
template <class _Fp, class... _Args>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_INLINE_VISIBILITY
|
||||
future<typename __invoke_of<typename decay<_Fp>::type, typename decay<_Args>::type...>::type>
|
||||
async(_Fp&& __f, _Args&&... __args)
|
||||
{
|
||||
|
@ -1069,16 +1069,18 @@ basic_istream<_CharT, _Traits>::getline(char_type* __s, streamsize __n, char_typ
|
||||
this->rdbuf()->sbumpc();
|
||||
++__gc_;
|
||||
}
|
||||
if (__n > 0)
|
||||
*__s = char_type();
|
||||
if (__gc_ == 0)
|
||||
__err |= ios_base::failbit;
|
||||
this->setstate(__err);
|
||||
}
|
||||
if (__n > 0)
|
||||
*__s = char_type();
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
if (__n > 0)
|
||||
*__s = char_type();
|
||||
this->__set_badbit_and_consider_rethrow();
|
||||
}
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
|
@ -37,16 +37,6 @@ struct iterator_traits<T*>
|
||||
typedef random_access_iterator_tag iterator_category;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct iterator_traits<const T*>
|
||||
{
|
||||
typedef ptrdiff_t difference_type;
|
||||
typedef T value_type;
|
||||
typedef const T* pointer;
|
||||
typedef const T& reference;
|
||||
typedef random_access_iterator_tag iterator_category;
|
||||
};
|
||||
|
||||
template<class Category, class T, class Distance = ptrdiff_t,
|
||||
class Pointer = T*, class Reference = T&>
|
||||
struct iterator
|
||||
@ -494,7 +484,7 @@ template<class _Tp>
|
||||
struct _LIBCPP_TEMPLATE_VIS iterator_traits<_Tp*>
|
||||
{
|
||||
typedef ptrdiff_t difference_type;
|
||||
typedef typename remove_const<_Tp>::type value_type;
|
||||
typedef typename remove_cv<_Tp>::type value_type;
|
||||
typedef _Tp* pointer;
|
||||
typedef _Tp& reference;
|
||||
typedef random_access_iterator_tag iterator_category;
|
||||
@ -604,21 +594,27 @@ distance(_InputIter __first, _InputIter __last)
|
||||
|
||||
template <class _InputIter>
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
|
||||
_InputIter
|
||||
typename enable_if
|
||||
<
|
||||
__is_input_iterator<_InputIter>::value,
|
||||
_InputIter
|
||||
>::type
|
||||
next(_InputIter __x,
|
||||
typename iterator_traits<_InputIter>::difference_type __n = 1,
|
||||
typename enable_if<__is_input_iterator<_InputIter>::value>::type* = 0)
|
||||
typename iterator_traits<_InputIter>::difference_type __n = 1)
|
||||
{
|
||||
_VSTD::advance(__x, __n);
|
||||
return __x;
|
||||
}
|
||||
|
||||
template <class _BidiretionalIter>
|
||||
template <class _BidirectionalIter>
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
|
||||
_BidiretionalIter
|
||||
prev(_BidiretionalIter __x,
|
||||
typename iterator_traits<_BidiretionalIter>::difference_type __n = 1,
|
||||
typename enable_if<__is_bidirectional_iterator<_BidiretionalIter>::value>::type* = 0)
|
||||
typename enable_if
|
||||
<
|
||||
__is_bidirectional_iterator<_BidirectionalIter>::value,
|
||||
_BidirectionalIter
|
||||
>::type
|
||||
prev(_BidirectionalIter __x,
|
||||
typename iterator_traits<_BidirectionalIter>::difference_type __n = 1)
|
||||
{
|
||||
_VSTD::advance(__x, -__n);
|
||||
return __x;
|
||||
@ -908,15 +904,37 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY istream_iterator operator++(int)
|
||||
{istream_iterator __t(*this); ++(*this); return __t;}
|
||||
|
||||
template <class _Up, class _CharU, class _TraitsU, class _DistanceU>
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(const istream_iterator& __x, const istream_iterator& __y)
|
||||
{return __x.__in_stream_ == __y.__in_stream_;}
|
||||
bool
|
||||
operator==(const istream_iterator<_Up, _CharU, _TraitsU, _DistanceU>& __x,
|
||||
const istream_iterator<_Up, _CharU, _TraitsU, _DistanceU>& __y);
|
||||
|
||||
template <class _Up, class _CharU, class _TraitsU, class _DistanceU>
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const istream_iterator& __x, const istream_iterator& __y)
|
||||
{return !(__x == __y);}
|
||||
bool
|
||||
operator==(const istream_iterator<_Up, _CharU, _TraitsU, _DistanceU>& __x,
|
||||
const istream_iterator<_Up, _CharU, _TraitsU, _DistanceU>& __y);
|
||||
};
|
||||
|
||||
template <class _Tp, class _CharT, class _Traits, class _Distance>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator==(const istream_iterator<_Tp, _CharT, _Traits, _Distance>& __x,
|
||||
const istream_iterator<_Tp, _CharT, _Traits, _Distance>& __y)
|
||||
{
|
||||
return __x.__in_stream_ == __y.__in_stream_;
|
||||
}
|
||||
|
||||
template <class _Tp, class _CharT, class _Traits, class _Distance>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator!=(const istream_iterator<_Tp, _CharT, _Traits, _Distance>& __x,
|
||||
const istream_iterator<_Tp, _CharT, _Traits, _Distance>& __y)
|
||||
{
|
||||
return !(__x == __y);
|
||||
}
|
||||
|
||||
template <class _Tp, class _CharT = char, class _Traits = char_traits<_CharT> >
|
||||
class _LIBCPP_TEMPLATE_VIS ostream_iterator
|
||||
: public iterator<output_iterator_tag, void, void, void, void>
|
||||
@ -1794,31 +1812,67 @@ end(const _Cp& __c)
|
||||
#endif // !defined(_LIBCPP_CXX03_LANG)
|
||||
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
|
||||
// #if _LIBCPP_STD_VER > 11
|
||||
// template <>
|
||||
// struct _LIBCPP_TEMPLATE_VIS plus<void>
|
||||
// {
|
||||
// template <class _T1, class _T2>
|
||||
// _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
||||
// auto operator()(_T1&& __t, _T2&& __u) const
|
||||
// _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) + _VSTD::forward<_T2>(__u)))
|
||||
// -> decltype (_VSTD::forward<_T1>(__t) + _VSTD::forward<_T2>(__u))
|
||||
// { return _VSTD::forward<_T1>(__t) + _VSTD::forward<_T2>(__u); }
|
||||
// typedef void is_transparent;
|
||||
// };
|
||||
// #endif
|
||||
|
||||
template <class _Cont>
|
||||
constexpr auto size(const _Cont& __c) -> decltype(__c.size()) { return __c.size(); }
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
constexpr auto size(const _Cont& __c)
|
||||
_NOEXCEPT_(noexcept(__c.size()))
|
||||
-> decltype (__c.size())
|
||||
{ return __c.size(); }
|
||||
|
||||
template <class _Tp, size_t _Sz>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
constexpr size_t size(const _Tp (&)[_Sz]) noexcept { return _Sz; }
|
||||
|
||||
template <class _Cont>
|
||||
constexpr auto empty(const _Cont& __c) -> decltype(__c.empty()) { return __c.empty(); }
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_INLINE_VISIBILITY
|
||||
constexpr auto empty(const _Cont& __c)
|
||||
_NOEXCEPT_(noexcept(__c.empty()))
|
||||
-> decltype (__c.empty())
|
||||
{ return __c.empty(); }
|
||||
|
||||
template <class _Tp, size_t _Sz>
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_INLINE_VISIBILITY
|
||||
constexpr bool empty(const _Tp (&)[_Sz]) noexcept { return false; }
|
||||
|
||||
template <class _Ep>
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_INLINE_VISIBILITY
|
||||
constexpr bool empty(initializer_list<_Ep> __il) noexcept { return __il.size() == 0; }
|
||||
|
||||
template <class _Cont> constexpr
|
||||
auto data(_Cont& __c) -> decltype(__c.data()) { return __c.data(); }
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
auto data(_Cont& __c)
|
||||
_NOEXCEPT_(noexcept(__c.data()))
|
||||
-> decltype (__c.data())
|
||||
{ return __c.data(); }
|
||||
|
||||
template <class _Cont> constexpr
|
||||
auto data(const _Cont& __c) -> decltype(__c.data()) { return __c.data(); }
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
auto data(const _Cont& __c)
|
||||
_NOEXCEPT_(noexcept(__c.data()))
|
||||
-> decltype (__c.data())
|
||||
{ return __c.data(); }
|
||||
|
||||
template <class _Tp, size_t _Sz>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
constexpr _Tp* data(_Tp (&__array)[_Sz]) noexcept { return __array; }
|
||||
|
||||
template <class _Ep>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
constexpr const _Ep* data(initializer_list<_Ep> __il) noexcept { return __il.begin(); }
|
||||
#endif
|
||||
|
||||
|
@ -481,7 +481,7 @@ public:
|
||||
{
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
_LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
|
||||
"Attempted to dereference a non-dereferenceable list::iterator");
|
||||
"Attempted to dereference a non-dereferenceable list::const_iterator");
|
||||
#endif
|
||||
return pointer_traits<pointer>::pointer_to(__ptr_->__as_node()->__value_);
|
||||
}
|
||||
@ -896,7 +896,7 @@ public:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const _NOEXCEPT {return base::__sz();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const _NOEXCEPT {return base::empty();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const _NOEXCEPT
|
||||
@ -1071,6 +1071,16 @@ public:
|
||||
|
||||
bool __invariants() const;
|
||||
|
||||
typedef __allocator_destructor<__node_allocator> __node_destructor;
|
||||
typedef unique_ptr<__node, __node_destructor> __hold_pointer;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__hold_pointer __allocate_node(__node_allocator& __na) {
|
||||
__node_pointer __p = __node_alloc_traits::allocate(__na, 1);
|
||||
__p->__prev_ = nullptr;
|
||||
return __hold_pointer(__p, __node_destructor(__na, 1));
|
||||
}
|
||||
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
|
||||
bool __dereferenceable(const const_iterator* __i) const;
|
||||
@ -1397,9 +1407,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, const value_type& __x)
|
||||
" referring to this list");
|
||||
#endif
|
||||
__node_allocator& __na = base::__node_alloc();
|
||||
typedef __allocator_destructor<__node_allocator> _Dp;
|
||||
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
|
||||
__hold->__prev_ = 0;
|
||||
__hold_pointer __hold = __allocate_node(__na);
|
||||
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
|
||||
__link_nodes(__p.__ptr_, __hold->__as_link(), __hold->__as_link());
|
||||
++base::__sz();
|
||||
@ -1426,9 +1434,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, size_type __n, const value_type& _
|
||||
{
|
||||
size_type __ds = 0;
|
||||
__node_allocator& __na = base::__node_alloc();
|
||||
typedef __allocator_destructor<__node_allocator> _Dp;
|
||||
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
|
||||
__hold->__prev_ = 0;
|
||||
__hold_pointer __hold = __allocate_node(__na);
|
||||
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
|
||||
++__ds;
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
@ -1494,9 +1500,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, _InpIter __f, _InpIter __l,
|
||||
{
|
||||
size_type __ds = 0;
|
||||
__node_allocator& __na = base::__node_alloc();
|
||||
typedef __allocator_destructor<__node_allocator> _Dp;
|
||||
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
|
||||
__hold->__prev_ = 0;
|
||||
__hold_pointer __hold = __allocate_node(__na);
|
||||
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), *__f);
|
||||
++__ds;
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
@ -1549,8 +1553,7 @@ void
|
||||
list<_Tp, _Alloc>::push_front(const value_type& __x)
|
||||
{
|
||||
__node_allocator& __na = base::__node_alloc();
|
||||
typedef __allocator_destructor<__node_allocator> _Dp;
|
||||
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
|
||||
__hold_pointer __hold = __allocate_node(__na);
|
||||
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
|
||||
__link_pointer __nl = __hold->__as_link();
|
||||
__link_nodes_at_front(__nl, __nl);
|
||||
@ -1563,8 +1566,7 @@ void
|
||||
list<_Tp, _Alloc>::push_back(const value_type& __x)
|
||||
{
|
||||
__node_allocator& __na = base::__node_alloc();
|
||||
typedef __allocator_destructor<__node_allocator> _Dp;
|
||||
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
|
||||
__hold_pointer __hold = __allocate_node(__na);
|
||||
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
|
||||
__link_nodes_at_back(__hold.get()->__as_link(), __hold.get()->__as_link());
|
||||
++base::__sz();
|
||||
@ -1578,8 +1580,7 @@ void
|
||||
list<_Tp, _Alloc>::push_front(value_type&& __x)
|
||||
{
|
||||
__node_allocator& __na = base::__node_alloc();
|
||||
typedef __allocator_destructor<__node_allocator> _Dp;
|
||||
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
|
||||
__hold_pointer __hold = __allocate_node(__na);
|
||||
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x));
|
||||
__link_nodes_at_front(__hold.get()->__as_link(), __hold.get()->__as_link());
|
||||
++base::__sz();
|
||||
@ -1591,8 +1592,7 @@ void
|
||||
list<_Tp, _Alloc>::push_back(value_type&& __x)
|
||||
{
|
||||
__node_allocator& __na = base::__node_alloc();
|
||||
typedef __allocator_destructor<__node_allocator> _Dp;
|
||||
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
|
||||
__hold_pointer __hold = __allocate_node(__na);
|
||||
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x));
|
||||
__link_nodes_at_back(__hold.get()->__as_link(), __hold.get()->__as_link());
|
||||
++base::__sz();
|
||||
@ -1609,8 +1609,7 @@ void
|
||||
list<_Tp, _Alloc>::emplace_front(_Args&&... __args)
|
||||
{
|
||||
__node_allocator& __na = base::__node_alloc();
|
||||
typedef __allocator_destructor<__node_allocator> _Dp;
|
||||
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
|
||||
__hold_pointer __hold = __allocate_node(__na);
|
||||
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...);
|
||||
__link_nodes_at_front(__hold.get()->__as_link(), __hold.get()->__as_link());
|
||||
++base::__sz();
|
||||
@ -1631,8 +1630,7 @@ void
|
||||
list<_Tp, _Alloc>::emplace_back(_Args&&... __args)
|
||||
{
|
||||
__node_allocator& __na = base::__node_alloc();
|
||||
typedef __allocator_destructor<__node_allocator> _Dp;
|
||||
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
|
||||
__hold_pointer __hold = __allocate_node(__na);
|
||||
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...);
|
||||
__link_pointer __nl = __hold->__as_link();
|
||||
__link_nodes_at_back(__nl, __nl);
|
||||
@ -1655,9 +1653,7 @@ list<_Tp, _Alloc>::emplace(const_iterator __p, _Args&&... __args)
|
||||
" referring to this list");
|
||||
#endif
|
||||
__node_allocator& __na = base::__node_alloc();
|
||||
typedef __allocator_destructor<__node_allocator> _Dp;
|
||||
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
|
||||
__hold->__prev_ = 0;
|
||||
__hold_pointer __hold = __allocate_node(__na);
|
||||
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...);
|
||||
__link_pointer __nl = __hold.get()->__as_link();
|
||||
__link_nodes(__p.__ptr_, __nl, __nl);
|
||||
@ -1680,9 +1676,7 @@ list<_Tp, _Alloc>::insert(const_iterator __p, value_type&& __x)
|
||||
" referring to this list");
|
||||
#endif
|
||||
__node_allocator& __na = base::__node_alloc();
|
||||
typedef __allocator_destructor<__node_allocator> _Dp;
|
||||
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
|
||||
__hold->__prev_ = 0;
|
||||
__hold_pointer __hold = __allocate_node(__na);
|
||||
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x));
|
||||
__link_pointer __nl = __hold->__as_link();
|
||||
__link_nodes(__p.__ptr_, __nl, __nl);
|
||||
@ -1855,9 +1849,7 @@ list<_Tp, _Alloc>::resize(size_type __n)
|
||||
__n -= base::__sz();
|
||||
size_type __ds = 0;
|
||||
__node_allocator& __na = base::__node_alloc();
|
||||
typedef __allocator_destructor<__node_allocator> _Dp;
|
||||
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
|
||||
__hold->__prev_ = 0;
|
||||
__hold_pointer __hold = __allocate_node(__na);
|
||||
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_));
|
||||
++__ds;
|
||||
#if _LIBCPP_DEBUG_LEVEL >= 2
|
||||
@ -1914,9 +1906,7 @@ list<_Tp, _Alloc>::resize(size_type __n, const value_type& __x)
|
||||
__n -= base::__sz();
|
||||
size_type __ds = 0;
|
||||
__node_allocator& __na = base::__node_alloc();
|
||||
typedef __allocator_destructor<__node_allocator> _Dp;
|
||||
unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
|
||||
__hold->__prev_ = 0;
|
||||
__hold_pointer __hold = __allocate_node(__na);
|
||||
__node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
|
||||
++__ds;
|
||||
__link_pointer __nl = __hold.release()->__as_link();
|
||||
|
@ -4110,7 +4110,7 @@ wbuffer_convert<_Codecvt, _Elem, _Tr>::overflow(int_type __c)
|
||||
if (__r == codecvt_base::partial)
|
||||
{
|
||||
this->setp(const_cast<char_type *>(__e), this->pptr());
|
||||
this->pbump(this->epptr() - this->pbase());
|
||||
this->__pbump(this->epptr() - this->pbase());
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1012,7 +1012,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crend() const _NOEXCEPT {return rend();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const _NOEXCEPT {return __tree_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const _NOEXCEPT {return __tree_.size();}
|
||||
@ -1669,7 +1669,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crend() const _NOEXCEPT {return rend();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const _NOEXCEPT {return __tree_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const _NOEXCEPT {return __tree_.size();}
|
||||
|
@ -46,6 +46,9 @@ struct pointer_traits<T*>
|
||||
static pointer pointer_to(<details>) noexcept;
|
||||
};
|
||||
|
||||
template <class T> constexpr T* to_address(T* p) noexcept; // C++20
|
||||
template <class Ptr> auto to_address(const Ptr& p) noexcept; // C++20
|
||||
|
||||
template <class Alloc>
|
||||
struct allocator_traits
|
||||
{
|
||||
@ -81,8 +84,8 @@ struct allocator_traits
|
||||
template <class T> using rebind_alloc = Alloc::rebind<U>::other | Alloc<T, Args...>;
|
||||
template <class T> using rebind_traits = allocator_traits<rebind_alloc<T>>;
|
||||
|
||||
static pointer allocate(allocator_type& a, size_type n);
|
||||
static pointer allocate(allocator_type& a, size_type n, const_void_pointer hint);
|
||||
static pointer allocate(allocator_type& a, size_type n); // [[nodiscard]] in C++20
|
||||
static pointer allocate(allocator_type& a, size_type n, const_void_pointer hint); // [[nodiscard]] in C++20
|
||||
|
||||
static void deallocate(allocator_type& a, pointer p, size_type n) noexcept;
|
||||
|
||||
@ -384,6 +387,9 @@ template<class T, class... Args> unique_ptr<T> make_unique(Args&&... args);
|
||||
template<class T> unique_ptr<T> make_unique(size_t n); // C++14
|
||||
template<class T, class... Args> unspecified make_unique(Args&&...) = delete; // C++14, T == U[N]
|
||||
|
||||
template<class E, class T, class Y, class D>
|
||||
basic_ostream<E, T>& operator<< (basic_ostream<E, T>& os, unique_ptr<Y, D> const& p);
|
||||
|
||||
template<class T>
|
||||
class shared_ptr
|
||||
{
|
||||
@ -1090,13 +1096,14 @@ struct __const_void_pointer<_Ptr, _Alloc, false>
|
||||
};
|
||||
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||
_Tp*
|
||||
__to_raw_pointer(_Tp* __p) _NOEXCEPT
|
||||
{
|
||||
return __p;
|
||||
}
|
||||
|
||||
#if _LIBCPP_STD_VER <= 17
|
||||
template <class _Pointer>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename pointer_traits<_Pointer>::element_type*
|
||||
@ -1104,6 +1111,41 @@ __to_raw_pointer(_Pointer __p) _NOEXCEPT
|
||||
{
|
||||
return _VSTD::__to_raw_pointer(__p.operator->());
|
||||
}
|
||||
#else
|
||||
template <class _Pointer>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
auto
|
||||
__to_raw_pointer(const _Pointer& __p) _NOEXCEPT
|
||||
-> decltype(pointer_traits<_Pointer>::to_address(__p))
|
||||
{
|
||||
return pointer_traits<_Pointer>::to_address(__p);
|
||||
}
|
||||
|
||||
template <class _Pointer, class... _None>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
auto
|
||||
__to_raw_pointer(const _Pointer& __p, _None...) _NOEXCEPT
|
||||
{
|
||||
return _VSTD::__to_raw_pointer(__p.operator->());
|
||||
}
|
||||
|
||||
template <class _Tp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY constexpr
|
||||
_Tp*
|
||||
to_address(_Tp* __p) _NOEXCEPT
|
||||
{
|
||||
static_assert(!is_function_v<_Tp>, "_Tp is a function type");
|
||||
return __p;
|
||||
}
|
||||
|
||||
template <class _Pointer>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
auto
|
||||
to_address(const _Pointer& __p) _NOEXCEPT
|
||||
{
|
||||
return _VSTD::__to_raw_pointer(__p);
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class _Tp, class = void>
|
||||
struct __has_size_type : false_type {};
|
||||
@ -1302,7 +1344,7 @@ struct __allocator_traits_rebind<_Alloc<_Tp, _A0, _A1, _A2>, _Up, false>
|
||||
template <class _Alloc, class _SizeType, class _ConstVoidPtr>
|
||||
auto
|
||||
__has_allocate_hint_test(_Alloc&& __a, _SizeType&& __sz, _ConstVoidPtr&& __p)
|
||||
-> decltype(__a.allocate(__sz, __p), true_type());
|
||||
-> decltype((void)__a.allocate(__sz, __p), true_type());
|
||||
|
||||
template <class _Alloc, class _SizeType, class _ConstVoidPtr>
|
||||
auto
|
||||
@ -1313,7 +1355,7 @@ template <class _Alloc, class _SizeType, class _ConstVoidPtr>
|
||||
struct __has_allocate_hint
|
||||
: integral_constant<bool,
|
||||
is_same<
|
||||
decltype(__has_allocate_hint_test(declval<_Alloc>(),
|
||||
decltype(_VSTD::__has_allocate_hint_test(declval<_Alloc>(),
|
||||
declval<_SizeType>(),
|
||||
declval<_ConstVoidPtr>())),
|
||||
true_type>::value>
|
||||
@ -1346,7 +1388,7 @@ template <class _Alloc, class _Pointer, class ..._Args>
|
||||
struct __has_construct
|
||||
: integral_constant<bool,
|
||||
is_same<
|
||||
decltype(__has_construct_test(declval<_Alloc>(),
|
||||
decltype(_VSTD::__has_construct_test(declval<_Alloc>(),
|
||||
declval<_Pointer>(),
|
||||
declval<_Args>()...)),
|
||||
true_type>::value>
|
||||
@ -1367,7 +1409,7 @@ template <class _Alloc, class _Pointer>
|
||||
struct __has_destroy
|
||||
: integral_constant<bool,
|
||||
is_same<
|
||||
decltype(__has_destroy_test(declval<_Alloc>(),
|
||||
decltype(_VSTD::__has_destroy_test(declval<_Alloc>(),
|
||||
declval<_Pointer>())),
|
||||
true_type>::value>
|
||||
{
|
||||
@ -1387,7 +1429,7 @@ template <class _Alloc>
|
||||
struct __has_max_size
|
||||
: integral_constant<bool,
|
||||
is_same<
|
||||
decltype(__has_max_size_test(declval<_Alloc&>())),
|
||||
decltype(_VSTD::__has_max_size_test(declval<_Alloc&>())),
|
||||
true_type>::value>
|
||||
{
|
||||
};
|
||||
@ -1406,7 +1448,7 @@ template <class _Alloc>
|
||||
struct __has_select_on_container_copy_construction
|
||||
: integral_constant<bool,
|
||||
is_same<
|
||||
decltype(__has_select_on_container_copy_construction_test(declval<_Alloc&>())),
|
||||
decltype(_VSTD::__has_select_on_container_copy_construction_test(declval<_Alloc&>())),
|
||||
true_type>::value>
|
||||
{
|
||||
};
|
||||
@ -1497,10 +1539,10 @@ struct _LIBCPP_TEMPLATE_VIS allocator_traits
|
||||
{typedef allocator_traits<typename rebind_alloc<_Tp>::other> other;};
|
||||
#endif // _LIBCPP_CXX03_LANG
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
|
||||
static pointer allocate(allocator_type& __a, size_type __n)
|
||||
{return __a.allocate(__n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
|
||||
static pointer allocate(allocator_type& __a, size_type __n, const_void_pointer __hint)
|
||||
{return __allocate(__a, __n, __hint,
|
||||
__has_allocate_hint<allocator_type, size_type, const_void_pointer>());}
|
||||
@ -1688,10 +1730,10 @@ private:
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static size_type __max_size(true_type, const allocator_type& __a)
|
||||
static size_type __max_size(true_type, const allocator_type& __a) _NOEXCEPT
|
||||
{return __a.max_size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static size_type __max_size(false_type, const allocator_type&)
|
||||
static size_type __max_size(false_type, const allocator_type&) _NOEXCEPT
|
||||
{return numeric_limits<size_type>::max() / sizeof(value_type);}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@ -1739,7 +1781,8 @@ public:
|
||||
{return _VSTD::addressof(__x);}
|
||||
_LIBCPP_INLINE_VISIBILITY const_pointer address(const_reference __x) const _NOEXCEPT
|
||||
{return _VSTD::addressof(__x);}
|
||||
_LIBCPP_INLINE_VISIBILITY pointer allocate(size_type __n, allocator<void>::const_pointer = 0)
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
|
||||
pointer allocate(size_type __n, allocator<void>::const_pointer = 0)
|
||||
{
|
||||
if (__n > max_size())
|
||||
__throw_length_error("allocator<T>::allocate(size_t n)"
|
||||
@ -2040,11 +2083,12 @@ struct __compressed_pair_elem {
|
||||
typedef const _Tp& const_reference;
|
||||
|
||||
#ifndef _LIBCPP_CXX03_LANG
|
||||
constexpr __compressed_pair_elem() : __value_() {}
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr __compressed_pair_elem() : __value_() {}
|
||||
|
||||
template <class _Up, class = typename enable_if<
|
||||
!is_same<__compressed_pair_elem, typename decay<_Up>::type>::value
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
constexpr explicit
|
||||
__compressed_pair_elem(_Up&& __u)
|
||||
: __value_(_VSTD::forward<_Up>(__u)){};
|
||||
@ -2055,11 +2099,13 @@ struct __compressed_pair_elem {
|
||||
__tuple_indices<_Indexes...>)
|
||||
: __value_(_VSTD::forward<_Args>(_VSTD::get<_Indexes>(__args))...) {}
|
||||
#else
|
||||
__compressed_pair_elem() : __value_() {}
|
||||
_LIBCPP_INLINE_VISIBILITY __compressed_pair_elem() : __value_() {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__compressed_pair_elem(_ParamT __p) : __value_(std::forward<_ParamT>(__p)) {}
|
||||
#endif
|
||||
|
||||
reference __get() _NOEXCEPT { return __value_; }
|
||||
_LIBCPP_INLINE_VISIBILITY reference __get() _NOEXCEPT { return __value_; }
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reference __get() const _NOEXCEPT { return __value_; }
|
||||
|
||||
private:
|
||||
@ -2074,11 +2120,12 @@ struct __compressed_pair_elem<_Tp, _Idx, true> : private _Tp {
|
||||
typedef _Tp __value_type;
|
||||
|
||||
#ifndef _LIBCPP_CXX03_LANG
|
||||
constexpr __compressed_pair_elem() = default;
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr __compressed_pair_elem() = default;
|
||||
|
||||
template <class _Up, class = typename enable_if<
|
||||
!is_same<__compressed_pair_elem, typename decay<_Up>::type>::value
|
||||
>::type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
constexpr explicit
|
||||
__compressed_pair_elem(_Up&& __u)
|
||||
: __value_type(_VSTD::forward<_Up>(__u)){};
|
||||
@ -2089,12 +2136,14 @@ struct __compressed_pair_elem<_Tp, _Idx, true> : private _Tp {
|
||||
__tuple_indices<_Indexes...>)
|
||||
: __value_type(_VSTD::forward<_Args>(_VSTD::get<_Indexes>(__args))...) {}
|
||||
#else
|
||||
__compressed_pair_elem() : __value_type() {}
|
||||
_LIBCPP_INLINE_VISIBILITY __compressed_pair_elem() : __value_type() {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__compressed_pair_elem(_ParamT __p)
|
||||
: __value_type(std::forward<_ParamT>(__p)) {}
|
||||
#endif
|
||||
|
||||
reference __get() _NOEXCEPT { return *this; }
|
||||
_LIBCPP_INLINE_VISIBILITY reference __get() _NOEXCEPT { return *this; }
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reference __get() const _NOEXCEPT { return *this; }
|
||||
};
|
||||
|
||||
@ -4216,6 +4265,7 @@ template<class ..._Args>
|
||||
shared_ptr<_Tp>
|
||||
shared_ptr<_Tp>::make_shared(_Args&& ...__args)
|
||||
{
|
||||
static_assert( is_constructible<_Tp, _Args...>::value, "Can't construct object in make_shared" );
|
||||
typedef __shared_ptr_emplace<_Tp, allocator<_Tp> > _CntrlBlk;
|
||||
typedef allocator<_CntrlBlk> _A2;
|
||||
typedef __allocator_destructor<_A2> _D2;
|
||||
@ -4234,6 +4284,7 @@ template<class _Alloc, class ..._Args>
|
||||
shared_ptr<_Tp>
|
||||
shared_ptr<_Tp>::allocate_shared(const _Alloc& __a, _Args&& ...__args)
|
||||
{
|
||||
static_assert( is_constructible<_Tp, _Args...>::value, "Can't construct object in allocate_shared" );
|
||||
typedef __shared_ptr_emplace<_Tp, _Alloc> _CntrlBlk;
|
||||
typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _A2;
|
||||
typedef __allocator_destructor<_A2> _D2;
|
||||
@ -4254,6 +4305,7 @@ template<class _Tp>
|
||||
shared_ptr<_Tp>
|
||||
shared_ptr<_Tp>::make_shared()
|
||||
{
|
||||
static_assert((is_constructible<_Tp>::value), "Can't construct object in make_shared" );
|
||||
typedef __shared_ptr_emplace<_Tp, allocator<_Tp> > _CntrlBlk;
|
||||
typedef allocator<_CntrlBlk> _Alloc2;
|
||||
typedef __allocator_destructor<_Alloc2> _D2;
|
||||
@ -4272,6 +4324,7 @@ template<class _A0>
|
||||
shared_ptr<_Tp>
|
||||
shared_ptr<_Tp>::make_shared(_A0& __a0)
|
||||
{
|
||||
static_assert((is_constructible<_Tp, _A0>::value), "Can't construct object in make_shared" );
|
||||
typedef __shared_ptr_emplace<_Tp, allocator<_Tp> > _CntrlBlk;
|
||||
typedef allocator<_CntrlBlk> _Alloc2;
|
||||
typedef __allocator_destructor<_Alloc2> _D2;
|
||||
@ -4290,6 +4343,7 @@ template<class _A0, class _A1>
|
||||
shared_ptr<_Tp>
|
||||
shared_ptr<_Tp>::make_shared(_A0& __a0, _A1& __a1)
|
||||
{
|
||||
static_assert((is_constructible<_Tp, _A0, _A1>::value), "Can't construct object in make_shared" );
|
||||
typedef __shared_ptr_emplace<_Tp, allocator<_Tp> > _CntrlBlk;
|
||||
typedef allocator<_CntrlBlk> _Alloc2;
|
||||
typedef __allocator_destructor<_Alloc2> _D2;
|
||||
@ -4308,6 +4362,7 @@ template<class _A0, class _A1, class _A2>
|
||||
shared_ptr<_Tp>
|
||||
shared_ptr<_Tp>::make_shared(_A0& __a0, _A1& __a1, _A2& __a2)
|
||||
{
|
||||
static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in make_shared" );
|
||||
typedef __shared_ptr_emplace<_Tp, allocator<_Tp> > _CntrlBlk;
|
||||
typedef allocator<_CntrlBlk> _Alloc2;
|
||||
typedef __allocator_destructor<_Alloc2> _D2;
|
||||
@ -4326,6 +4381,7 @@ template<class _Alloc>
|
||||
shared_ptr<_Tp>
|
||||
shared_ptr<_Tp>::allocate_shared(const _Alloc& __a)
|
||||
{
|
||||
static_assert((is_constructible<_Tp>::value), "Can't construct object in allocate_shared" );
|
||||
typedef __shared_ptr_emplace<_Tp, _Alloc> _CntrlBlk;
|
||||
typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _Alloc2;
|
||||
typedef __allocator_destructor<_Alloc2> _D2;
|
||||
@ -4345,6 +4401,7 @@ template<class _Alloc, class _A0>
|
||||
shared_ptr<_Tp>
|
||||
shared_ptr<_Tp>::allocate_shared(const _Alloc& __a, _A0& __a0)
|
||||
{
|
||||
static_assert((is_constructible<_Tp, _A0>::value), "Can't construct object in allocate_shared" );
|
||||
typedef __shared_ptr_emplace<_Tp, _Alloc> _CntrlBlk;
|
||||
typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _Alloc2;
|
||||
typedef __allocator_destructor<_Alloc2> _D2;
|
||||
@ -4364,6 +4421,7 @@ template<class _Alloc, class _A0, class _A1>
|
||||
shared_ptr<_Tp>
|
||||
shared_ptr<_Tp>::allocate_shared(const _Alloc& __a, _A0& __a0, _A1& __a1)
|
||||
{
|
||||
static_assert((is_constructible<_Tp, _A0, _A1>::value), "Can't construct object in allocate_shared" );
|
||||
typedef __shared_ptr_emplace<_Tp, _Alloc> _CntrlBlk;
|
||||
typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _Alloc2;
|
||||
typedef __allocator_destructor<_Alloc2> _D2;
|
||||
@ -4383,6 +4441,7 @@ template<class _Alloc, class _A0, class _A1, class _A2>
|
||||
shared_ptr<_Tp>
|
||||
shared_ptr<_Tp>::allocate_shared(const _Alloc& __a, _A0& __a0, _A1& __a1, _A2& __a2)
|
||||
{
|
||||
static_assert((is_constructible<_Tp, _A0, _A1, _A2>::value), "Can't construct object in allocate_shared" );
|
||||
typedef __shared_ptr_emplace<_Tp, _Alloc> _CntrlBlk;
|
||||
typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _Alloc2;
|
||||
typedef __allocator_destructor<_Alloc2> _D2;
|
||||
|
@ -46,13 +46,15 @@ typedef void (*new_handler)();
|
||||
new_handler set_new_handler(new_handler new_p) noexcept;
|
||||
new_handler get_new_handler() noexcept;
|
||||
|
||||
// 21.6.4, pointer optimization barrier
|
||||
template <class T> constexpr T* launder(T* p) noexcept; // C++17
|
||||
} // std
|
||||
|
||||
void* operator new(std::size_t size); // replaceable
|
||||
void* operator new(std::size_t size, std::align_val_t alignment); // replaceable, C++17
|
||||
void* operator new(std::size_t size, const std::nothrow_t&) noexcept; // replaceable
|
||||
void* operator new(std::size_t size); // replaceable, nodiscard in C++2a
|
||||
void* operator new(std::size_t size, std::align_val_t alignment); // replaceable, C++17, nodiscard in C++2a
|
||||
void* operator new(std::size_t size, const std::nothrow_t&) noexcept; // replaceable, nodiscard in C++2a
|
||||
void* operator new(std::size_t size, std::align_val_t alignment,
|
||||
const std::nothrow_t&) noexcept; // replaceable, C++17
|
||||
const std::nothrow_t&) noexcept; // replaceable, C++17, nodiscard in C++2a
|
||||
void operator delete(void* ptr) noexcept; // replaceable
|
||||
void operator delete(void* ptr, std::size_t size) noexcept; // replaceable, C++14
|
||||
void operator delete(void* ptr, std::align_val_t alignment) noexcept; // replaceable, C++17
|
||||
@ -62,12 +64,12 @@ void operator delete(void* ptr, const std::nothrow_t&) noexcept; // repla
|
||||
void operator delete(void* ptr, std:align_val_t alignment,
|
||||
const std::nothrow_t&) noexcept; // replaceable, C++17
|
||||
|
||||
void* operator new[](std::size_t size); // replaceable
|
||||
void* operator new[](std::size_t size); // replaceable, nodiscard in C++2a
|
||||
void* operator new[](std::size_t size,
|
||||
std::align_val_t alignment) noexcept; // replaceable, C++17
|
||||
void* operator new[](std::size_t size, const std::nothrow_t&) noexcept; // replaceable
|
||||
std::align_val_t alignment) noexcept; // replaceable, C++17, nodiscard in C++2a
|
||||
void* operator new[](std::size_t size, const std::nothrow_t&) noexcept; // replaceable, nodiscard in C++2a
|
||||
void* operator new[](std::size_t size, std::align_val_t alignment,
|
||||
const std::nothrow_t&) noexcept; // replaceable, C++17
|
||||
const std::nothrow_t&) noexcept; // replaceable, C++17, nodiscard in C++2a
|
||||
void operator delete[](void* ptr) noexcept; // replaceable
|
||||
void operator delete[](void* ptr, std::size_t size) noexcept; // replaceable, C++14
|
||||
void operator delete[](void* ptr,
|
||||
@ -78,8 +80,8 @@ void operator delete[](void* ptr, const std::nothrow_t&) noexcept; // repla
|
||||
void operator delete[](void* ptr, std::align_val_t alignment,
|
||||
const std::nothrow_t&) noexcept; // replaceable, C++17
|
||||
|
||||
void* operator new (std::size_t size, void* ptr) noexcept;
|
||||
void* operator new[](std::size_t size, void* ptr) noexcept;
|
||||
void* operator new (std::size_t size, void* ptr) noexcept; // nodiscard in C++2a
|
||||
void* operator new[](std::size_t size, void* ptr) noexcept; // nodiscard in C++2a
|
||||
void operator delete (void* ptr, void*) noexcept;
|
||||
void operator delete[](void* ptr, void*) noexcept;
|
||||
|
||||
@ -92,7 +94,7 @@ void operator delete[](void* ptr, void*) noexcept;
|
||||
#include <cstdlib>
|
||||
#endif
|
||||
|
||||
#if defined(_LIBCPP_ABI_MICROSOFT)
|
||||
#if defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_NO_VCRUNTIME)
|
||||
#include <new.h>
|
||||
#endif
|
||||
|
||||
@ -114,7 +116,7 @@ void operator delete[](void* ptr, void*) noexcept;
|
||||
namespace std // purposefully not using versioning namespace
|
||||
{
|
||||
|
||||
#if !defined(_LIBCPP_ABI_MICROSOFT)
|
||||
#if !defined(_LIBCPP_ABI_MICROSOFT) || defined(_LIBCPP_NO_VCRUNTIME)
|
||||
struct _LIBCPP_TYPE_VIS nothrow_t {};
|
||||
extern _LIBCPP_FUNC_VIS const nothrow_t nothrow;
|
||||
|
||||
@ -140,7 +142,7 @@ typedef void (*new_handler)();
|
||||
_LIBCPP_FUNC_VIS new_handler set_new_handler(new_handler) _NOEXCEPT;
|
||||
_LIBCPP_FUNC_VIS new_handler get_new_handler() _NOEXCEPT;
|
||||
|
||||
#endif // !_LIBCPP_ABI_MICROSOFT
|
||||
#endif // !_LIBCPP_ABI_MICROSOFT || _LIBCPP_NO_VCRUNTIME
|
||||
|
||||
_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_bad_alloc(); // not in C++ spec
|
||||
|
||||
@ -174,18 +176,18 @@ enum align_val_t { __zero = 0, __max = (size_t)-1 };
|
||||
#define _THROW_BAD_ALLOC
|
||||
#endif
|
||||
|
||||
#if !defined(_LIBCPP_ABI_MICROSOFT)
|
||||
#if !defined(_LIBCPP_ABI_MICROSOFT) || defined(_LIBCPP_NO_VCRUNTIME)
|
||||
|
||||
_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz) _THROW_BAD_ALLOC;
|
||||
_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz) _THROW_BAD_ALLOC;
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
|
||||
_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p) _NOEXCEPT;
|
||||
_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
|
||||
#ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
|
||||
_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void operator delete(void* __p, std::size_t __sz) _NOEXCEPT;
|
||||
#endif
|
||||
|
||||
_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz) _THROW_BAD_ALLOC;
|
||||
_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz) _THROW_BAD_ALLOC;
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
|
||||
_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p) _NOEXCEPT;
|
||||
_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT;
|
||||
#ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
|
||||
@ -193,16 +195,16 @@ _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void operato
|
||||
#endif
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
|
||||
_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
|
||||
_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new(std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
|
||||
_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::align_val_t) _NOEXCEPT;
|
||||
_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
|
||||
#ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
|
||||
_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void operator delete(void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
|
||||
#endif
|
||||
|
||||
_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
|
||||
_LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, std::align_val_t, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
|
||||
_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::align_val_t) _NOEXCEPT;
|
||||
_LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete[](void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
|
||||
#ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
|
||||
@ -210,12 +212,12 @@ _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void operato
|
||||
#endif
|
||||
#endif
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY void* operator new (std::size_t, void* __p) _NOEXCEPT {return __p;}
|
||||
inline _LIBCPP_INLINE_VISIBILITY void* operator new[](std::size_t, void* __p) _NOEXCEPT {return __p;}
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_INLINE_VISIBILITY void* operator new (std::size_t, void* __p) _NOEXCEPT {return __p;}
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_INLINE_VISIBILITY void* operator new[](std::size_t, void* __p) _NOEXCEPT {return __p;}
|
||||
inline _LIBCPP_INLINE_VISIBILITY void operator delete (void*, void*) _NOEXCEPT {}
|
||||
inline _LIBCPP_INLINE_VISIBILITY void operator delete[](void*, void*) _NOEXCEPT {}
|
||||
|
||||
#endif // !_LIBCPP_ABI_MICROSOFT
|
||||
#endif // !_LIBCPP_ABI_MICROSOFT || _LIBCPP_NO_VCRUNTIME
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
@ -250,6 +252,29 @@ void __throw_bad_array_length()
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class _Tp>
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 inline
|
||||
_LIBCPP_CONSTEXPR _Tp* __launder(_Tp* __p) _NOEXCEPT
|
||||
{
|
||||
static_assert (!(is_function<_Tp>::value), "can't launder functions" );
|
||||
static_assert (!(is_same<void, typename remove_cv<_Tp>::type>::value), "can't launder cv-void" );
|
||||
#ifdef _LIBCPP_COMPILER_HAS_BUILTIN_LAUNDER
|
||||
return __builtin_launder(__p);
|
||||
#else
|
||||
return __p;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
template <class _Tp>
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_INLINE_VISIBILITY
|
||||
constexpr _Tp* launder(_Tp* __p) noexcept
|
||||
{
|
||||
return _VSTD::__launder(__p);
|
||||
}
|
||||
#endif
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
#endif // _LIBCPP_NEW
|
||||
|
@ -57,17 +57,17 @@ namespace std {
|
||||
|
||||
// 23.6.8, comparison with T
|
||||
template <class T, class U> constexpr bool operator==(const optional<T>&, const U&);
|
||||
template <class T, class U> constexpr bool operator==(const U&, const optional<T>&);
|
||||
template <class T, class U> constexpr bool operator==(const T&, const optional<U>&);
|
||||
template <class T, class U> constexpr bool operator!=(const optional<T>&, const U&);
|
||||
template <class T, class U> constexpr bool operator!=(const U&, const optional<T>&);
|
||||
template <class T, class U> constexpr bool operator!=(const T&, const optional<U>&);
|
||||
template <class T, class U> constexpr bool operator<(const optional<T>&, const U&);
|
||||
template <class T, class U> constexpr bool operator<(const U&, const optional<T>&);
|
||||
template <class T, class U> constexpr bool operator<(const T&, const optional<U>&);
|
||||
template <class T, class U> constexpr bool operator<=(const optional<T>&, const U&);
|
||||
template <class T, class U> constexpr bool operator<=(const U&, const optional<T>&);
|
||||
template <class T, class U> constexpr bool operator<=(const T&, const optional<U>&);
|
||||
template <class T, class U> constexpr bool operator>(const optional<T>&, const U&);
|
||||
template <class T, class U> constexpr bool operator>(const U&, const optional<T>&);
|
||||
template <class T, class U> constexpr bool operator>(const T&, const optional<U>&);
|
||||
template <class T, class U> constexpr bool operator>=(const optional<T>&, const U&);
|
||||
template <class T, class U> constexpr bool operator>=(const U&, const optional<T>&);
|
||||
template <class T, class U> constexpr bool operator>=(const T&, const optional<U>&);
|
||||
|
||||
// 23.6.9, specialized algorithms
|
||||
template <class T> void swap(optional<T>&, optional<T>&) noexcept(see below );
|
||||
|
@ -1071,6 +1071,20 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p)
|
||||
return __os << __p.get();
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_DECLTYPE
|
||||
template<class _CharT, class _Traits, class _Yp, class _Dp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_same<void, typename __void_t<decltype(declval<basic_ostream<_CharT, _Traits>&>() << declval<_Yp>())>::type>::value,
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
>::type
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, unique_ptr<_Yp, _Dp> const& __p)
|
||||
{
|
||||
return __os << __p.get();
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class _CharT, class _Traits, size_t _Size>
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x)
|
||||
|
@ -268,7 +268,7 @@ public:
|
||||
|
||||
#endif // _LIBCPP_CXX03_LANG
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return c.empty();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return c.size();}
|
||||
@ -490,7 +490,7 @@ public:
|
||||
_Alloc>::value>::type* = 0);
|
||||
#endif // _LIBCPP_CXX03_LANG
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return c.empty();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return c.size();}
|
||||
|
@ -2308,6 +2308,7 @@ template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
|
||||
void
|
||||
mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b,
|
||||
__t, __c, __l, __f>::seed(result_type __sd)
|
||||
_LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
|
||||
{ // __w >= 2
|
||||
__x_[0] = __sd & _Max;
|
||||
for (size_t __i = 1; __i < __n; ++__i)
|
||||
|
@ -773,6 +773,8 @@ _LIBCPP_PUSH_MACROS
|
||||
#include <__undef_macros>
|
||||
|
||||
|
||||
#define _LIBCPP_REGEX_COMPLEXITY_FACTOR 4096
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
namespace regex_constants
|
||||
@ -2407,17 +2409,28 @@ __bracket_expression<_CharT, _Traits>::__exec(__state& __s) const
|
||||
goto __exit;
|
||||
}
|
||||
}
|
||||
if (!__neg_chars_.empty())
|
||||
// set of "__found" chars =
|
||||
// union(complement(union(__neg_chars_, __neg_mask_)),
|
||||
// other cases...)
|
||||
//
|
||||
// __neg_chars_ and __neg_mask_'d better be handled together, as there
|
||||
// are no short circuit opportunities.
|
||||
//
|
||||
// In addition, when __neg_mask_/__neg_chars_ is empty, they should be
|
||||
// treated as all ones/all chars.
|
||||
{
|
||||
for (size_t __i = 0; __i < __neg_chars_.size(); ++__i)
|
||||
const bool __in_neg_mask = (__neg_mask_ == 0) ||
|
||||
__traits_.isctype(__ch, __neg_mask_);
|
||||
const bool __in_neg_chars =
|
||||
__neg_chars_.empty() ||
|
||||
std::find(__neg_chars_.begin(), __neg_chars_.end(), __ch) !=
|
||||
__neg_chars_.end();
|
||||
if (!(__in_neg_mask || __in_neg_chars))
|
||||
{
|
||||
if (__ch == __neg_chars_[__i])
|
||||
goto __is_neg_char;
|
||||
}
|
||||
__found = true;
|
||||
goto __exit;
|
||||
}
|
||||
__is_neg_char:
|
||||
}
|
||||
if (!__ranges_.empty())
|
||||
{
|
||||
string_type __s2 = __collate_ ?
|
||||
@ -2449,11 +2462,6 @@ __is_neg_char:
|
||||
__found = true;
|
||||
goto __exit;
|
||||
}
|
||||
if (__neg_mask_ && !__traits_.isctype(__ch, __neg_mask_))
|
||||
{
|
||||
__found = true;
|
||||
goto __exit;
|
||||
}
|
||||
}
|
||||
else
|
||||
__found = __negate_; // force reject
|
||||
@ -4056,6 +4064,8 @@ basic_regex<_CharT, _Traits>::__parse_DUP_COUNT(_ForwardIterator __first,
|
||||
__first != __last && ( __val = __traits_.value(*__first, 10)) != -1;
|
||||
++__first)
|
||||
{
|
||||
if (__c >= std::numeric_limits<int>::max() / 10)
|
||||
__throw_regex_error<regex_constants::error_badbrace>();
|
||||
__c *= 10;
|
||||
__c += __val;
|
||||
}
|
||||
@ -4317,8 +4327,12 @@ basic_regex<_CharT, _Traits>::__parse_decimal_escape(_ForwardIterator __first,
|
||||
unsigned __v = *__first - '0';
|
||||
for (++__first;
|
||||
__first != __last && '0' <= *__first && *__first <= '9'; ++__first)
|
||||
{
|
||||
if (__v >= std::numeric_limits<unsigned>::max() / 10)
|
||||
__throw_regex_error<regex_constants::error_backref>();
|
||||
__v = 10 * __v + *__first - '0';
|
||||
if (__v > mark_count())
|
||||
}
|
||||
if (__v == 0 || __v > mark_count())
|
||||
__throw_regex_error<regex_constants::error_backref>();
|
||||
__push_back_ref(__v);
|
||||
}
|
||||
@ -5226,11 +5240,11 @@ public:
|
||||
|
||||
// size:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return __matches_.size();}
|
||||
size_type size() const _NOEXCEPT {return __matches_.size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const {return __matches_.max_size();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return size() == 0;}
|
||||
size_type max_size() const _NOEXCEPT {return __matches_.max_size();}
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const _NOEXCEPT {return size() == 0;}
|
||||
|
||||
// element access:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@ -5263,15 +5277,15 @@ public:
|
||||
// format:
|
||||
template <class _OutputIter>
|
||||
_OutputIter
|
||||
format(_OutputIter __output, const char_type* __fmt_first,
|
||||
format(_OutputIter __output_iter, const char_type* __fmt_first,
|
||||
const char_type* __fmt_last,
|
||||
regex_constants::match_flag_type __flags = regex_constants::format_default) const;
|
||||
template <class _OutputIter, class _ST, class _SA>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_OutputIter
|
||||
format(_OutputIter __output, const basic_string<char_type, _ST, _SA>& __fmt,
|
||||
format(_OutputIter __output_iter, const basic_string<char_type, _ST, _SA>& __fmt,
|
||||
regex_constants::match_flag_type __flags = regex_constants::format_default) const
|
||||
{return format(__output, __fmt.data(), __fmt.data() + __fmt.size(), __flags);}
|
||||
{return format(__output_iter, __fmt.data(), __fmt.data() + __fmt.size(), __flags);}
|
||||
template <class _ST, class _SA>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string<char_type, _ST, _SA>
|
||||
@ -5383,7 +5397,7 @@ match_results<_BidirectionalIterator, _Allocator>::__init(unsigned __s,
|
||||
template <class _BidirectionalIterator, class _Allocator>
|
||||
template <class _OutputIter>
|
||||
_OutputIter
|
||||
match_results<_BidirectionalIterator, _Allocator>::format(_OutputIter __output,
|
||||
match_results<_BidirectionalIterator, _Allocator>::format(_OutputIter __output_iter,
|
||||
const char_type* __fmt_first, const char_type* __fmt_last,
|
||||
regex_constants::match_flag_type __flags) const
|
||||
{
|
||||
@ -5392,27 +5406,27 @@ match_results<_BidirectionalIterator, _Allocator>::format(_OutputIter __output,
|
||||
for (; __fmt_first != __fmt_last; ++__fmt_first)
|
||||
{
|
||||
if (*__fmt_first == '&')
|
||||
__output = _VSTD::copy(__matches_[0].first, __matches_[0].second,
|
||||
__output);
|
||||
__output_iter = _VSTD::copy(__matches_[0].first, __matches_[0].second,
|
||||
__output_iter);
|
||||
else if (*__fmt_first == '\\' && __fmt_first + 1 != __fmt_last)
|
||||
{
|
||||
++__fmt_first;
|
||||
if ('0' <= *__fmt_first && *__fmt_first <= '9')
|
||||
{
|
||||
size_t __i = *__fmt_first - '0';
|
||||
__output = _VSTD::copy((*this)[__i].first,
|
||||
(*this)[__i].second, __output);
|
||||
__output_iter = _VSTD::copy((*this)[__i].first,
|
||||
(*this)[__i].second, __output_iter);
|
||||
}
|
||||
else
|
||||
{
|
||||
*__output = *__fmt_first;
|
||||
++__output;
|
||||
*__output_iter = *__fmt_first;
|
||||
++__output_iter;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
*__output = *__fmt_first;
|
||||
++__output;
|
||||
*__output_iter = *__fmt_first;
|
||||
++__output_iter;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -5425,52 +5439,54 @@ match_results<_BidirectionalIterator, _Allocator>::format(_OutputIter __output,
|
||||
switch (__fmt_first[1])
|
||||
{
|
||||
case '$':
|
||||
*__output = *++__fmt_first;
|
||||
++__output;
|
||||
*__output_iter = *++__fmt_first;
|
||||
++__output_iter;
|
||||
break;
|
||||
case '&':
|
||||
++__fmt_first;
|
||||
__output = _VSTD::copy(__matches_[0].first, __matches_[0].second,
|
||||
__output);
|
||||
__output_iter = _VSTD::copy(__matches_[0].first, __matches_[0].second,
|
||||
__output_iter);
|
||||
break;
|
||||
case '`':
|
||||
++__fmt_first;
|
||||
__output = _VSTD::copy(__prefix_.first, __prefix_.second, __output);
|
||||
__output_iter = _VSTD::copy(__prefix_.first, __prefix_.second, __output_iter);
|
||||
break;
|
||||
case '\'':
|
||||
++__fmt_first;
|
||||
__output = _VSTD::copy(__suffix_.first, __suffix_.second, __output);
|
||||
__output_iter = _VSTD::copy(__suffix_.first, __suffix_.second, __output_iter);
|
||||
break;
|
||||
default:
|
||||
if ('0' <= __fmt_first[1] && __fmt_first[1] <= '9')
|
||||
{
|
||||
++__fmt_first;
|
||||
size_t __i = *__fmt_first - '0';
|
||||
size_t __idx = *__fmt_first - '0';
|
||||
if (__fmt_first + 1 != __fmt_last &&
|
||||
'0' <= __fmt_first[1] && __fmt_first[1] <= '9')
|
||||
{
|
||||
++__fmt_first;
|
||||
__i = 10 * __i + *__fmt_first - '0';
|
||||
if (__idx >= std::numeric_limits<size_t>::max() / 10)
|
||||
__throw_regex_error<regex_constants::error_escape>();
|
||||
__idx = 10 * __idx + *__fmt_first - '0';
|
||||
}
|
||||
__output = _VSTD::copy((*this)[__i].first,
|
||||
(*this)[__i].second, __output);
|
||||
__output_iter = _VSTD::copy((*this)[__idx].first,
|
||||
(*this)[__idx].second, __output_iter);
|
||||
}
|
||||
else
|
||||
{
|
||||
*__output = *__fmt_first;
|
||||
++__output;
|
||||
*__output_iter = *__fmt_first;
|
||||
++__output_iter;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
*__output = *__fmt_first;
|
||||
++__output;
|
||||
*__output_iter = *__fmt_first;
|
||||
++__output_iter;
|
||||
}
|
||||
}
|
||||
}
|
||||
return __output;
|
||||
return __output_iter;
|
||||
}
|
||||
|
||||
template <class _BidirectionalIterator, class _Allocator>
|
||||
@ -5552,8 +5568,14 @@ basic_regex<_CharT, _Traits>::__match_at_start_ecma(
|
||||
__states.back().__node_ = __st;
|
||||
__states.back().__flags_ = __flags;
|
||||
__states.back().__at_first_ = __at_first;
|
||||
int __counter = 0;
|
||||
int __length = __last - __first;
|
||||
do
|
||||
{
|
||||
++__counter;
|
||||
if (__counter % _LIBCPP_REGEX_COMPLEXITY_FACTOR == 0 &&
|
||||
__counter / _LIBCPP_REGEX_COMPLEXITY_FACTOR >= __length)
|
||||
__throw_regex_error<regex_constants::error_complexity>();
|
||||
__state& __s = __states.back();
|
||||
if (__s.__node_)
|
||||
__s.__node_->__exec(__s);
|
||||
@ -5627,8 +5649,14 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_nosubs(
|
||||
__states.back().__flags_ = __flags;
|
||||
__states.back().__at_first_ = __at_first;
|
||||
bool __matched = false;
|
||||
int __counter = 0;
|
||||
int __length = __last - __first;
|
||||
do
|
||||
{
|
||||
++__counter;
|
||||
if (__counter % _LIBCPP_REGEX_COMPLEXITY_FACTOR == 0 &&
|
||||
__counter / _LIBCPP_REGEX_COMPLEXITY_FACTOR >= __length)
|
||||
__throw_regex_error<regex_constants::error_complexity>();
|
||||
__state& __s = __states.back();
|
||||
if (__s.__node_)
|
||||
__s.__node_->__exec(__s);
|
||||
@ -5724,8 +5752,14 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_subs(
|
||||
__states.back().__at_first_ = __at_first;
|
||||
const _CharT* __current = __first;
|
||||
bool __matched = false;
|
||||
int __counter = 0;
|
||||
int __length = __last - __first;
|
||||
do
|
||||
{
|
||||
++__counter;
|
||||
if (__counter % _LIBCPP_REGEX_COMPLEXITY_FACTOR == 0 &&
|
||||
__counter / _LIBCPP_REGEX_COMPLEXITY_FACTOR >= __length)
|
||||
__throw_regex_error<regex_constants::error_complexity>();
|
||||
__state& __s = __states.back();
|
||||
if (__s.__node_)
|
||||
__s.__node_->__exec(__s);
|
||||
@ -6460,7 +6494,7 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
|
||||
template <class _OutputIterator, class _BidirectionalIterator,
|
||||
class _Traits, class _CharT>
|
||||
_OutputIterator
|
||||
regex_replace(_OutputIterator __output,
|
||||
regex_replace(_OutputIterator __output_iter,
|
||||
_BidirectionalIterator __first, _BidirectionalIterator __last,
|
||||
const basic_regex<_CharT, _Traits>& __e, const _CharT* __fmt,
|
||||
regex_constants::match_flag_type __flags = regex_constants::match_default)
|
||||
@ -6471,7 +6505,7 @@ regex_replace(_OutputIterator __output,
|
||||
if (__i == __eof)
|
||||
{
|
||||
if (!(__flags & regex_constants::format_no_copy))
|
||||
__output = _VSTD::copy(__first, __last, __output);
|
||||
__output_iter = _VSTD::copy(__first, __last, __output_iter);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -6479,29 +6513,29 @@ regex_replace(_OutputIterator __output,
|
||||
for (size_t __len = char_traits<_CharT>::length(__fmt); __i != __eof; ++__i)
|
||||
{
|
||||
if (!(__flags & regex_constants::format_no_copy))
|
||||
__output = _VSTD::copy(__i->prefix().first, __i->prefix().second, __output);
|
||||
__output = __i->format(__output, __fmt, __fmt + __len, __flags);
|
||||
__output_iter = _VSTD::copy(__i->prefix().first, __i->prefix().second, __output_iter);
|
||||
__output_iter = __i->format(__output_iter, __fmt, __fmt + __len, __flags);
|
||||
__lm = __i->suffix();
|
||||
if (__flags & regex_constants::format_first_only)
|
||||
break;
|
||||
}
|
||||
if (!(__flags & regex_constants::format_no_copy))
|
||||
__output = _VSTD::copy(__lm.first, __lm.second, __output);
|
||||
__output_iter = _VSTD::copy(__lm.first, __lm.second, __output_iter);
|
||||
}
|
||||
return __output;
|
||||
return __output_iter;
|
||||
}
|
||||
|
||||
template <class _OutputIterator, class _BidirectionalIterator,
|
||||
class _Traits, class _CharT, class _ST, class _SA>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_OutputIterator
|
||||
regex_replace(_OutputIterator __output,
|
||||
regex_replace(_OutputIterator __output_iter,
|
||||
_BidirectionalIterator __first, _BidirectionalIterator __last,
|
||||
const basic_regex<_CharT, _Traits>& __e,
|
||||
const basic_string<_CharT, _ST, _SA>& __fmt,
|
||||
regex_constants::match_flag_type __flags = regex_constants::match_default)
|
||||
{
|
||||
return _VSTD::regex_replace(__output, __first, __last, __e, __fmt.c_str(), __flags);
|
||||
return _VSTD::regex_replace(__output_iter, __first, __last, __e, __fmt.c_str(), __flags);
|
||||
}
|
||||
|
||||
template <class _Traits, class _CharT, class _ST, class _SA, class _FST,
|
||||
|
@ -68,8 +68,8 @@ public:
|
||||
outer_allocator_type& outer_allocator() noexcept;
|
||||
const outer_allocator_type& outer_allocator() const noexcept;
|
||||
|
||||
pointer allocate(size_type n);
|
||||
pointer allocate(size_type n, const_void_pointer hint);
|
||||
pointer allocate(size_type n); // [[nodiscard]] in C++20
|
||||
pointer allocate(size_type n, const_void_pointer hint); // [[nodiscard]] in C++20
|
||||
void deallocate(pointer p, size_type n) noexcept;
|
||||
|
||||
size_type max_size() const;
|
||||
@ -477,11 +477,11 @@ public:
|
||||
const outer_allocator_type& outer_allocator() const _NOEXCEPT
|
||||
{return base::outer_allocator();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
|
||||
pointer allocate(size_type __n)
|
||||
{return allocator_traits<outer_allocator_type>::
|
||||
allocate(outer_allocator(), __n);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
|
||||
pointer allocate(size_type __n, const_void_pointer __hint)
|
||||
{return allocator_traits<outer_allocator_type>::
|
||||
allocate(outer_allocator(), __n, __hint);}
|
||||
|
@ -575,7 +575,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crend() const _NOEXCEPT {return rend();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const _NOEXCEPT {return __tree_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const _NOEXCEPT {return __tree_.size();}
|
||||
@ -984,7 +984,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator crend() const _NOEXCEPT {return rend();}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const _NOEXCEPT {return __tree_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const _NOEXCEPT {return __tree_.size();}
|
||||
|
@ -243,7 +243,6 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(ios_base::openmode
|
||||
: __hm_(0),
|
||||
__mode_(__wch)
|
||||
{
|
||||
str(string_type());
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
@ -289,7 +288,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(basic_stringbuf&&
|
||||
if (__bout != -1)
|
||||
{
|
||||
this->setp(__p + __bout, __p + __eout);
|
||||
this->pbump(__nout);
|
||||
this->__pbump(__nout);
|
||||
}
|
||||
__hm_ = __hm == -1 ? nullptr : __p + __hm;
|
||||
__p = const_cast<char_type*>(__rhs.__str_.data());
|
||||
@ -332,7 +331,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::operator=(basic_stringbuf&& __rhs)
|
||||
if (__bout != -1)
|
||||
{
|
||||
this->setp(__p + __bout, __p + __eout);
|
||||
this->pbump(__nout);
|
||||
this->__pbump(__nout);
|
||||
}
|
||||
else
|
||||
this->setp(nullptr, nullptr);
|
||||
@ -403,7 +402,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::swap(basic_stringbuf& __rhs)
|
||||
if (__rbout != -1)
|
||||
{
|
||||
this->setp(__p + __rbout, __p + __reout);
|
||||
this->pbump(__rnout);
|
||||
this->__pbump(__rnout);
|
||||
}
|
||||
else
|
||||
this->setp(nullptr, nullptr);
|
||||
@ -416,7 +415,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::swap(basic_stringbuf& __rhs)
|
||||
if (__lbout != -1)
|
||||
{
|
||||
__rhs.setp(__p + __lbout, __p + __leout);
|
||||
__rhs.pbump(__lnout);
|
||||
__rhs.__pbump(__lnout);
|
||||
}
|
||||
else
|
||||
__rhs.setp(nullptr, nullptr);
|
||||
@ -471,8 +470,16 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::str(const string_type& __s)
|
||||
this->setp(const_cast<char_type*>(__str_.data()),
|
||||
const_cast<char_type*>(__str_.data()) + __str_.size());
|
||||
if (__mode_ & (ios_base::app | ios_base::ate))
|
||||
{
|
||||
while (__sz > INT_MAX)
|
||||
{
|
||||
this->pbump(INT_MAX);
|
||||
__sz -= INT_MAX;
|
||||
}
|
||||
if (__sz > 0)
|
||||
this->pbump(__sz);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits, class _Allocator>
|
||||
@ -536,7 +543,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::overflow(int_type __c)
|
||||
__str_.resize(__str_.capacity());
|
||||
char_type* __p = const_cast<char_type*>(__str_.data());
|
||||
this->setp(__p, __p + __str_.size());
|
||||
this->pbump(__nout);
|
||||
this->__pbump(__nout);
|
||||
__hm_ = this->pbase() + __hm;
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
|
@ -181,7 +181,7 @@ public:
|
||||
: c(_VSTD::move(__s.c), __a) {}
|
||||
#endif // _LIBCPP_CXX03_LANG
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const {return c.empty();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const {return c.size();}
|
||||
|
@ -255,6 +255,9 @@ protected:
|
||||
inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
|
||||
void pbump(int __n) { __nout_ += __n; }
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
void __pbump(streamsize __n) { __nout_ += __n; }
|
||||
|
||||
inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
|
||||
void setp(char_type* __pbeg, char_type* __pend) {
|
||||
__bout_ = __nout_ = __pbeg;
|
||||
@ -404,7 +407,8 @@ basic_streambuf<_CharT, _Traits>::xsgetn(char_type* __s, streamsize __n)
|
||||
{
|
||||
if (__ninp_ < __einp_)
|
||||
{
|
||||
const streamsize __len = _VSTD::min(__einp_ - __ninp_, __n - __i);
|
||||
const streamsize __len = _VSTD::min(static_cast<streamsize>(INT_MAX),
|
||||
_VSTD::min(__einp_ - __ninp_, __n - __i));
|
||||
traits_type::copy(__s, __ninp_, __len);
|
||||
__s += __len;
|
||||
__i += __len;
|
||||
|
@ -301,6 +301,13 @@ public:
|
||||
int compare(size_type pos1, size_type n1, const value_type* s) const;
|
||||
int compare(size_type pos1, size_type n1, const value_type* s, size_type n2) const;
|
||||
|
||||
bool starts_with(basic_string_view<charT, traits> sv) const noexcept; // C++2a
|
||||
bool starts_with(charT c) const noexcept; // C++2a
|
||||
bool starts_with(const charT* s) const; // C++2a
|
||||
bool ends_with(basic_string_view<charT, traits> sv) const noexcept; // C++2a
|
||||
bool ends_with(charT c) const noexcept; // C++2a
|
||||
bool ends_with(const charT* s) const; // C++2a
|
||||
|
||||
bool __invariants() const;
|
||||
};
|
||||
|
||||
@ -670,7 +677,7 @@ private:
|
||||
size_type __cap_;
|
||||
};
|
||||
|
||||
#if _LIBCPP_BIG_ENDIAN
|
||||
#ifdef _LIBCPP_BIG_ENDIAN
|
||||
static const size_type __short_mask = 0x01;
|
||||
static const size_type __long_mask = 0x1ul;
|
||||
#else // _LIBCPP_BIG_ENDIAN
|
||||
@ -700,7 +707,7 @@ private:
|
||||
pointer __data_;
|
||||
};
|
||||
|
||||
#if _LIBCPP_BIG_ENDIAN
|
||||
#ifdef _LIBCPP_BIG_ENDIAN
|
||||
static const size_type __short_mask = 0x80;
|
||||
static const size_type __long_mask = ~(size_type(~0) >> 1);
|
||||
#else // _LIBCPP_BIG_ENDIAN
|
||||
@ -901,7 +908,8 @@ public:
|
||||
void shrink_to_fit() _NOEXCEPT {reserve();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void clear() _NOEXCEPT;
|
||||
_LIBCPP_INLINE_VISIBILITY bool empty() const _NOEXCEPT {return size() == 0;}
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const _NOEXCEPT {return size() == 0;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY const_reference operator[](size_type __pos) const _NOEXCEPT;
|
||||
_LIBCPP_INLINE_VISIBILITY reference operator[](size_type __pos) _NOEXCEPT;
|
||||
@ -1127,7 +1135,7 @@ public:
|
||||
const value_type* c_str() const _NOEXCEPT {return data();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const value_type* data() const _NOEXCEPT {return _VSTD::__to_raw_pointer(__get_pointer());}
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
#if _LIBCPP_STD_VER > 14 || defined(_LIBCPP_BUILDING_LIBRARY)
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
value_type* data() _NOEXCEPT {return _VSTD::__to_raw_pointer(__get_pointer());}
|
||||
#endif
|
||||
@ -1214,6 +1222,32 @@ public:
|
||||
int compare(size_type __pos1, size_type __n1, const value_type* __s) const;
|
||||
int compare(size_type __pos1, size_type __n1, const value_type* __s, size_type __n2) const;
|
||||
|
||||
#if _LIBCPP_STD_VER > 17
|
||||
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
||||
bool starts_with(__self_view __sv) const _NOEXCEPT
|
||||
{ return __self_view(data(), size()).starts_with(__sv); }
|
||||
|
||||
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
||||
bool starts_with(value_type __c) const _NOEXCEPT
|
||||
{ return !empty() && _Traits::eq(front(), __c); }
|
||||
|
||||
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
||||
bool starts_with(const value_type* __s) const _NOEXCEPT
|
||||
{ return starts_with(__self_view(__s)); }
|
||||
|
||||
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
||||
bool ends_with(__self_view __sv) const _NOEXCEPT
|
||||
{ return __self_view(data(), size()).ends_with( __sv); }
|
||||
|
||||
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
||||
bool ends_with(value_type __c) const _NOEXCEPT
|
||||
{ return !empty() && _Traits::eq(back(), __c); }
|
||||
|
||||
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
||||
bool ends_with(const value_type* __s) const _NOEXCEPT
|
||||
{ return ends_with(__self_view(__s)); }
|
||||
#endif
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY bool __invariants() const;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@ -1241,7 +1275,7 @@ private:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __set_short_size(size_type __s) _NOEXCEPT
|
||||
# if _LIBCPP_BIG_ENDIAN
|
||||
# ifdef _LIBCPP_BIG_ENDIAN
|
||||
{__r_.first().__s.__size_ = (unsigned char)(__s << 1);}
|
||||
# else
|
||||
{__r_.first().__s.__size_ = (unsigned char)(__s);}
|
||||
@ -1249,7 +1283,7 @@ private:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type __get_short_size() const _NOEXCEPT
|
||||
# if _LIBCPP_BIG_ENDIAN
|
||||
# ifdef _LIBCPP_BIG_ENDIAN
|
||||
{return __r_.first().__s.__size_ >> 1;}
|
||||
# else
|
||||
{return __r_.first().__s.__size_;}
|
||||
@ -1259,7 +1293,7 @@ private:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __set_short_size(size_type __s) _NOEXCEPT
|
||||
# if _LIBCPP_BIG_ENDIAN
|
||||
# ifdef _LIBCPP_BIG_ENDIAN
|
||||
{__r_.first().__s.__size_ = (unsigned char)(__s);}
|
||||
# else
|
||||
{__r_.first().__s.__size_ = (unsigned char)(__s << 1);}
|
||||
@ -1267,7 +1301,7 @@ private:
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type __get_short_size() const _NOEXCEPT
|
||||
# if _LIBCPP_BIG_ENDIAN
|
||||
# ifdef _LIBCPP_BIG_ENDIAN
|
||||
{return __r_.first().__s.__size_;}
|
||||
# else
|
||||
{return __r_.first().__s.__size_ >> 1;}
|
||||
@ -2870,7 +2904,7 @@ typename basic_string<_CharT, _Traits, _Allocator>::size_type
|
||||
basic_string<_CharT, _Traits, _Allocator>::max_size() const _NOEXCEPT
|
||||
{
|
||||
size_type __m = __alloc_traits::max_size(__alloc());
|
||||
#if _LIBCPP_BIG_ENDIAN
|
||||
#ifdef _LIBCPP_BIG_ENDIAN
|
||||
return (__m <= ~__long_mask ? __m : __m/2) - __alignment;
|
||||
#else
|
||||
return __m - __alignment;
|
||||
|
@ -143,6 +143,13 @@ namespace std {
|
||||
constexpr size_type find_last_not_of(const charT* s, size_type pos, size_type n) const;
|
||||
constexpr size_type find_last_not_of(const charT* s, size_type pos = npos) const;
|
||||
|
||||
constexpr bool starts_with(basic_string_view s) const noexcept; // C++2a
|
||||
constexpr bool starts_with(charT c) const noexcept; // C++2a
|
||||
constexpr bool starts_with(const charT* s) const; // C++2a
|
||||
constexpr bool ends_with(basic_string_view s) const noexcept; // C++2a
|
||||
constexpr bool ends_with(charT c) const noexcept; // C++2a
|
||||
constexpr bool ends_with(const charT* s) const; // C++2a
|
||||
|
||||
private:
|
||||
const_pointer data_; // exposition only
|
||||
size_type size_; // exposition only
|
||||
@ -155,10 +162,10 @@ namespace std {
|
||||
template <> struct hash<u32string_view>;
|
||||
template <> struct hash<wstring_view>;
|
||||
|
||||
constexpr basic_string<char> operator "" s( const char *str, size_t len ); // C++17
|
||||
constexpr basic_string<wchar_t> operator "" s( const wchar_t *str, size_t len ); // C++17
|
||||
constexpr basic_string<char16_t> operator "" s( const char16_t *str, size_t len ); // C++17
|
||||
constexpr basic_string<char32_t> operator "" s( const char32_t *str, size_t len ); // C++17
|
||||
constexpr basic_string_view<char> operator "" sv( const char *str, size_t len ) noexcept;
|
||||
constexpr basic_string_view<wchar_t> operator "" sv( const wchar_t *str, size_t len ) noexcept;
|
||||
constexpr basic_string_view<char16_t> operator "" sv( const char16_t *str, size_t len ) noexcept;
|
||||
constexpr basic_string_view<char32_t> operator "" sv( const char32_t *str, size_t len ) noexcept;
|
||||
|
||||
} // namespace std
|
||||
|
||||
@ -216,7 +223,7 @@ public:
|
||||
basic_string_view& operator=(const basic_string_view&) _NOEXCEPT = default;
|
||||
|
||||
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
|
||||
basic_string_view(const _CharT* __s, size_type __len)
|
||||
basic_string_view(const _CharT* __s, size_type __len) _NOEXCEPT
|
||||
: __data(__s), __size(__len)
|
||||
{
|
||||
// #if _LIBCPP_STD_VER > 11
|
||||
@ -263,8 +270,8 @@ public:
|
||||
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const _NOEXCEPT { return numeric_limits<size_type>::max(); }
|
||||
|
||||
_LIBCPP_CONSTEXPR bool _LIBCPP_INLINE_VISIBILITY
|
||||
empty() const _NOEXCEPT { return __size == 0; }
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||
bool empty() const _NOEXCEPT { return __size == 0; }
|
||||
|
||||
// [string.view.access], element access
|
||||
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
|
||||
@ -565,6 +572,32 @@ public:
|
||||
(data(), size(), __s, __pos, traits_type::length(__s));
|
||||
}
|
||||
|
||||
#if _LIBCPP_STD_VER > 17
|
||||
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
||||
bool starts_with(basic_string_view __s) const _NOEXCEPT
|
||||
{ return size() >= __s.size() && compare(0, __s.size(), __s) == 0; }
|
||||
|
||||
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
||||
bool starts_with(value_type __c) const _NOEXCEPT
|
||||
{ return !empty() && _Traits::eq(front(), __c); }
|
||||
|
||||
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
||||
bool starts_with(const value_type* __s) const _NOEXCEPT
|
||||
{ return starts_with(basic_string_view(__s)); }
|
||||
|
||||
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
||||
bool ends_with(basic_string_view __s) const _NOEXCEPT
|
||||
{ return size() >= __s.size() && compare(size() - __s.size(), npos, __s) == 0; }
|
||||
|
||||
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
||||
bool ends_with(value_type __c) const _NOEXCEPT
|
||||
{ return !empty() && _Traits::eq(back(), __c); }
|
||||
|
||||
_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
|
||||
bool ends_with(const value_type* __s) const _NOEXCEPT
|
||||
{ return ends_with(basic_string_view(__s)); }
|
||||
#endif
|
||||
|
||||
private:
|
||||
const value_type* __data;
|
||||
size_type __size;
|
||||
@ -760,25 +793,25 @@ inline namespace literals
|
||||
inline namespace string_view_literals
|
||||
{
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||
basic_string_view<char> operator "" sv(const char *__str, size_t __len)
|
||||
basic_string_view<char> operator "" sv(const char *__str, size_t __len) _NOEXCEPT
|
||||
{
|
||||
return basic_string_view<char> (__str, __len);
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||
basic_string_view<wchar_t> operator "" sv(const wchar_t *__str, size_t __len)
|
||||
basic_string_view<wchar_t> operator "" sv(const wchar_t *__str, size_t __len) _NOEXCEPT
|
||||
{
|
||||
return basic_string_view<wchar_t> (__str, __len);
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||
basic_string_view<char16_t> operator "" sv(const char16_t *__str, size_t __len)
|
||||
basic_string_view<char16_t> operator "" sv(const char16_t *__str, size_t __len) _NOEXCEPT
|
||||
{
|
||||
return basic_string_view<char16_t> (__str, __len);
|
||||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||
basic_string_view<char32_t> operator "" sv(const char32_t *__str, size_t __len)
|
||||
basic_string_view<char32_t> operator "" sv(const char32_t *__str, size_t __len) _NOEXCEPT
|
||||
{
|
||||
return basic_string_view<char32_t> (__str, __len);
|
||||
}
|
||||
|
@ -230,6 +230,7 @@ template <> struct hash<std::error_condition>;
|
||||
#include <type_traits>
|
||||
#include <stdexcept>
|
||||
#include <__functional_base>
|
||||
#include <string>
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
#pragma GCC system_header
|
||||
|
@ -929,7 +929,7 @@ public:
|
||||
void swap(tuple&) _NOEXCEPT {}
|
||||
};
|
||||
|
||||
#ifdef __cpp_deduction_guides
|
||||
#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
|
||||
// NOTE: These are not yet standardized, but are required to simulate the
|
||||
// implicit deduction guide that should be generated had libc++ declared the
|
||||
// tuple-like constructors "correctly"
|
||||
@ -1012,10 +1012,10 @@ constexpr size_t __find_idx(size_t __i, const bool (&__matches)[_Nx]) {
|
||||
|
||||
template <class _T1, class ..._Args>
|
||||
struct __find_exactly_one_checked {
|
||||
static constexpr bool __matches[] = {is_same<_T1, _Args>::value...};
|
||||
static constexpr bool __matches[sizeof...(_Args)] = {is_same<_T1, _Args>::value...};
|
||||
static constexpr size_t value = __find_detail::__find_idx(0, __matches);
|
||||
static_assert (value != __not_found, "type not found in type list" );
|
||||
static_assert(value != __ambiguous,"type occurs more than once in type list");
|
||||
static_assert(value != __not_found, "type not found in type list" );
|
||||
static_assert(value != __ambiguous, "type occurs more than once in type list");
|
||||
};
|
||||
|
||||
template <class _T1>
|
||||
|
@ -137,25 +137,25 @@ namespace std
|
||||
template <class Base, class Derived> struct is_base_of;
|
||||
template <class From, class To> struct is_convertible;
|
||||
|
||||
template <class, class R = void> struct is_callable; // not defined
|
||||
template <class Fn, class... ArgTypes, class R>
|
||||
struct is_callable<Fn(ArgTypes...), R>;
|
||||
template <class Fn, class... ArgTypes> struct is_invocable;
|
||||
template <class R, class Fn, class... ArgTypes> struct is_invocable_r;
|
||||
|
||||
template <class, class R = void> struct is_nothrow_callable; // not defined
|
||||
template <class Fn, class... ArgTypes, class R>
|
||||
struct is_nothrow_callable<Fn(ArgTypes...), R>;
|
||||
template <class Fn, class... ArgTypes> struct is_nothrow_invocable;
|
||||
template <class R, class Fn, class... ArgTypes> struct is_nothrow_invocable_r;
|
||||
|
||||
// Alignment properties and transformations:
|
||||
template <class T> struct alignment_of;
|
||||
template <size_t Len, size_t Align = most_stringent_alignment_requirement>
|
||||
struct aligned_storage;
|
||||
template <size_t Len, class... Types> struct aligned_union;
|
||||
template <class T> struct remove_cvref; // C++20
|
||||
|
||||
template <class T> struct decay;
|
||||
template <class... T> struct common_type;
|
||||
template <class T> struct underlying_type;
|
||||
template <class> class result_of; // undefined
|
||||
template <class Fn, class... ArgTypes> class result_of<Fn(ArgTypes...)>;
|
||||
template <class Fn, class... ArgTypes> struct invoke_result; // C++17
|
||||
|
||||
// const-volatile modifications:
|
||||
template <class T>
|
||||
@ -202,6 +202,8 @@ namespace std
|
||||
using aligned_storage_t = typename aligned_storage<Len,Align>::type; // C++14
|
||||
template <std::size_t Len, class... Types>
|
||||
using aligned_union_t = typename aligned_union<Len,Types...>::type; // C++14
|
||||
template <class T>
|
||||
using remove_cvref_t = typename remove_cvref<T>::type; // C++20
|
||||
template <class T>
|
||||
using decay_t = typename decay<T>::type; // C++14
|
||||
template <bool b, class T=void>
|
||||
@ -212,8 +214,10 @@ namespace std
|
||||
using common_type_t = typename common_type<T...>::type; // C++14
|
||||
template <class T>
|
||||
using underlying_type_t = typename underlying_type<T>::type; // C++14
|
||||
template <class F, class... ArgTypes>
|
||||
using result_of_t = typename result_of<F(ArgTypes...)>::type; // C++14
|
||||
template <class T>
|
||||
using result_of_t = typename result_of<T>::type; // C++14
|
||||
template <class Fn, class... ArgTypes>
|
||||
using invoke_result_t = typename invoke_result<Fn, ArgTypes...>::type; // C++17
|
||||
|
||||
template <class...>
|
||||
using void_t = void; // C++17
|
||||
@ -367,10 +371,14 @@ namespace std
|
||||
= is_base_of<Base, Derived>::value; // C++17
|
||||
template <class From, class To> constexpr bool is_convertible_v
|
||||
= is_convertible<From, To>::value; // C++17
|
||||
template <class T, class R = void> constexpr bool is_callable_v
|
||||
= is_callable<T, R>::value; // C++17
|
||||
template <class T, class R = void> constexpr bool is_nothrow_callable_v
|
||||
= is_nothrow_callable<T, R>::value; // C++17
|
||||
template <class Fn, class... ArgTypes> constexpr bool is_invocable_v
|
||||
= is_invocable<Fn, ArgTypes...>::value; // C++17
|
||||
template <class R, class Fn, class... ArgTypes> constexpr bool is_invocable_r_v
|
||||
= is_invocable_r<R, Fn, ArgTypes...>::value; // C++17
|
||||
template <class Fn, class... ArgTypes> constexpr bool is_nothrow_invocable_v
|
||||
= is_nothrow_invocable<Fn, ArgTypes...>::value; // C++17
|
||||
template <class R, class Fn, class... ArgTypes> constexpr bool is_nothrow_invocable_r_v
|
||||
= is_nothrow_invocable_r<R, Fn, ArgTypes...>::value; // C++17
|
||||
|
||||
// [meta.logical], logical operator traits:
|
||||
template<class... B> struct conjunction; // C++17
|
||||
@ -1141,6 +1149,17 @@ template <class _Tp, class _Up>
|
||||
struct __is_same_uncvref : is_same<typename __uncvref<_Tp>::type,
|
||||
typename __uncvref<_Up>::type> {};
|
||||
|
||||
#if _LIBCPP_STD_VER > 17
|
||||
// aligned_union - same as __uncvref
|
||||
template <class _Tp>
|
||||
struct remove_cvref {
|
||||
using type = remove_cv_t<remove_reference_t<_Tp>>;
|
||||
};
|
||||
|
||||
template <class _Tp> using remove_cvref_t = typename remove_cvref<_Tp>::type;
|
||||
#endif
|
||||
|
||||
|
||||
struct __any
|
||||
{
|
||||
__any(...);
|
||||
@ -4387,6 +4406,13 @@ using __nothrow_invokable_r =
|
||||
_Ret, _Fp, _Args...
|
||||
>;
|
||||
|
||||
template <class _Fp, class ..._Args>
|
||||
using __nothrow_invokable =
|
||||
__nothrow_invokable_r_imp<
|
||||
__invokable<_Fp, _Args...>::value,
|
||||
true, void, _Fp, _Args...
|
||||
>;
|
||||
|
||||
template <class _Fp, class ..._Args>
|
||||
struct __invoke_of
|
||||
: public enable_if<
|
||||
@ -4409,30 +4435,48 @@ template <class _Tp> using result_of_t = typename result_of<_Tp>::type;
|
||||
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
|
||||
// is_callable
|
||||
// invoke_result
|
||||
|
||||
template <class _Fn, class _Ret = void>
|
||||
struct _LIBCPP_TEMPLATE_VIS is_callable;
|
||||
template <class _Fn, class... _Args>
|
||||
struct _LIBCPP_TEMPLATE_VIS invoke_result
|
||||
: __invoke_of<_Fn, _Args...>
|
||||
{
|
||||
};
|
||||
|
||||
template <class _Fn, class ..._Args, class _Ret>
|
||||
struct _LIBCPP_TEMPLATE_VIS is_callable<_Fn(_Args...), _Ret>
|
||||
template <class _Fn, class... _Args>
|
||||
using invoke_result_t = typename invoke_result<_Fn, _Args...>::type;
|
||||
|
||||
// is_invocable
|
||||
|
||||
template <class _Fn, class ..._Args>
|
||||
struct _LIBCPP_TEMPLATE_VIS is_invocable
|
||||
: integral_constant<bool, __invokable<_Fn, _Args...>::value> {};
|
||||
|
||||
template <class _Ret, class _Fn, class ..._Args>
|
||||
struct _LIBCPP_TEMPLATE_VIS is_invocable_r
|
||||
: integral_constant<bool, __invokable_r<_Ret, _Fn, _Args...>::value> {};
|
||||
|
||||
template <class _Fn, class _Ret = void>
|
||||
constexpr bool is_callable_v = is_callable<_Fn, _Ret>::value;
|
||||
template <class _Fn, class ..._Args>
|
||||
constexpr bool is_invocable_v = is_invocable<_Fn, _Args...>::value;
|
||||
|
||||
template <class _Ret, class _Fn, class ..._Args>
|
||||
constexpr bool is_invocable_r_v = is_invocable_r<_Ret, _Fn, _Args...>::value;
|
||||
|
||||
// is_nothrow_callable
|
||||
|
||||
template <class _Fn, class _Ret = void>
|
||||
struct _LIBCPP_TEMPLATE_VIS is_nothrow_callable;
|
||||
template <class _Fn, class ..._Args>
|
||||
struct _LIBCPP_TEMPLATE_VIS is_nothrow_invocable
|
||||
: integral_constant<bool, __nothrow_invokable<_Fn, _Args...>::value> {};
|
||||
|
||||
template <class _Fn, class ..._Args, class _Ret>
|
||||
struct _LIBCPP_TEMPLATE_VIS is_nothrow_callable<_Fn(_Args...), _Ret>
|
||||
: integral_constant<bool, __nothrow_invokable_r<_Ret, _Fn, _Args...>::value>
|
||||
{};
|
||||
template <class _Ret, class _Fn, class ..._Args>
|
||||
struct _LIBCPP_TEMPLATE_VIS is_nothrow_invocable_r
|
||||
: integral_constant<bool, __nothrow_invokable_r<_Ret, _Fn, _Args...>::value> {};
|
||||
|
||||
template <class _Fn, class _Ret = void>
|
||||
constexpr bool is_nothrow_callable_v = is_nothrow_callable<_Fn, _Ret>::value;
|
||||
template <class _Fn, class ..._Args>
|
||||
constexpr bool is_nothrow_invocable_v = is_nothrow_invocable<_Fn, _Args...>::value;
|
||||
|
||||
template <class _Ret, class _Fn, class ..._Args>
|
||||
constexpr bool is_nothrow_invocable_r_v = is_nothrow_invocable_r<_Ret, _Fn, _Args...>::value;
|
||||
|
||||
#endif // _LIBCPP_STD_VER > 14
|
||||
|
||||
@ -4638,6 +4682,11 @@ long long __convert_to_integral(long long __val) { return __val; }
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
unsigned long long __convert_to_integral(unsigned long long __val) {return __val; }
|
||||
|
||||
template<typename _Fp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_floating_point<_Fp>::value, long long>::type
|
||||
__convert_to_integral(_Fp __val) { return __val; }
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_INT128
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__int128_t __convert_to_integral(__int128_t __val) { return __val; }
|
||||
@ -4747,26 +4796,26 @@ namespace std // purposefully not versioned
|
||||
template <class _Integer>
|
||||
constexpr typename enable_if<is_integral_v<_Integer>, byte>::type &
|
||||
operator<<=(byte& __lhs, _Integer __shift) noexcept
|
||||
{ return __lhs = byte(static_cast<unsigned char>(__lhs) << __shift); }
|
||||
{ return __lhs = __lhs << __shift; }
|
||||
|
||||
template <class _Integer>
|
||||
constexpr typename enable_if<is_integral_v<_Integer>, byte>::type
|
||||
operator<< (byte __lhs, _Integer __shift) noexcept
|
||||
{ return byte(static_cast<unsigned char>(__lhs) << __shift); }
|
||||
{ return static_cast<byte>(static_cast<unsigned char>(static_cast<unsigned int>(__lhs) << __shift)); }
|
||||
|
||||
template <class _Integer>
|
||||
constexpr typename enable_if<is_integral_v<_Integer>, byte>::type &
|
||||
operator>>=(byte& __lhs, _Integer __shift) noexcept
|
||||
{ return __lhs = byte(static_cast<unsigned char>(__lhs) >> __shift); }
|
||||
{ return __lhs = __lhs >> __shift; }
|
||||
|
||||
template <class _Integer>
|
||||
constexpr typename enable_if<is_integral_v<_Integer>, byte>::type
|
||||
operator>> (byte __lhs, _Integer __shift) noexcept
|
||||
{ return byte(static_cast<unsigned char>(__lhs) >> __shift); }
|
||||
{ return static_cast<byte>(static_cast<unsigned char>(static_cast<unsigned int>(__lhs) >> __shift)); }
|
||||
|
||||
template <class _Integer>
|
||||
constexpr typename enable_if<is_integral_v<_Integer>, _Integer>::type
|
||||
to_integer(byte __b) noexcept { return _Integer(__b); }
|
||||
to_integer(byte __b) noexcept { return static_cast<_Integer>(__b); }
|
||||
|
||||
}
|
||||
#endif
|
||||
|
@ -69,18 +69,17 @@ public:
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
|
||||
#if defined(_LIBCPP_ABI_MICROSOFT)
|
||||
#include <vcruntime_typeinfo.h>
|
||||
#elif defined(_LIBCPP_NONUNIQUE_RTTI_BIT)
|
||||
#if !defined(_LIBCPP_ABI_MICROSOFT)
|
||||
#if defined(_LIBCPP_NONUNIQUE_RTTI_BIT)
|
||||
#define _LIBCPP_HAS_NONUNIQUE_TYPEINFO
|
||||
#else
|
||||
#define _LIBCPP_HAS_UNIQUE_TYPEINFO
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace std // purposefully not using versioning namespace
|
||||
{
|
||||
|
||||
#if !defined(_LIBCPP_ABI_MICROSOFT)
|
||||
class _LIBCPP_EXCEPTION_ABI type_info
|
||||
{
|
||||
type_info& operator=(const type_info&);
|
||||
@ -92,7 +91,17 @@ class _LIBCPP_EXCEPTION_ABI type_info
|
||||
{ return __builtin_strcmp(name(), __arg.name()); }
|
||||
#endif
|
||||
|
||||
#if defined(_LIBCPP_ABI_MICROSOFT)
|
||||
mutable struct {
|
||||
const char *__undecorated_name;
|
||||
const char __decorated_name[1];
|
||||
} __data;
|
||||
|
||||
int __compare(const type_info &__rhs) const _NOEXCEPT;
|
||||
#endif // _LIBCPP_ABI_MICROSOFT
|
||||
|
||||
protected:
|
||||
#if !defined(_LIBCPP_ABI_MICROSOFT)
|
||||
#if defined(_LIBCPP_HAS_NONUNIQUE_TYPEINFO)
|
||||
// A const char* with the non-unique RTTI bit possibly set.
|
||||
uintptr_t __type_name;
|
||||
@ -106,11 +115,27 @@ protected:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit type_info(const char* __n) : __type_name(__n) {}
|
||||
#endif
|
||||
#endif // ! _LIBCPP_ABI_MICROSOFT
|
||||
|
||||
public:
|
||||
_LIBCPP_AVAILABILITY_TYPEINFO_VTABLE
|
||||
virtual ~type_info();
|
||||
|
||||
#if defined(_LIBCPP_ABI_MICROSOFT)
|
||||
const char *name() const _NOEXCEPT;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool before(const type_info& __arg) const _NOEXCEPT {
|
||||
return __compare(__arg) < 0;
|
||||
}
|
||||
|
||||
size_t hash_code() const _NOEXCEPT;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(const type_info& __arg) const _NOEXCEPT {
|
||||
return __compare(__arg) == 0;
|
||||
}
|
||||
#else
|
||||
#if defined(_LIBCPP_HAS_NONUNIQUE_TYPEINFO)
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const char* name() const _NOEXCEPT
|
||||
@ -167,6 +192,7 @@ public:
|
||||
bool operator==(const type_info& __arg) const _NOEXCEPT
|
||||
{ return __type_name == __arg.__type_name; }
|
||||
#endif
|
||||
#endif // _LIBCPP_ABI_MICROSOFT
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const type_info& __arg) const _NOEXCEPT
|
||||
@ -191,8 +217,6 @@ public:
|
||||
virtual const char* what() const _NOEXCEPT;
|
||||
};
|
||||
|
||||
#endif // !_LIBCPP_ABI_MICROSOFT
|
||||
|
||||
} // std
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
@ -885,7 +885,7 @@ public:
|
||||
allocator_type get_allocator() const _NOEXCEPT
|
||||
{return allocator_type(__table_.__node_alloc());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const _NOEXCEPT {return __table_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const _NOEXCEPT {return __table_.size();}
|
||||
@ -1634,7 +1634,7 @@ public:
|
||||
allocator_type get_allocator() const _NOEXCEPT
|
||||
{return allocator_type(__table_.__node_alloc());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const _NOEXCEPT {return __table_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const _NOEXCEPT {return __table_.size();}
|
||||
|
@ -450,7 +450,7 @@ public:
|
||||
allocator_type get_allocator() const _NOEXCEPT
|
||||
{return allocator_type(__table_.__node_alloc());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const _NOEXCEPT {return __table_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const _NOEXCEPT {return __table_.size();}
|
||||
@ -968,7 +968,7 @@ public:
|
||||
allocator_type get_allocator() const _NOEXCEPT
|
||||
{return allocator_type(__table_.__node_alloc());}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const _NOEXCEPT {return __table_.size() == 0;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const _NOEXCEPT {return __table_.size();}
|
||||
|
@ -545,6 +545,11 @@ private:
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
|
||||
template<class _T1, class _T2>
|
||||
pair(_T1, _T2) -> pair<_T1, _T2>;
|
||||
#endif // _LIBCPP_HAS_NO_DEDUCTION_GUIDES
|
||||
|
||||
template <class _T1, class _T2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
|
||||
bool
|
||||
|
@ -207,11 +207,15 @@ namespace std {
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
#include <limits>
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
|
||||
_LIBCPP_PUSH_MACROS
|
||||
#include <__undef_macros>
|
||||
|
||||
namespace std { // explicitly not using versioning namespace
|
||||
|
||||
class _LIBCPP_EXCEPTION_ABI bad_variant_access : public exception {
|
||||
@ -283,7 +287,28 @@ struct _LIBCPP_TEMPLATE_VIS variant_alternative<_Ip, variant<_Types...>> {
|
||||
};
|
||||
|
||||
constexpr size_t variant_npos = static_cast<size_t>(-1);
|
||||
constexpr unsigned int __variant_npos = static_cast<unsigned int>(-1);
|
||||
|
||||
constexpr int __choose_index_type(unsigned int __num_elem) {
|
||||
if (__num_elem < std::numeric_limits<unsigned char>::max())
|
||||
return 0;
|
||||
if (__num_elem < std::numeric_limits<unsigned short>::max())
|
||||
return 1;
|
||||
return 2;
|
||||
}
|
||||
|
||||
template <size_t _NumAlts>
|
||||
using __variant_index_t =
|
||||
#ifndef _LIBCPP_ABI_VARIANT_INDEX_TYPE_OPTIMIZATION
|
||||
unsigned int;
|
||||
#else
|
||||
std::tuple_element_t<
|
||||
__choose_index_type(_NumAlts),
|
||||
std::tuple<unsigned char, unsigned short, unsigned int>
|
||||
>;
|
||||
#endif
|
||||
|
||||
template <class _IndexType>
|
||||
constexpr _IndexType __variant_npos = static_cast<_IndexType>(-1);
|
||||
|
||||
namespace __find_detail {
|
||||
|
||||
@ -557,7 +582,7 @@ struct __variant {
|
||||
private:
|
||||
template <class _Visitor, class... _Values>
|
||||
static constexpr void __std_visit_exhaustive_visitor_check() {
|
||||
static_assert(is_callable_v<_Visitor(_Values...)>,
|
||||
static_assert(is_invocable_v<_Visitor, _Values...>,
|
||||
"`std::visit` requires the visitor to be exhaustive.");
|
||||
}
|
||||
|
||||
@ -647,9 +672,11 @@ _LIBCPP_VARIANT_UNION(_Trait::_Unavailable, ~__union() = delete;);
|
||||
template <_Trait _DestructibleTrait, class... _Types>
|
||||
class _LIBCPP_TEMPLATE_VIS __base {
|
||||
public:
|
||||
using __index_t = __variant_index_t<sizeof...(_Types)>;
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
explicit constexpr __base(__valueless_t tag) noexcept
|
||||
: __data(tag), __index(__variant_npos) {}
|
||||
: __data(tag), __index(__variant_npos<__index_t>) {}
|
||||
|
||||
template <size_t _Ip, class... _Args>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
@ -665,7 +692,7 @@ public:
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
constexpr size_t index() const noexcept {
|
||||
return __index == __variant_npos ? variant_npos : __index;
|
||||
return __index == __variant_npos<__index_t> ? variant_npos : __index;
|
||||
}
|
||||
|
||||
protected:
|
||||
@ -685,7 +712,7 @@ protected:
|
||||
static constexpr size_t __size() { return sizeof...(_Types); }
|
||||
|
||||
__union<_DestructibleTrait, 0, _Types...> __data;
|
||||
unsigned int __index;
|
||||
__index_t __index;
|
||||
|
||||
friend struct __access::__base;
|
||||
friend struct __visitation::__base;
|
||||
@ -700,6 +727,7 @@ class _LIBCPP_TEMPLATE_VIS __destructor;
|
||||
destructible_trait> \
|
||||
: public __base<destructible_trait, _Types...> { \
|
||||
using __base_type = __base<destructible_trait, _Types...>; \
|
||||
using __index_t = typename __base_type::__index_t; \
|
||||
\
|
||||
public: \
|
||||
using __base_type::__base_type; \
|
||||
@ -719,7 +747,7 @@ class _LIBCPP_TEMPLATE_VIS __destructor;
|
||||
_LIBCPP_VARIANT_DESTRUCTOR(
|
||||
_Trait::_TriviallyAvailable,
|
||||
~__destructor() = default;,
|
||||
void __destroy() noexcept { this->__index = __variant_npos; });
|
||||
void __destroy() noexcept { this->__index = __variant_npos<__index_t>; });
|
||||
|
||||
_LIBCPP_VARIANT_DESTRUCTOR(
|
||||
_Trait::_Available,
|
||||
@ -733,7 +761,7 @@ _LIBCPP_VARIANT_DESTRUCTOR(
|
||||
},
|
||||
*this);
|
||||
}
|
||||
this->__index = __variant_npos;
|
||||
this->__index = __variant_npos<__index_t>;
|
||||
});
|
||||
|
||||
_LIBCPP_VARIANT_DESTRUCTOR(
|
||||
@ -1561,4 +1589,6 @@ struct _LIBCPP_TEMPLATE_VIS hash<monostate> {
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
_LIBCPP_POP_MACROS
|
||||
|
||||
#endif // _LIBCPP_VARIANT
|
||||
|
@ -634,7 +634,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type capacity() const _NOEXCEPT
|
||||
{return __base::capacity();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const _NOEXCEPT
|
||||
{return this->__begin_ == this->__end_;}
|
||||
size_type max_size() const _NOEXCEPT;
|
||||
@ -2290,7 +2290,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const _NOEXCEPT
|
||||
{return __size_;}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY
|
||||
bool empty() const _NOEXCEPT
|
||||
{return __size_ == 0;}
|
||||
void reserve(size_type __n);
|
||||
|
@ -125,6 +125,10 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len,
|
||||
# if __GLIBC_PREREQ(2, 10)
|
||||
# define _LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS 1
|
||||
# endif
|
||||
#elif defined(_LIBCPP_MSVCRT)
|
||||
# if defined(_CRT_CONST_CORRECT_OVERLOADS)
|
||||
# define _LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus) && !defined(_LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS) && defined(_LIBCPP_PREFERRED_OVERLOAD)
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "support/runtime/exception_glibcxx.ipp"
|
||||
#include "support/runtime/exception_pointer_glibcxx.ipp"
|
||||
#else
|
||||
#include "include/atomic_support.h"
|
||||
#include "support/runtime/exception_fallback.ipp"
|
||||
#include "support/runtime/exception_pointer_unimplemented.ipp"
|
||||
#endif
|
||||
|
@ -296,21 +296,40 @@ void recursive_directory_iterator::__advance(error_code* ec) {
|
||||
}
|
||||
|
||||
bool recursive_directory_iterator::__try_recursion(error_code *ec) {
|
||||
|
||||
bool rec_sym =
|
||||
bool(options() & directory_options::follow_directory_symlink);
|
||||
|
||||
auto& curr_it = __imp_->__stack_.top();
|
||||
|
||||
if (is_directory(curr_it.__entry_.status()) &&
|
||||
(!is_symlink(curr_it.__entry_.symlink_status()) || rec_sym))
|
||||
{
|
||||
bool skip_rec = false;
|
||||
std::error_code m_ec;
|
||||
if (!rec_sym) {
|
||||
file_status st = curr_it.__entry_.symlink_status(m_ec);
|
||||
if (m_ec && status_known(st))
|
||||
m_ec.clear();
|
||||
if (m_ec || is_symlink(st) || !is_directory(st))
|
||||
skip_rec = true;
|
||||
} else {
|
||||
file_status st = curr_it.__entry_.status(m_ec);
|
||||
if (m_ec && status_known(st))
|
||||
m_ec.clear();
|
||||
if (m_ec || !is_directory(st))
|
||||
skip_rec = true;
|
||||
}
|
||||
|
||||
if (!skip_rec) {
|
||||
__dir_stream new_it(curr_it.__entry_.path(), __imp_->__options_, m_ec);
|
||||
if (new_it.good()) {
|
||||
__imp_->__stack_.push(_VSTD::move(new_it));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (m_ec) {
|
||||
const bool allow_eacess = bool(__imp_->__options_
|
||||
& directory_options::skip_permission_denied);
|
||||
if (m_ec.value() == EACCES && allow_eacess) {
|
||||
if (ec) ec->clear();
|
||||
} else {
|
||||
__imp_.reset();
|
||||
set_or_throw(m_ec, ec,
|
||||
"recursive_directory_iterator::operator++()");
|
||||
|
@ -182,20 +182,20 @@ void __copy(const path& from, const path& to, copy_options options,
|
||||
const bool sym_status2 = bool(options &
|
||||
copy_options::copy_symlinks);
|
||||
|
||||
std::error_code m_ec;
|
||||
std::error_code m_ec1;
|
||||
struct ::stat f_st = {};
|
||||
const file_status f = sym_status || sym_status2
|
||||
? detail::posix_lstat(from, f_st, &m_ec)
|
||||
: detail::posix_stat(from, f_st, &m_ec);
|
||||
if (m_ec)
|
||||
return set_or_throw(m_ec, ec, "copy", from, to);
|
||||
? detail::posix_lstat(from, f_st, &m_ec1)
|
||||
: detail::posix_stat(from, f_st, &m_ec1);
|
||||
if (m_ec1)
|
||||
return set_or_throw(m_ec1, ec, "copy", from, to);
|
||||
|
||||
struct ::stat t_st = {};
|
||||
const file_status t = sym_status ? detail::posix_lstat(to, t_st, &m_ec)
|
||||
: detail::posix_stat(to, t_st, &m_ec);
|
||||
const file_status t = sym_status ? detail::posix_lstat(to, t_st, &m_ec1)
|
||||
: detail::posix_stat(to, t_st, &m_ec1);
|
||||
|
||||
if (not status_known(t))
|
||||
return set_or_throw(m_ec, ec, "copy", from, to);
|
||||
return set_or_throw(m_ec1, ec, "copy", from, to);
|
||||
|
||||
if (!exists(f) || is_other(f) || is_other(t)
|
||||
|| (is_directory(f) && is_regular_file(t))
|
||||
@ -249,9 +249,9 @@ void __copy(const path& from, const path& to, copy_options options,
|
||||
directory_iterator it = ec ? directory_iterator(from, *ec)
|
||||
: directory_iterator(from);
|
||||
if (ec && *ec) { return; }
|
||||
std::error_code m_ec;
|
||||
for (; it != directory_iterator(); it.increment(m_ec)) {
|
||||
if (m_ec) return set_or_throw(m_ec, ec, "copy", from, to);
|
||||
std::error_code m_ec2;
|
||||
for (; it != directory_iterator(); it.increment(m_ec2)) {
|
||||
if (m_ec2) return set_or_throw(m_ec2, ec, "copy", from, to);
|
||||
__copy(it->path(), to / it->path().filename(),
|
||||
options | copy_options::__in_recursive_copy, ec);
|
||||
if (ec && *ec) { return; }
|
||||
|
@ -16,6 +16,7 @@
|
||||
#if defined(__clang__) && __has_builtin(__atomic_load_n) \
|
||||
&& __has_builtin(__atomic_store_n) \
|
||||
&& __has_builtin(__atomic_add_fetch) \
|
||||
&& __has_builtin(__atomic_exchange_n) \
|
||||
&& __has_builtin(__atomic_compare_exchange_n) \
|
||||
&& defined(__ATOMIC_RELAXED) \
|
||||
&& defined(__ATOMIC_CONSUME) \
|
||||
@ -82,6 +83,14 @@ _ValueType __libcpp_atomic_add(_ValueType* __val, _AddType __a,
|
||||
return __atomic_add_fetch(__val, __a, __order);
|
||||
}
|
||||
|
||||
template <class _ValueType>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_ValueType __libcpp_atomic_exchange(_ValueType* __target,
|
||||
_ValueType __value, int __order = _AO_Seq)
|
||||
{
|
||||
return __atomic_exchange_n(__target, __value, __order);
|
||||
}
|
||||
|
||||
template <class _ValueType>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool __libcpp_atomic_compare_exchange(_ValueType* __val,
|
||||
@ -135,6 +144,16 @@ _ValueType __libcpp_atomic_add(_ValueType* __val, _AddType __a,
|
||||
return *__val += __a;
|
||||
}
|
||||
|
||||
template <class _ValueType>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
_ValueType __libcpp_atomic_exchange(_ValueType* __target,
|
||||
_ValueType __value, int __order = _AO_Seq)
|
||||
{
|
||||
_ValueType old = *__target;
|
||||
*__target = __value;
|
||||
return old;
|
||||
}
|
||||
|
||||
template <class _ValueType>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool __libcpp_atomic_compare_exchange(_ValueType* __val,
|
||||
|
@ -24,7 +24,7 @@
|
||||
#define _LIBCPP_ELAST __ELASTERROR
|
||||
#elif defined(__Fuchsia__)
|
||||
// No _LIBCPP_ELAST needed on Fuchsia
|
||||
#elif defined(__linux__)
|
||||
#elif defined(__linux__) || defined(_LIBCPP_HAS_MUSL_LIBC)
|
||||
#define _LIBCPP_ELAST 4095
|
||||
#elif defined(__APPLE__)
|
||||
// No _LIBCPP_ELAST needed on Apple
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <dlfcn.h>
|
||||
#include <mach-o/dyld.h>
|
||||
#endif
|
||||
#include "atomic_support.h"
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
@ -83,7 +84,7 @@ __libcpp_refstring::__libcpp_refstring(const __libcpp_refstring &s) _NOEXCEPT
|
||||
: __imp_(s.__imp_)
|
||||
{
|
||||
if (__uses_refcount())
|
||||
__sync_add_and_fetch(&rep_from_data(__imp_)->count, 1);
|
||||
__libcpp_atomic_add(&rep_from_data(__imp_)->count, 1);
|
||||
}
|
||||
|
||||
inline
|
||||
@ -92,10 +93,10 @@ __libcpp_refstring& __libcpp_refstring::operator=(__libcpp_refstring const& s) _
|
||||
struct _Rep_base *old_rep = rep_from_data(__imp_);
|
||||
__imp_ = s.__imp_;
|
||||
if (__uses_refcount())
|
||||
__sync_add_and_fetch(&rep_from_data(__imp_)->count, 1);
|
||||
__libcpp_atomic_add(&rep_from_data(__imp_)->count, 1);
|
||||
if (adjust_old_count)
|
||||
{
|
||||
if (__sync_add_and_fetch(&old_rep->count, count_t(-1)) < 0)
|
||||
if (__libcpp_atomic_add(&old_rep->count, count_t(-1)) < 0)
|
||||
{
|
||||
::operator delete(old_rep);
|
||||
}
|
||||
@ -107,7 +108,7 @@ inline
|
||||
__libcpp_refstring::~__libcpp_refstring() {
|
||||
if (__uses_refcount()) {
|
||||
_Rep_base* rep = rep_from_data(__imp_);
|
||||
if (__sync_add_and_fetch(&rep->count, count_t(-1)) < 0) {
|
||||
if (__libcpp_atomic_add(&rep->count, count_t(-1)) < 0) {
|
||||
::operator delete(rep);
|
||||
}
|
||||
}
|
||||
|
@ -11,19 +11,23 @@
|
||||
#include "string"
|
||||
#include "new"
|
||||
|
||||
#define _str(s) #s
|
||||
#define str(s) _str(s)
|
||||
#define _LIBCPP_NAMESPACE_STR str(_LIBCPP_NAMESPACE)
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_STDIN
|
||||
_ALIGNAS_TYPE (istream) _LIBCPP_FUNC_VIS char cin[sizeof(istream)]
|
||||
#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
|
||||
__asm__("?cin@__1@std@@3V?$basic_istream@DU?$char_traits@D@__1@std@@@12@A")
|
||||
__asm__("?cin@" _LIBCPP_NAMESPACE_STR "@std@@3V?$basic_istream@DU?$char_traits@D@" _LIBCPP_NAMESPACE_STR "@std@@@12@A")
|
||||
#endif
|
||||
;
|
||||
_ALIGNAS_TYPE (__stdinbuf<char> ) static char __cin[sizeof(__stdinbuf <char>)];
|
||||
static mbstate_t mb_cin;
|
||||
_ALIGNAS_TYPE (wistream) _LIBCPP_FUNC_VIS char wcin[sizeof(wistream)]
|
||||
#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
|
||||
__asm__("?wcin@__1@std@@3V?$basic_istream@_WU?$char_traits@_W@__1@std@@@12@A")
|
||||
__asm__("?wcin@" _LIBCPP_NAMESPACE_STR "@std@@3V?$basic_istream@_WU?$char_traits@_W@" _LIBCPP_NAMESPACE_STR "@std@@@12@A")
|
||||
#endif
|
||||
;
|
||||
_ALIGNAS_TYPE (__stdinbuf<wchar_t> ) static char __wcin[sizeof(__stdinbuf <wchar_t>)];
|
||||
@ -33,14 +37,14 @@ static mbstate_t mb_wcin;
|
||||
#ifndef _LIBCPP_HAS_NO_STDOUT
|
||||
_ALIGNAS_TYPE (ostream) _LIBCPP_FUNC_VIS char cout[sizeof(ostream)]
|
||||
#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
|
||||
__asm__("?cout@__1@std@@3V?$basic_ostream@DU?$char_traits@D@__1@std@@@12@A")
|
||||
__asm__("?cout@" _LIBCPP_NAMESPACE_STR "@std@@3V?$basic_ostream@DU?$char_traits@D@" _LIBCPP_NAMESPACE_STR "@std@@@12@A")
|
||||
#endif
|
||||
;
|
||||
_ALIGNAS_TYPE (__stdoutbuf<char>) static char __cout[sizeof(__stdoutbuf<char>)];
|
||||
static mbstate_t mb_cout;
|
||||
_ALIGNAS_TYPE (wostream) _LIBCPP_FUNC_VIS char wcout[sizeof(wostream)]
|
||||
#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
|
||||
__asm__("?wcout@__1@std@@3V?$basic_ostream@_WU?$char_traits@_W@__1@std@@@12@A")
|
||||
__asm__("?wcout@" _LIBCPP_NAMESPACE_STR "@std@@3V?$basic_ostream@_WU?$char_traits@_W@" _LIBCPP_NAMESPACE_STR "@std@@@12@A")
|
||||
#endif
|
||||
;
|
||||
_ALIGNAS_TYPE (__stdoutbuf<wchar_t>) static char __wcout[sizeof(__stdoutbuf<wchar_t>)];
|
||||
@ -49,14 +53,14 @@ static mbstate_t mb_wcout;
|
||||
|
||||
_ALIGNAS_TYPE (ostream) _LIBCPP_FUNC_VIS char cerr[sizeof(ostream)]
|
||||
#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
|
||||
__asm__("?cerr@__1@std@@3V?$basic_ostream@DU?$char_traits@D@__1@std@@@12@A")
|
||||
__asm__("?cerr@" _LIBCPP_NAMESPACE_STR "@std@@3V?$basic_ostream@DU?$char_traits@D@" _LIBCPP_NAMESPACE_STR "@std@@@12@A")
|
||||
#endif
|
||||
;
|
||||
_ALIGNAS_TYPE (__stdoutbuf<char>) static char __cerr[sizeof(__stdoutbuf<char>)];
|
||||
static mbstate_t mb_cerr;
|
||||
_ALIGNAS_TYPE (wostream) _LIBCPP_FUNC_VIS char wcerr[sizeof(wostream)]
|
||||
#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
|
||||
__asm__("?wcerr@__1@std@@3V?$basic_ostream@_WU?$char_traits@_W@__1@std@@@12@A")
|
||||
__asm__("?wcerr@" _LIBCPP_NAMESPACE_STR "@std@@3V?$basic_ostream@_WU?$char_traits@_W@" _LIBCPP_NAMESPACE_STR "@std@@@12@A")
|
||||
#endif
|
||||
;
|
||||
_ALIGNAS_TYPE (__stdoutbuf<wchar_t>) static char __wcerr[sizeof(__stdoutbuf<wchar_t>)];
|
||||
@ -64,12 +68,12 @@ static mbstate_t mb_wcerr;
|
||||
|
||||
_ALIGNAS_TYPE (ostream) _LIBCPP_FUNC_VIS char clog[sizeof(ostream)]
|
||||
#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
|
||||
__asm__("?clog@__1@std@@3V?$basic_ostream@DU?$char_traits@D@__1@std@@@12@A")
|
||||
__asm__("?clog@" _LIBCPP_NAMESPACE_STR "@std@@3V?$basic_ostream@DU?$char_traits@D@" _LIBCPP_NAMESPACE_STR "@std@@@12@A")
|
||||
#endif
|
||||
;
|
||||
_ALIGNAS_TYPE (wostream) _LIBCPP_FUNC_VIS char wclog[sizeof(wostream)]
|
||||
#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
|
||||
__asm__("?wclog@__1@std@@3V?$basic_ostream@_WU?$char_traits@_W@__1@std@@@12@A")
|
||||
__asm__("?wclog@" _LIBCPP_NAMESPACE_STR "@std@@3V?$basic_ostream@_WU?$char_traits@_W@" _LIBCPP_NAMESPACE_STR "@std@@@12@A")
|
||||
#endif
|
||||
;
|
||||
|
||||
|
@ -36,6 +36,7 @@
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include "include/atomic_support.h"
|
||||
#include "__undef_macros"
|
||||
|
||||
// On Linux, wint_t and wchar_t have different signed-ness, and this causes
|
||||
@ -667,7 +668,7 @@ locale::id::__get()
|
||||
void
|
||||
locale::id::__init()
|
||||
{
|
||||
__id_ = __sync_add_and_fetch(&__next_id, 1);
|
||||
__id_ = __libcpp_atomic_add(&__next_id, 1);
|
||||
}
|
||||
|
||||
// template <> class collate_byname<char>
|
||||
|
@ -12,9 +12,12 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "new"
|
||||
#include "include/atomic_support.h"
|
||||
|
||||
#if defined(_LIBCPP_ABI_MICROSOFT)
|
||||
// nothing todo
|
||||
#if defined(_LIBCPP_NO_VCRUNTIME)
|
||||
#include "support/runtime/new_handler_fallback.ipp"
|
||||
#endif
|
||||
#elif defined(LIBCXX_BUILDING_LIBCXXABI)
|
||||
#include <cxxabi.h>
|
||||
#elif defined(LIBCXXRT)
|
||||
@ -53,7 +56,8 @@ __throw_bad_alloc()
|
||||
|
||||
} // std
|
||||
|
||||
#if !defined(__GLIBCXX__) && !defined(_LIBCPP_ABI_MICROSOFT) && \
|
||||
#if !defined(__GLIBCXX__) && \
|
||||
(!defined(_LIBCPP_ABI_MICROSOFT) || defined(_LIBCPP_NO_VCRUNTIME)) && \
|
||||
!defined(_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS)
|
||||
|
||||
// Implement all new and delete operators as weak definitions
|
||||
@ -299,4 +303,4 @@ operator delete[] (void* ptr, size_t, std::align_val_t alignment) _NOEXCEPT
|
||||
}
|
||||
|
||||
#endif // !_LIBCPP_HAS_NO_ALIGNED_ALLOCATION
|
||||
#endif // !__GLIBCXX__ && !_LIBCPP_ABI_MICROSOFT && !_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS
|
||||
#endif // !__GLIBCXX__ && (!_LIBCPP_ABI_MICROSOFT || _LIBCPP_NO_VCRUNTIME) && !_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS
|
||||
|
@ -25,7 +25,9 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#if defined(_LIBCPP_USING_DEV_RANDOM)
|
||||
#if defined(_LIBCPP_USING_GETENTROPY)
|
||||
#include <sys/random.h>
|
||||
#elif defined(_LIBCPP_USING_DEV_RANDOM)
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#elif defined(_LIBCPP_USING_NACL_RANDOM)
|
||||
@ -35,7 +37,30 @@
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if defined(_LIBCPP_USING_ARC4_RANDOM)
|
||||
#if defined(_LIBCPP_USING_GETENTROPY)
|
||||
|
||||
random_device::random_device(const string& __token)
|
||||
{
|
||||
if (__token != "/dev/urandom")
|
||||
__throw_system_error(ENOENT, ("random device not supported " + __token).c_str());
|
||||
}
|
||||
|
||||
random_device::~random_device()
|
||||
{
|
||||
}
|
||||
|
||||
unsigned
|
||||
random_device::operator()()
|
||||
{
|
||||
unsigned r;
|
||||
size_t n = sizeof(r);
|
||||
int err = getentropy(&r, n);
|
||||
if (err)
|
||||
__throw_system_error(errno, "random_device getentropy failed");
|
||||
return r;
|
||||
}
|
||||
|
||||
#elif defined(_LIBCPP_USING_ARC4_RANDOM)
|
||||
|
||||
random_device::random_device(const string& __token)
|
||||
{
|
||||
|
@ -186,7 +186,7 @@ strstreambuf::overflow(int_type __c)
|
||||
}
|
||||
setg(buf, buf + ninp, buf + einp);
|
||||
setp(buf + einp, buf + new_size);
|
||||
pbump(static_cast<int>(nout));
|
||||
__pbump(nout);
|
||||
__strmode_ |= __allocated;
|
||||
}
|
||||
*pptr() = static_cast<char>(__c);
|
||||
@ -282,7 +282,7 @@ strstreambuf::seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmod
|
||||
// min(pbase, newpos), newpos, epptr()
|
||||
__off = epptr() - newpos;
|
||||
setp(min(pbase(), newpos), epptr());
|
||||
pbump(static_cast<int>((epptr() - pbase()) - __off));
|
||||
__pbump((epptr() - pbase()) - __off);
|
||||
}
|
||||
__p = newoff;
|
||||
}
|
||||
@ -312,7 +312,7 @@ strstreambuf::seekpos(pos_type __sp, ios_base::openmode __which)
|
||||
// min(pbase, newpos), newpos, epptr()
|
||||
off_type temp = epptr() - newpos;
|
||||
setp(min(pbase(), newpos), epptr());
|
||||
pbump(static_cast<int>((epptr() - pbase()) - temp));
|
||||
__pbump((epptr() - pbase()) - temp);
|
||||
}
|
||||
__p = newoff;
|
||||
}
|
||||
|
@ -20,13 +20,13 @@ _LIBCPP_SAFE_STATIC static std::unexpected_handler __unexpected_handler;
|
||||
unexpected_handler
|
||||
set_unexpected(unexpected_handler func) _NOEXCEPT
|
||||
{
|
||||
return __sync_lock_test_and_set(&__unexpected_handler, func);
|
||||
return __libcpp_atomic_exchange(&__unexpected_handler, func);
|
||||
}
|
||||
|
||||
unexpected_handler
|
||||
get_unexpected() _NOEXCEPT
|
||||
{
|
||||
return __sync_fetch_and_add(&__unexpected_handler, (unexpected_handler)0);
|
||||
return __libcpp_atomic_load(&__unexpected_handler);
|
||||
|
||||
}
|
||||
|
||||
@ -41,14 +41,13 @@ void unexpected()
|
||||
terminate_handler
|
||||
set_terminate(terminate_handler func) _NOEXCEPT
|
||||
{
|
||||
return __sync_lock_test_and_set(&__terminate_handler, func);
|
||||
return __libcpp_atomic_exchange(&__terminate_handler, func);
|
||||
}
|
||||
|
||||
terminate_handler
|
||||
get_terminate() _NOEXCEPT
|
||||
{
|
||||
return __sync_fetch_and_add(&__terminate_handler, (terminate_handler)0);
|
||||
|
||||
return __libcpp_atomic_load(&__terminate_handler);
|
||||
}
|
||||
|
||||
#ifndef __EMSCRIPTEN__ // We provide this in JS
|
||||
|
@ -14,12 +14,35 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <eh.h>
|
||||
#include <corecrt_terminate.h>
|
||||
|
||||
#if !defined(_ACRTIMP)
|
||||
#define _ACRTIMP __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
#if !defined(_VCRTIMP)
|
||||
#define _VCRTIMP __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
#if !defined(__CRTDECL)
|
||||
#define __CRTDECL __cdecl
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
typedef void (__CRTDECL* terminate_handler)();
|
||||
_ACRTIMP terminate_handler __cdecl set_terminate(
|
||||
terminate_handler _NewTerminateHandler) throw();
|
||||
_ACRTIMP terminate_handler __cdecl _get_terminate();
|
||||
|
||||
typedef void (__CRTDECL* unexpected_handler)();
|
||||
_VCRTIMP unexpected_handler __cdecl set_unexpected(
|
||||
unexpected_handler _NewUnexpectedHandler) throw();
|
||||
_VCRTIMP unexpected_handler __cdecl _get_unexpected();
|
||||
|
||||
_VCRTIMP int __cdecl __uncaught_exceptions();
|
||||
}
|
||||
|
||||
namespace std {
|
||||
|
||||
// libcxxrt provides implementations of these functions itself.
|
||||
unexpected_handler
|
||||
set_unexpected(unexpected_handler func) _NOEXCEPT {
|
||||
return ::set_unexpected(func);
|
||||
@ -86,4 +109,82 @@ bad_array_length::what() const _NOEXCEPT
|
||||
return "bad_array_length";
|
||||
}
|
||||
|
||||
bad_cast::bad_cast() _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
bad_cast::~bad_cast() _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
const char *
|
||||
bad_cast::what() const _NOEXCEPT
|
||||
{
|
||||
return "std::bad_cast";
|
||||
}
|
||||
|
||||
bad_typeid::bad_typeid() _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
bad_typeid::~bad_typeid() _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
const char *
|
||||
bad_typeid::what() const _NOEXCEPT
|
||||
{
|
||||
return "std::bad_typeid";
|
||||
}
|
||||
|
||||
#if defined(_LIBCPP_NO_VCRUNTIME)
|
||||
exception::~exception() _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
const char* exception::what() const _NOEXCEPT
|
||||
{
|
||||
return "std::exception";
|
||||
}
|
||||
|
||||
|
||||
bad_exception::~bad_exception() _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
const char* bad_exception::what() const _NOEXCEPT
|
||||
{
|
||||
return "std::bad_exception";
|
||||
}
|
||||
|
||||
|
||||
bad_alloc::bad_alloc() _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
bad_alloc::~bad_alloc() _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
const char*
|
||||
bad_alloc::what() const _NOEXCEPT
|
||||
{
|
||||
return "std::bad_alloc";
|
||||
}
|
||||
|
||||
bad_array_new_length::bad_array_new_length() _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
bad_array_new_length::~bad_array_new_length() _NOEXCEPT
|
||||
{
|
||||
}
|
||||
|
||||
const char*
|
||||
bad_array_new_length::what() const _NOEXCEPT
|
||||
{
|
||||
return "bad_array_new_length";
|
||||
}
|
||||
#endif // _LIBCPP_NO_VCRUNTIME
|
||||
|
||||
} // namespace std
|
||||
|
@ -10,26 +10,32 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <yvals.h> // for _CRTIMP2_PURE
|
||||
|
||||
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCreate(_Out_ void*);
|
||||
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrDestroy(_Inout_ void*);
|
||||
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCopy(_Out_ void*,
|
||||
_In_ const void*);
|
||||
#if !defined(_CRTIMP2_PURE)
|
||||
#define _CRTIMP2_PURE __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
#if !defined(__CLRCALL_PURE_OR_CDECL)
|
||||
#define __CLRCALL_PURE_OR_CDECL __cdecl
|
||||
#endif
|
||||
|
||||
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCreate(void*);
|
||||
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrDestroy(void*);
|
||||
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCopy(void*,
|
||||
const void*);
|
||||
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL
|
||||
__ExceptionPtrAssign(_Inout_ void*, _In_ const void*);
|
||||
__ExceptionPtrAssign(void*, const void*);
|
||||
_CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL
|
||||
__ExceptionPtrCompare(_In_ const void*, _In_ const void*);
|
||||
__ExceptionPtrCompare(const void*, const void*);
|
||||
_CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL
|
||||
__ExceptionPtrToBool(_In_ const void*);
|
||||
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrSwap(_Inout_ void*,
|
||||
_Inout_ void*);
|
||||
__ExceptionPtrToBool(const void*);
|
||||
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrSwap(void*, void*);
|
||||
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL
|
||||
__ExceptionPtrCurrentException(_Out_ void*);
|
||||
__ExceptionPtrCurrentException(void*);
|
||||
[[noreturn]] _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL
|
||||
__ExceptionPtrRethrow(_In_ const void*);
|
||||
__ExceptionPtrRethrow(const void*);
|
||||
_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL
|
||||
__ExceptionPtrCopyException(_Inout_ void*, _In_ const void*, _In_ const void*);
|
||||
__ExceptionPtrCopyException(void*, const void*, const void*);
|
||||
|
||||
namespace std {
|
||||
|
||||
|
@ -15,13 +15,13 @@ _LIBCPP_SAFE_STATIC static std::new_handler __new_handler;
|
||||
new_handler
|
||||
set_new_handler(new_handler handler) _NOEXCEPT
|
||||
{
|
||||
return __sync_lock_test_and_set(&__new_handler, handler);
|
||||
return __libcpp_atomic_exchange(&__new_handler, handler);
|
||||
}
|
||||
|
||||
new_handler
|
||||
get_new_handler() _NOEXCEPT
|
||||
{
|
||||
return __sync_fetch_and_add(&__new_handler, nullptr);
|
||||
return __libcpp_atomic_load(&__new_handler);
|
||||
}
|
||||
|
||||
} // namespace std
|
||||
|
@ -73,39 +73,59 @@ string do_strerror_r(int ev) {
|
||||
std::snprintf(buffer, strerror_buff_size, "unknown error %d", ev);
|
||||
return string(buffer);
|
||||
}
|
||||
#elif defined(__linux__) && !defined(_LIBCPP_HAS_MUSL_LIBC) && \
|
||||
(!defined(__ANDROID__) || __ANDROID_API__ >= 23)
|
||||
// GNU Extended version
|
||||
string do_strerror_r(int ev) {
|
||||
char buffer[strerror_buff_size];
|
||||
char* ret = ::strerror_r(ev, buffer, strerror_buff_size);
|
||||
return string(ret);
|
||||
}
|
||||
#else
|
||||
// POSIX version
|
||||
string do_strerror_r(int ev) {
|
||||
char buffer[strerror_buff_size];
|
||||
const int old_errno = errno;
|
||||
int ret;
|
||||
if ((ret = ::strerror_r(ev, buffer, strerror_buff_size)) != 0) {
|
||||
// If `ret == -1` then the error is specified using `errno`, otherwise
|
||||
// `ret` represents the error.
|
||||
const int new_errno = ret == -1 ? errno : ret;
|
||||
errno = old_errno;
|
||||
if (new_errno == EINVAL) {
|
||||
std::snprintf(buffer, strerror_buff_size, "Unknown error %d", ev);
|
||||
return string(buffer);
|
||||
} else {
|
||||
_LIBCPP_ASSERT(new_errno == ERANGE, "unexpected error from ::strerr_r");
|
||||
|
||||
// Only one of the two following functions will be used, depending on
|
||||
// the return type of strerror_r:
|
||||
|
||||
// For the GNU variant, a char* return value:
|
||||
__attribute__((unused)) const char *
|
||||
handle_strerror_r_return(char *strerror_return, char *buffer) {
|
||||
// GNU always returns a string pointer in its return value. The
|
||||
// string might point to either the input buffer, or a static
|
||||
// buffer, but we don't care which.
|
||||
return strerror_return;
|
||||
}
|
||||
|
||||
// For the POSIX variant: an int return value.
|
||||
__attribute__((unused)) const char *
|
||||
handle_strerror_r_return(int strerror_return, char *buffer) {
|
||||
// The POSIX variant either:
|
||||
// - fills in the provided buffer and returns 0
|
||||
// - returns a positive error value, or
|
||||
// - returns -1 and fills in errno with an error value.
|
||||
if (strerror_return == 0)
|
||||
return buffer;
|
||||
|
||||
// Only handle EINVAL. Other errors abort.
|
||||
int new_errno = strerror_return == -1 ? errno : strerror_return;
|
||||
if (new_errno == EINVAL)
|
||||
return "";
|
||||
|
||||
_LIBCPP_ASSERT(new_errno == ERANGE, "unexpected error from ::strerror_r");
|
||||
// FIXME maybe? 'strerror_buff_size' is likely to exceed the
|
||||
// maximum error size so ERANGE shouldn't be returned.
|
||||
std::abort();
|
||||
}
|
||||
|
||||
// This function handles both GNU and POSIX variants, dispatching to
|
||||
// one of the two above functions.
|
||||
string do_strerror_r(int ev) {
|
||||
char buffer[strerror_buff_size];
|
||||
// Preserve errno around the call. (The C++ standard requires that
|
||||
// system_error functions not modify errno).
|
||||
const int old_errno = errno;
|
||||
const char *error_message = handle_strerror_r_return(
|
||||
::strerror_r(ev, buffer, strerror_buff_size), buffer);
|
||||
// If we didn't get any message, print one now.
|
||||
if (!error_message[0]) {
|
||||
std::snprintf(buffer, strerror_buff_size, "Unknown error %d", ev);
|
||||
error_message = buffer;
|
||||
}
|
||||
}
|
||||
return string(buffer);
|
||||
errno = old_errno;
|
||||
return string(error_message);
|
||||
}
|
||||
#endif
|
||||
|
||||
} // end namespace
|
||||
#endif
|
||||
|
||||
|
@ -9,11 +9,48 @@
|
||||
|
||||
#include "typeinfo"
|
||||
|
||||
#if defined(_LIBCPP_ABI_MICROSOFT)
|
||||
#include <string.h>
|
||||
|
||||
int std::type_info::__compare(const type_info &__rhs) const _NOEXCEPT {
|
||||
if (&__data == &__rhs.__data)
|
||||
return 0;
|
||||
return strcmp(&__data.__decorated_name[1], &__rhs.__data.__decorated_name[1]);
|
||||
}
|
||||
|
||||
const char *std::type_info::name() const _NOEXCEPT {
|
||||
// TODO(compnerd) cache demangled &__data.__decorated_name[1]
|
||||
return &__data.__decorated_name[1];
|
||||
}
|
||||
|
||||
size_t std::type_info::hash_code() const _NOEXCEPT {
|
||||
#if defined(_WIN64)
|
||||
constexpr size_t fnv_offset_basis = 14695981039346656037ull;
|
||||
constexpr size_t fnv_prime = 10995116282110ull;
|
||||
#else
|
||||
constexpr size_t fnv_offset_basis = 2166136261ull;
|
||||
constexpr size_t fnv_prime = 16777619ull;
|
||||
#endif
|
||||
|
||||
size_t value = fnv_offset_basis;
|
||||
for (const char* c = &__data.__decorated_name[1]; *c; ++c) {
|
||||
value ^= static_cast<size_t>(static_cast<unsigned char>(*c));
|
||||
value *= fnv_prime;
|
||||
}
|
||||
|
||||
#if defined(_WIN64)
|
||||
value ^= value >> 32;
|
||||
#endif
|
||||
|
||||
return value;
|
||||
}
|
||||
#endif // _LIBCPP_ABI_MICROSOFT
|
||||
|
||||
// FIXME: Remove __APPLE__ default here once buildit is gone.
|
||||
#if (!defined(_LIBCPP_ABI_MICROSOFT) && !defined(LIBCXX_BUILDING_LIBCXXABI) && \
|
||||
!defined(LIBCXXRT) && !defined(__GLIBCXX__) && \
|
||||
!defined(__APPLE__)) || \
|
||||
defined(_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY) // FIXME: remove this configuration.
|
||||
// FIXME: Remove the _LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY configuration.
|
||||
#if (!defined(LIBCXX_BUILDING_LIBCXXABI) && !defined(LIBCXXRT) && \
|
||||
!defined(__GLIBCXX__) && !defined(__APPLE__)) || \
|
||||
defined(_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY)
|
||||
std::type_info::~type_info()
|
||||
{
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user