Merge to upstream r222492.
Change-Id: I6a0a6e90d217a69531ec3bb5ca0a367f39f4a1da
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index bbf7ea4..df2cd34 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -1,13 +1,22 @@
if (NOT LIBCXX_INSTALL_SUPPORT_HEADERS)
set(LIBCXX_SUPPORT_HEADER_PATTERN PATTERN "support" EXCLUDE)
endif()
-
-install(DIRECTORY .
- DESTINATION include/c++/v1
- FILES_MATCHING
+set(LIBCXX_HEADER_PATTERN
PATTERN "*"
PATTERN "CMakeLists.txt" EXCLUDE
PATTERN ".svn" EXCLUDE
${LIBCXX_SUPPORT_HEADER_PATTERN}
+ )
+
+file(COPY .
+ DESTINATION "${CMAKE_BINARY_DIR}/include/c++/v1"
+ FILES_MATCHING
+ ${LIBCXX_HEADER_PATTERN}
+ )
+
+install(DIRECTORY .
+ DESTINATION include/c++/v1
+ FILES_MATCHING
+ ${LIBCXX_HEADER_PATTERN}
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
diff --git a/include/__config b/include/__config
index a441bcc..d34bb7c 100644
--- a/include/__config
+++ b/include/__config
@@ -19,6 +19,11 @@
#define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__)
#endif
+#if !_WIN32
+#include <unistd.h>
+#include <errno.h> // for ELAST on FreeBSD
+#endif
+
#define _LIBCPP_VERSION 1101
#define _LIBCPP_ABI_VERSION 1
@@ -221,7 +226,8 @@
#endif
#if __cplusplus < 201103L
-#define _LIBCPP_HAS_NO_UNICODE_CHARS
+typedef __char16_t char16_t;
+typedef __char32_t char32_t;
#endif
#if !(__has_feature(cxx_exceptions))
@@ -603,7 +609,7 @@
#endif
#ifndef _LIBCPP_EXTERN_TEMPLATE
-#define _LIBCPP_EXTERN_TEMPLATE(...)
+#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;
#endif
#ifndef _LIBCPP_EXTERN_TEMPLATE2
@@ -630,6 +636,19 @@
#define _LIBCPP_WCTYPE_IS_MASK
#endif
+#if defined(ELAST)
+#define _LIBCPP_ELAST ELAST
+#elif defined(__linux__)
+#define _LIBCPP_ELAST 4095
+#elif defined(_NEWLIB_VERSION)
+#define _LIBCPP_ELAST __ELASTERROR
+#elif defined(__APPLE__)
+// Not _LIBCPP_ELAST needed on Apple
+#else
+// Warn here so that the person doing the libcxx port has an easier time:
+#warning This platform's ELAST hasn't been ported yet
+#endif
+
#ifndef _LIBCPP_TRIVIAL_PAIR_COPY_CTOR
# define _LIBCPP_TRIVIAL_PAIR_COPY_CTOR 1
#endif
diff --git a/include/__debug b/include/__debug
index f1805ad..c151224 100644
--- a/include/__debug
+++ b/include/__debug
@@ -11,19 +11,23 @@
#ifndef _LIBCPP_DEBUG_H
#define _LIBCPP_DEBUG_H
+#include <__config>
+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
#if _LIBCPP_DEBUG_LEVEL >= 1
-
# include <cstdlib>
# include <cstdio>
# include <cstddef>
# ifndef _LIBCPP_ASSERT
# define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : (_VSTD::printf("%s\n", m), _VSTD::abort()))
# endif
+#endif
+#ifndef _LIBCPP_ASSERT
+# define _LIBCPP_ASSERT(x, m) ((void)0)
#endif
#if _LIBCPP_DEBUG_LEVEL >= 2
diff --git a/include/__hash_table b/include/__hash_table
index 4c4feb0..7c954b6 100644
--- a/include/__hash_table
+++ b/include/__hash_table
@@ -20,11 +20,7 @@
#include <__undef_min_max>
-#ifdef _LIBCPP_DEBUG
-# include <__debug>
-#else
-# define _LIBCPP_ASSERT(x, m) ((void)0)
-#endif
+#include <__debug>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
diff --git a/include/__mutex_base b/include/__mutex_base
index 293fead..d5ece7c 100644
--- a/include/__mutex_base
+++ b/include/__mutex_base
@@ -22,6 +22,8 @@
_LIBCPP_BEGIN_NAMESPACE_STD
+#ifndef _LIBCPP_HAS_NO_THREADS
+
class _LIBCPP_TYPE_VIS mutex
{
pthread_mutex_t __m_;
@@ -315,6 +317,7 @@
void __do_timed_wait(unique_lock<mutex>& __lk,
chrono::time_point<chrono::system_clock, chrono::nanoseconds>) _NOEXCEPT;
};
+#endif // !_LIBCPP_HAS_NO_THREADS
template <class _To, class _Rep, class _Period>
inline _LIBCPP_INLINE_VISIBILITY
@@ -332,6 +335,7 @@
return __r;
}
+#ifndef _LIBCPP_HAS_NO_THREADS
template <class _Predicate>
void
condition_variable::wait(unique_lock<mutex>& __lk, _Predicate __pred)
@@ -396,6 +400,8 @@
_VSTD::move(__pred));
}
+#endif // !_LIBCPP_HAS_NO_THREADS
+
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP___MUTEX_BASE
diff --git a/include/__tuple b/include/__tuple
index ee5b916..bffb95c 100644
--- a/include/__tuple
+++ b/include/__tuple
@@ -245,19 +245,30 @@
// __tuple_convertible
-template <bool, class _Tp, class _Up>
+template <class, class>
struct __tuple_convertible_imp : public false_type {};
template <class _Tp0, class ..._Tp, class _Up0, class ..._Up>
-struct __tuple_convertible_imp<true, __tuple_types<_Tp0, _Tp...>, __tuple_types<_Up0, _Up...> >
+struct __tuple_convertible_imp<__tuple_types<_Tp0, _Tp...>, __tuple_types<_Up0, _Up...> >
: public integral_constant<bool,
is_convertible<_Tp0, _Up0>::value &&
- __tuple_convertible_imp<true, __tuple_types<_Tp...>, __tuple_types<_Up...> >::value> {};
+ __tuple_convertible_imp<__tuple_types<_Tp...>, __tuple_types<_Up...> >::value> {};
template <>
-struct __tuple_convertible_imp<true, __tuple_types<>, __tuple_types<> >
+struct __tuple_convertible_imp<__tuple_types<>, __tuple_types<> >
: public true_type {};
+template <bool, class, class>
+struct __tuple_convertible_apply : public false_type {};
+
+template <class _Tp, class _Up>
+struct __tuple_convertible_apply<true, _Tp, _Up>
+ : public __tuple_convertible_imp<
+ typename __make_tuple_types<_Tp>::type
+ , typename __make_tuple_types<_Up>::type
+ >
+{};
+
template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value,
bool = __tuple_like<_Up>::value>
struct __tuple_convertible
@@ -265,26 +276,36 @@
template <class _Tp, class _Up>
struct __tuple_convertible<_Tp, _Up, true, true>
- : public __tuple_convertible_imp<tuple_size<typename remove_reference<_Tp>::type>::value ==
- tuple_size<_Up>::value,
- typename __make_tuple_types<_Tp>::type, typename __make_tuple_types<_Up>::type>
+ : public __tuple_convertible_apply<tuple_size<typename remove_reference<_Tp>::type>::value ==
+ tuple_size<_Up>::value, _Tp, _Up>
{};
// __tuple_constructible
-template <bool, class _Tp, class _Up>
+template <class, class>
struct __tuple_constructible_imp : public false_type {};
template <class _Tp0, class ..._Tp, class _Up0, class ..._Up>
-struct __tuple_constructible_imp<true, __tuple_types<_Tp0, _Tp...>, __tuple_types<_Up0, _Up...> >
+struct __tuple_constructible_imp<__tuple_types<_Tp0, _Tp...>, __tuple_types<_Up0, _Up...> >
: public integral_constant<bool,
is_constructible<_Up0, _Tp0>::value &&
- __tuple_constructible_imp<true, __tuple_types<_Tp...>, __tuple_types<_Up...> >::value> {};
+ __tuple_constructible_imp<__tuple_types<_Tp...>, __tuple_types<_Up...> >::value> {};
template <>
-struct __tuple_constructible_imp<true, __tuple_types<>, __tuple_types<> >
+struct __tuple_constructible_imp<__tuple_types<>, __tuple_types<> >
: public true_type {};
+template <bool _SameSize, class, class>
+struct __tuple_constructible_apply : public false_type {};
+
+template <class _Tp, class _Up>
+struct __tuple_constructible_apply<true, _Tp, _Up>
+ : public __tuple_constructible_imp<
+ typename __make_tuple_types<_Tp>::type
+ , typename __make_tuple_types<_Up>::type
+ >
+{};
+
template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value,
bool = __tuple_like<_Up>::value>
struct __tuple_constructible
@@ -292,26 +313,36 @@
template <class _Tp, class _Up>
struct __tuple_constructible<_Tp, _Up, true, true>
- : public __tuple_constructible_imp<tuple_size<typename remove_reference<_Tp>::type>::value ==
- tuple_size<_Up>::value,
- typename __make_tuple_types<_Tp>::type, typename __make_tuple_types<_Up>::type>
+ : public __tuple_constructible_apply<tuple_size<typename remove_reference<_Tp>::type>::value ==
+ tuple_size<_Up>::value, _Tp, _Up>
{};
// __tuple_assignable
-template <bool, class _Tp, class _Up>
+template <class, class>
struct __tuple_assignable_imp : public false_type {};
template <class _Tp0, class ..._Tp, class _Up0, class ..._Up>
-struct __tuple_assignable_imp<true, __tuple_types<_Tp0, _Tp...>, __tuple_types<_Up0, _Up...> >
+struct __tuple_assignable_imp<__tuple_types<_Tp0, _Tp...>, __tuple_types<_Up0, _Up...> >
: public integral_constant<bool,
is_assignable<_Up0&, _Tp0>::value &&
- __tuple_assignable_imp<true, __tuple_types<_Tp...>, __tuple_types<_Up...> >::value> {};
+ __tuple_assignable_imp<__tuple_types<_Tp...>, __tuple_types<_Up...> >::value> {};
template <>
-struct __tuple_assignable_imp<true, __tuple_types<>, __tuple_types<> >
+struct __tuple_assignable_imp<__tuple_types<>, __tuple_types<> >
: public true_type {};
+template <bool, class, class>
+struct __tuple_assignable_apply : public false_type {};
+
+template <class _Tp, class _Up>
+struct __tuple_assignable_apply<true, _Tp, _Up>
+ : __tuple_assignable_imp<
+ typename __make_tuple_types<_Tp>::type
+ , typename __make_tuple_types<_Up>::type
+ >
+{};
+
template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value,
bool = __tuple_like<_Up>::value>
struct __tuple_assignable
@@ -319,9 +350,8 @@
template <class _Tp, class _Up>
struct __tuple_assignable<_Tp, _Up, true, true>
- : public __tuple_assignable_imp<tuple_size<typename remove_reference<_Tp>::type>::value ==
- tuple_size<_Up>::value,
- typename __make_tuple_types<_Tp>::type, typename __make_tuple_types<_Up>::type>
+ : public __tuple_assignable_apply<tuple_size<typename remove_reference<_Tp>::type>::value ==
+ tuple_size<_Up>::value, _Tp, _Up>
{};
_LIBCPP_END_NAMESPACE_STD
diff --git a/include/algorithm b/include/algorithm
index 1fed6e9..02cbc81 100644
--- a/include/algorithm
+++ b/include/algorithm
@@ -638,6 +638,8 @@
#include <__undef_min_max>
+#include <__debug>
+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
@@ -975,7 +977,7 @@
}
template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2>
-_RandomAccessIterator1
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _RandomAccessIterator1
__find_end(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
_RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred,
random_access_iterator_tag, random_access_iterator_tag)
@@ -1041,8 +1043,8 @@
// find_first_of
template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
-_ForwardIterator1
-find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator1
+__find_first_of_ce(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred)
{
for (; __first1 != __last1; ++__first1)
@@ -1052,6 +1054,16 @@
return __last1;
}
+
+template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
+inline _LIBCPP_INLINE_VISIBILITY
+_ForwardIterator1
+find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
+ _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred)
+{
+ return _VSTD::__find_first_of_ce(__first1, __last1, __first2, __last2, __pred);
+}
+
template <class _ForwardIterator1, class _ForwardIterator2>
inline _LIBCPP_INLINE_VISIBILITY
_ForwardIterator1
@@ -1060,7 +1072,7 @@
{
typedef typename iterator_traits<_ForwardIterator1>::value_type __v1;
typedef typename iterator_traits<_ForwardIterator2>::value_type __v2;
- return _VSTD::find_first_of(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());
+ return _VSTD::__find_first_of_ce(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());
}
// adjacent_find
@@ -1128,7 +1140,7 @@
mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _BinaryPredicate __pred)
{
- for (; __first1 != __last1; ++__first1, ++__first2)
+ for (; __first1 != __last1; ++__first1, (void) ++__first2)
if (!__pred(*__first1, *__first2))
break;
return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
@@ -1152,7 +1164,7 @@
_InputIterator2 __first2, _InputIterator2 __last2,
_BinaryPredicate __pred)
{
- for (; __first1 != __last1 && __first2 != __last2; ++__first1, ++__first2)
+ for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void) ++__first2)
if (!__pred(*__first1, *__first2))
break;
return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
@@ -1177,7 +1189,7 @@
bool
equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred)
{
- for (; __first1 != __last1; ++__first1, ++__first2)
+ for (; __first1 != __last1; ++__first1, (void) ++__first2)
if (!__pred(*__first1, *__first2))
return false;
return true;
@@ -1201,7 +1213,7 @@
_InputIterator2 __first2, _InputIterator2 __last2, _BinaryPredicate __pred,
input_iterator_tag, input_iterator_tag )
{
- for (; __first1 != __last1 && __first2 != __last2; ++__first1, ++__first2)
+ for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void) ++__first2)
if (!__pred(*__first1, *__first2))
return false;
return __first1 == __last1 && __first2 == __last2;
@@ -1255,7 +1267,7 @@
_ForwardIterator2 __first2, _BinaryPredicate __pred)
{
// shorten sequences as much as possible by lopping of any equal parts
- for (; __first1 != __last1; ++__first1, ++__first2)
+ for (; __first1 != __last1; ++__first1, (void) ++__first2)
if (!__pred(*__first1, *__first2))
goto __not_done;
return true;
@@ -1315,7 +1327,7 @@
forward_iterator_tag, forward_iterator_tag )
{
// shorten sequences as much as possible by lopping of any equal parts
- for (; __first1 != __last1 && __first2 != __last2; ++__first1, ++__first2)
+ for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void) ++__first2)
if (!__pred(*__first1, *__first2))
goto __not_done;
return __first1 == __last1 && __first2 == __last2;
@@ -1440,7 +1452,7 @@
}
template <class _BinaryPredicate, class _RandomAccessIterator1, class _RandomAccessIterator2>
-_RandomAccessIterator1
+_LIBCPP_CONSTEXPR_AFTER_CXX11 _RandomAccessIterator1
__search(_RandomAccessIterator1 __first1, _RandomAccessIterator1 __last1,
_RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred,
random_access_iterator_tag, random_access_iterator_tag)
@@ -1733,7 +1745,7 @@
_OutputIterator
__copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
{
- for (; __first != __last; ++__first, ++__result)
+ for (; __first != __last; ++__first, (void) ++__result)
*__result = *__first;
return __result;
}
@@ -1862,7 +1874,7 @@
_OutputIterator
__move(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
{
- for (; __first != __last; ++__first, ++__result)
+ for (; __first != __last; ++__first, (void) ++__result)
*__result = _VSTD::move(*__first);
return __result;
}
@@ -1938,7 +1950,7 @@
_OutputIterator
transform(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _UnaryOperation __op)
{
- for (; __first != __last; ++__first, ++__result)
+ for (; __first != __last; ++__first, (void) ++__result)
*__result = __op(*__first);
return __result;
}
@@ -1949,7 +1961,7 @@
transform(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2,
_OutputIterator __result, _BinaryOperation __binary_op)
{
- for (; __first1 != __last1; ++__first1, ++__first2, ++__result)
+ for (; __first1 != __last1; ++__first1, (void) ++__first2, ++__result)
*__result = __binary_op(*__first1, *__first2);
return __result;
}
@@ -1986,7 +1998,7 @@
replace_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result,
const _Tp& __old_value, const _Tp& __new_value)
{
- for (; __first != __last; ++__first, ++__result)
+ for (; __first != __last; ++__first, (void) ++__result)
if (*__first == __old_value)
*__result = __new_value;
else
@@ -2002,7 +2014,7 @@
replace_copy_if(_InputIterator __first, _InputIterator __last, _OutputIterator __result,
_Predicate __pred, const _Tp& __new_value)
{
- for (; __first != __last; ++__first, ++__result)
+ for (; __first != __last; ++__first, (void) ++__result)
if (__pred(*__first))
*__result = __new_value;
else
@@ -2017,7 +2029,7 @@
_OutputIterator
__fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_)
{
- for (; __n > 0; ++__first, --__n)
+ for (; __n > 0; ++__first, (void) --__n)
*__first = __value_;
return __first;
}
@@ -2091,7 +2103,7 @@
_OutputIterator
generate_n(_OutputIterator __first, _Size __n, _Generator __gen)
{
- for (; __n > 0; ++__first, --__n)
+ for (; __n > 0; ++__first, (void) --__n)
*__first = __gen();
return __first;
}
@@ -4360,7 +4372,7 @@
if (__len1 <= __len2)
{
value_type* __p = __buff;
- for (_BidirectionalIterator __i = __first; __i != __middle; __d.__incr((value_type*)0), ++__i, ++__p)
+ for (_BidirectionalIterator __i = __first; __i != __middle; __d.__incr((value_type*)0), (void) ++__i, ++__p)
::new(__p) value_type(_VSTD::move(*__i));
__merge<_Compare>(move_iterator<value_type*>(__buff),
move_iterator<value_type*>(__p),
@@ -4371,7 +4383,7 @@
else
{
value_type* __p = __buff;
- for (_BidirectionalIterator __i = __middle; __i != __last; __d.__incr((value_type*)0), ++__i, ++__p)
+ for (_BidirectionalIterator __i = __middle; __i != __last; __d.__incr((value_type*)0), (void) ++__i, ++__p)
::new(__p) value_type(_VSTD::move(*__i));
typedef reverse_iterator<_BidirectionalIterator> _RBi;
typedef reverse_iterator<value_type*> _Rv;
@@ -4396,7 +4408,7 @@
if (__len2 == 0)
return;
// shrink [__first, __middle) as much as possible (with no moves), returning if it shrinks to 0
- for (; true; ++__first, --__len1)
+ for (; true; ++__first, (void) --__len1)
{
if (__len1 == 0)
return;
@@ -5055,7 +5067,7 @@
_RandomAccessIterator __r = __result_first;
if (__r != __result_last)
{
- for (; __first != __last && __r != __result_last; ++__first, ++__r)
+ for (; __first != __last && __r != __result_last; (void) ++__first, ++__r)
*__r = *__first;
__make_heap<_Compare>(__result_first, __r, __comp);
typename iterator_traits<_RandomAccessIterator>::difference_type __len = __r - __result_first;
@@ -5577,7 +5589,7 @@
__lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp)
{
- for (; __first2 != __last2; ++__first1, ++__first2)
+ for (; __first2 != __last2; ++__first1, (void) ++__first2)
{
if (__first1 == __last1 || __comp(*__first1, *__first2))
return true;
diff --git a/include/atomic b/include/atomic
index 91f1829..b01a59f 100644
--- a/include/atomic
+++ b/include/atomic
@@ -533,6 +533,10 @@
#pragma GCC system_header
#endif
+#ifdef _LIBCPP_HAS_NO_THREADS
+#error <atomic> is not supported on this single threaded system
+#else // !_LIBCPP_HAS_NO_THREADS
+
_LIBCPP_BEGIN_NAMESPACE_STD
#if !__has_feature(cxx_atomic) && _GNUC_VER < 407
@@ -1779,4 +1783,6 @@
_LIBCPP_END_NAMESPACE_STD
+#endif // !_LIBCPP_HAS_NO_THREADS
+
#endif // _LIBCPP_ATOMIC
diff --git a/include/chrono b/include/chrono
index 2c65eee..9229234 100644
--- a/include/chrono
+++ b/include/chrono
@@ -926,6 +926,7 @@
static time_point from_time_t(time_t __t) _NOEXCEPT;
};
+#ifndef _LIBCPP_HAS_NO_MONOTONIC_CLOCK
class _LIBCPP_TYPE_VIS steady_clock
{
public:
@@ -939,6 +940,9 @@
};
typedef steady_clock high_resolution_clock;
+#else
+typedef system_clock high_resolution_clock;
+#endif
} // chrono
diff --git a/include/cmath b/include/cmath
index 964c672..d3aa4be 100644
--- a/include/cmath
+++ b/include/cmath
@@ -316,9 +316,9 @@
template <class _A1>
_LIBCPP_ALWAYS_INLINE
bool
-__libcpp_signbit(_A1 __x) _NOEXCEPT
+__libcpp_signbit(_A1 __lcpp_x) _NOEXCEPT
{
- return signbit(__x);
+ return signbit(__lcpp_x);
}
#undef signbit
@@ -326,9 +326,9 @@
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
-signbit(_A1 __x) _NOEXCEPT
+signbit(_A1 __lcpp_x) _NOEXCEPT
{
- return __libcpp_signbit((typename std::__promote<_A1>::type)__x);
+ return __libcpp_signbit((typename std::__promote<_A1>::type)__lcpp_x);
}
#endif // signbit
@@ -340,9 +340,9 @@
template <class _A1>
_LIBCPP_ALWAYS_INLINE
int
-__libcpp_fpclassify(_A1 __x) _NOEXCEPT
+__libcpp_fpclassify(_A1 __lcpp_x) _NOEXCEPT
{
- return fpclassify(__x);
+ return fpclassify(__lcpp_x);
}
#undef fpclassify
@@ -350,9 +350,9 @@
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_arithmetic<_A1>::value, int>::type
-fpclassify(_A1 __x) _NOEXCEPT
+fpclassify(_A1 __lcpp_x) _NOEXCEPT
{
- return __libcpp_fpclassify((typename std::__promote<_A1>::type)__x);
+ return __libcpp_fpclassify((typename std::__promote<_A1>::type)__lcpp_x);
}
#endif // fpclassify
@@ -364,9 +364,9 @@
template <class _A1>
_LIBCPP_ALWAYS_INLINE
bool
-__libcpp_isfinite(_A1 __x) _NOEXCEPT
+__libcpp_isfinite(_A1 __lcpp_x) _NOEXCEPT
{
- return isfinite(__x);
+ return isfinite(__lcpp_x);
}
#undef isfinite
@@ -374,9 +374,9 @@
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
-isfinite(_A1 __x) _NOEXCEPT
+isfinite(_A1 __lcpp_x) _NOEXCEPT
{
- return __libcpp_isfinite((typename std::__promote<_A1>::type)__x);
+ return __libcpp_isfinite((typename std::__promote<_A1>::type)__lcpp_x);
}
#endif // isfinite
@@ -388,9 +388,9 @@
template <class _A1>
_LIBCPP_ALWAYS_INLINE
bool
-__libcpp_isinf(_A1 __x) _NOEXCEPT
+__libcpp_isinf(_A1 __lcpp_x) _NOEXCEPT
{
- return isinf(__x);
+ return isinf(__lcpp_x);
}
#undef isinf
@@ -398,9 +398,9 @@
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
-isinf(_A1 __x) _NOEXCEPT
+isinf(_A1 __lcpp_x) _NOEXCEPT
{
- return __libcpp_isinf((typename std::__promote<_A1>::type)__x);
+ return __libcpp_isinf((typename std::__promote<_A1>::type)__lcpp_x);
}
#endif // isinf
@@ -412,9 +412,9 @@
template <class _A1>
_LIBCPP_ALWAYS_INLINE
bool
-__libcpp_isnan(_A1 __x) _NOEXCEPT
+__libcpp_isnan(_A1 __lcpp_x) _NOEXCEPT
{
- return isnan(__x);
+ return isnan(__lcpp_x);
}
#undef isnan
@@ -422,9 +422,9 @@
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
-isnan(_A1 __x) _NOEXCEPT
+isnan(_A1 __lcpp_x) _NOEXCEPT
{
- return __libcpp_isnan((typename std::__promote<_A1>::type)__x);
+ return __libcpp_isnan((typename std::__promote<_A1>::type)__lcpp_x);
}
#endif // isnan
@@ -436,9 +436,9 @@
template <class _A1>
_LIBCPP_ALWAYS_INLINE
bool
-__libcpp_isnormal(_A1 __x) _NOEXCEPT
+__libcpp_isnormal(_A1 __lcpp_x) _NOEXCEPT
{
- return isnormal(__x);
+ return isnormal(__lcpp_x);
}
#undef isnormal
@@ -446,9 +446,9 @@
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
-isnormal(_A1 __x) _NOEXCEPT
+isnormal(_A1 __lcpp_x) _NOEXCEPT
{
- return __libcpp_isnormal((typename std::__promote<_A1>::type)__x);
+ return __libcpp_isnormal((typename std::__promote<_A1>::type)__lcpp_x);
}
#endif // isnormal
@@ -460,9 +460,9 @@
template <class _A1, class _A2>
_LIBCPP_ALWAYS_INLINE
bool
-__libcpp_isgreater(_A1 __x, _A2 __y) _NOEXCEPT
+__libcpp_isgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
- return isgreater(__x, __y);
+ return isgreater(__lcpp_x, __lcpp_y);
}
#undef isgreater
@@ -475,10 +475,10 @@
std::is_arithmetic<_A2>::value,
bool
>::type
-isgreater(_A1 __x, _A2 __y) _NOEXCEPT
+isgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
typedef typename std::__promote<_A1, _A2>::type type;
- return __libcpp_isgreater((type)__x, (type)__y);
+ return __libcpp_isgreater((type)__lcpp_x, (type)__lcpp_y);
}
#endif // isgreater
@@ -490,9 +490,9 @@
template <class _A1, class _A2>
_LIBCPP_ALWAYS_INLINE
bool
-__libcpp_isgreaterequal(_A1 __x, _A2 __y) _NOEXCEPT
+__libcpp_isgreaterequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
- return isgreaterequal(__x, __y);
+ return isgreaterequal(__lcpp_x, __lcpp_y);
}
#undef isgreaterequal
@@ -505,10 +505,10 @@
std::is_arithmetic<_A2>::value,
bool
>::type
-isgreaterequal(_A1 __x, _A2 __y) _NOEXCEPT
+isgreaterequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
typedef typename std::__promote<_A1, _A2>::type type;
- return __libcpp_isgreaterequal((type)__x, (type)__y);
+ return __libcpp_isgreaterequal((type)__lcpp_x, (type)__lcpp_y);
}
#endif // isgreaterequal
@@ -520,9 +520,9 @@
template <class _A1, class _A2>
_LIBCPP_ALWAYS_INLINE
bool
-__libcpp_isless(_A1 __x, _A2 __y) _NOEXCEPT
+__libcpp_isless(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
- return isless(__x, __y);
+ return isless(__lcpp_x, __lcpp_y);
}
#undef isless
@@ -535,10 +535,10 @@
std::is_arithmetic<_A2>::value,
bool
>::type
-isless(_A1 __x, _A2 __y) _NOEXCEPT
+isless(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
typedef typename std::__promote<_A1, _A2>::type type;
- return __libcpp_isless((type)__x, (type)__y);
+ return __libcpp_isless((type)__lcpp_x, (type)__lcpp_y);
}
#endif // isless
@@ -550,9 +550,9 @@
template <class _A1, class _A2>
_LIBCPP_ALWAYS_INLINE
bool
-__libcpp_islessequal(_A1 __x, _A2 __y) _NOEXCEPT
+__libcpp_islessequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
- return islessequal(__x, __y);
+ return islessequal(__lcpp_x, __lcpp_y);
}
#undef islessequal
@@ -565,10 +565,10 @@
std::is_arithmetic<_A2>::value,
bool
>::type
-islessequal(_A1 __x, _A2 __y) _NOEXCEPT
+islessequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
typedef typename std::__promote<_A1, _A2>::type type;
- return __libcpp_islessequal((type)__x, (type)__y);
+ return __libcpp_islessequal((type)__lcpp_x, (type)__lcpp_y);
}
#endif // islessequal
@@ -580,9 +580,9 @@
template <class _A1, class _A2>
_LIBCPP_ALWAYS_INLINE
bool
-__libcpp_islessgreater(_A1 __x, _A2 __y) _NOEXCEPT
+__libcpp_islessgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
- return islessgreater(__x, __y);
+ return islessgreater(__lcpp_x, __lcpp_y);
}
#undef islessgreater
@@ -595,10 +595,10 @@
std::is_arithmetic<_A2>::value,
bool
>::type
-islessgreater(_A1 __x, _A2 __y) _NOEXCEPT
+islessgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
typedef typename std::__promote<_A1, _A2>::type type;
- return __libcpp_islessgreater((type)__x, (type)__y);
+ return __libcpp_islessgreater((type)__lcpp_x, (type)__lcpp_y);
}
#endif // islessgreater
@@ -610,9 +610,9 @@
template <class _A1, class _A2>
_LIBCPP_ALWAYS_INLINE
bool
-__libcpp_isunordered(_A1 __x, _A2 __y) _NOEXCEPT
+__libcpp_isunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
- return isunordered(__x, __y);
+ return isunordered(__lcpp_x, __lcpp_y);
}
#undef isunordered
@@ -625,10 +625,10 @@
std::is_arithmetic<_A2>::value,
bool
>::type
-isunordered(_A1 __x, _A2 __y) _NOEXCEPT
+isunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
typedef typename std::__promote<_A1, _A2>::type type;
- return __libcpp_isunordered((type)__x, (type)__y);
+ return __libcpp_isunordered((type)__lcpp_x, (type)__lcpp_y);
}
#endif // isunordered
@@ -657,15 +657,15 @@
#if !defined(_AIX)
inline _LIBCPP_INLINE_VISIBILITY
float
-abs(float __x) _NOEXCEPT {return fabsf(__x);}
+abs(float __lcpp_x) _NOEXCEPT {return fabsf(__lcpp_x);}
inline _LIBCPP_INLINE_VISIBILITY
double
-abs(double __x) _NOEXCEPT {return fabs(__x);}
+abs(double __lcpp_x) _NOEXCEPT {return fabs(__lcpp_x);}
inline _LIBCPP_INLINE_VISIBILITY
long double
-abs(long double __x) _NOEXCEPT {return fabsl(__x);}
+abs(long double __lcpp_x) _NOEXCEPT {return fabsl(__lcpp_x);}
#endif // !defined(_AIX)
#ifndef __sun__
@@ -676,14 +676,14 @@
using ::acosf;
#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float acos(float __x) _NOEXCEPT {return acosf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double acos(long double __x) _NOEXCEPT {return acosl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float acos(float __lcpp_x) _NOEXCEPT {return acosf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double acos(long double __lcpp_x) _NOEXCEPT {return acosl(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-acos(_A1 __x) _NOEXCEPT {return acos((double)__x);}
+acos(_A1 __lcpp_x) _NOEXCEPT {return acos((double)__lcpp_x);}
// asin
@@ -691,14 +691,14 @@
using ::asinf;
#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float asin(float __x) _NOEXCEPT {return asinf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double asin(long double __x) _NOEXCEPT {return asinl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float asin(float __lcpp_x) _NOEXCEPT {return asinf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double asin(long double __lcpp_x) _NOEXCEPT {return asinl(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-asin(_A1 __x) _NOEXCEPT {return asin((double)__x);}
+asin(_A1 __lcpp_x) _NOEXCEPT {return asin((double)__lcpp_x);}
// atan
@@ -706,14 +706,14 @@
using ::atanf;
#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float atan(float __x) _NOEXCEPT {return atanf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double atan(long double __x) _NOEXCEPT {return atanl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float atan(float __lcpp_x) _NOEXCEPT {return atanf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double atan(long double __lcpp_x) _NOEXCEPT {return atanl(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-atan(_A1 __x) _NOEXCEPT {return atan((double)__x);}
+atan(_A1 __lcpp_x) _NOEXCEPT {return atan((double)__lcpp_x);}
// atan2
@@ -721,24 +721,24 @@
using ::atan2f;
#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float atan2(float __y, float __x) _NOEXCEPT {return atan2f(__y, __x);}
-inline _LIBCPP_INLINE_VISIBILITY long double atan2(long double __y, long double __x) _NOEXCEPT {return atan2l(__y, __x);}
+inline _LIBCPP_INLINE_VISIBILITY float atan2(float __lcpp_y, float __lcpp_x) _NOEXCEPT {return atan2f(__lcpp_y, __lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double atan2(long double __lcpp_y, long double __lcpp_x) _NOEXCEPT {return atan2l(__lcpp_y, __lcpp_x);}
#endif
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
+typename __lazy_enable_if
<
is_arithmetic<_A1>::value &&
is_arithmetic<_A2>::value,
- typename __promote<_A1, _A2>::type
+ __promote<_A1, _A2>
>::type
-atan2(_A1 __y, _A2 __x) _NOEXCEPT
+atan2(_A1 __lcpp_y, _A2 __lcpp_x) _NOEXCEPT
{
typedef typename __promote<_A1, _A2>::type __result_type;
static_assert((!(is_same<_A1, __result_type>::value &&
is_same<_A2, __result_type>::value)), "");
- return atan2((__result_type)__y, (__result_type)__x);
+ return atan2((__result_type)__lcpp_y, (__result_type)__lcpp_x);
}
// ceil
@@ -747,14 +747,14 @@
using ::ceilf;
#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float ceil(float __x) _NOEXCEPT {return ceilf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double ceil(long double __x) _NOEXCEPT {return ceill(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float ceil(float __lcpp_x) _NOEXCEPT {return ceilf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double ceil(long double __lcpp_x) _NOEXCEPT {return ceill(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-ceil(_A1 __x) _NOEXCEPT {return ceil((double)__x);}
+ceil(_A1 __lcpp_x) _NOEXCEPT {return ceil((double)__lcpp_x);}
// cos
@@ -762,14 +762,14 @@
using ::cosf;
#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float cos(float __x) _NOEXCEPT {return cosf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double cos(long double __x) _NOEXCEPT {return cosl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float cos(float __lcpp_x) _NOEXCEPT {return cosf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double cos(long double __lcpp_x) _NOEXCEPT {return cosl(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-cos(_A1 __x) _NOEXCEPT {return cos((double)__x);}
+cos(_A1 __lcpp_x) _NOEXCEPT {return cos((double)__lcpp_x);}
// cosh
@@ -777,14 +777,14 @@
using ::coshf;
#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float cosh(float __x) _NOEXCEPT {return coshf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double cosh(long double __x) _NOEXCEPT {return coshl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float cosh(float __lcpp_x) _NOEXCEPT {return coshf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double cosh(long double __lcpp_x) _NOEXCEPT {return coshl(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-cosh(_A1 __x) _NOEXCEPT {return cosh((double)__x);}
+cosh(_A1 __lcpp_x) _NOEXCEPT {return cosh((double)__lcpp_x);}
#endif // __sun__
// exp
@@ -795,15 +795,15 @@
#ifndef __sun__
#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float exp(float __x) _NOEXCEPT {return expf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double exp(long double __x) _NOEXCEPT {return expl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float exp(float __lcpp_x) _NOEXCEPT {return expf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double exp(long double __lcpp_x) _NOEXCEPT {return expl(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-exp(_A1 __x) _NOEXCEPT {return exp((double)__x);}
+exp(_A1 __lcpp_x) _NOEXCEPT {return exp((double)__lcpp_x);}
// fabs
@@ -811,14 +811,14 @@
using ::fabsf;
#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float fabs(float __x) _NOEXCEPT {return fabsf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double fabs(long double __x) _NOEXCEPT {return fabsl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float fabs(float __lcpp_x) _NOEXCEPT {return fabsf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double fabs(long double __lcpp_x) _NOEXCEPT {return fabsl(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-fabs(_A1 __x) _NOEXCEPT {return fabs((double)__x);}
+fabs(_A1 __lcpp_x) _NOEXCEPT {return fabs((double)__lcpp_x);}
// floor
@@ -826,14 +826,14 @@
using ::floorf;
#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float floor(float __x) _NOEXCEPT {return floorf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double floor(long double __x) _NOEXCEPT {return floorl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float floor(float __lcpp_x) _NOEXCEPT {return floorf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double floor(long double __lcpp_x) _NOEXCEPT {return floorl(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-floor(_A1 __x) _NOEXCEPT {return floor((double)__x);}
+floor(_A1 __lcpp_x) _NOEXCEPT {return floor((double)__lcpp_x);}
// fmod
@@ -843,24 +843,24 @@
#ifndef __sun__
#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float fmod(float __x, float __y) _NOEXCEPT {return fmodf(__x, __y);}
-inline _LIBCPP_INLINE_VISIBILITY long double fmod(long double __x, long double __y) _NOEXCEPT {return fmodl(__x, __y);}
+inline _LIBCPP_INLINE_VISIBILITY float fmod(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return fmodf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double fmod(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fmodl(__lcpp_x, __lcpp_y);}
#endif
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
+typename __lazy_enable_if
<
is_arithmetic<_A1>::value &&
is_arithmetic<_A2>::value,
- typename __promote<_A1, _A2>::type
+ __promote<_A1, _A2>
>::type
-fmod(_A1 __x, _A2 __y) _NOEXCEPT
+fmod(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
typedef typename __promote<_A1, _A2>::type __result_type;
static_assert((!(is_same<_A1, __result_type>::value &&
is_same<_A2, __result_type>::value)), "");
- return fmod((__result_type)__x, (__result_type)__y);
+ return fmod((__result_type)__lcpp_x, (__result_type)__lcpp_y);
}
@@ -870,14 +870,14 @@
using ::frexpf;
#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float frexp(float __x, int* __e) _NOEXCEPT {return frexpf(__x, __e);}
-inline _LIBCPP_INLINE_VISIBILITY long double frexp(long double __x, int* __e) _NOEXCEPT {return frexpl(__x, __e);}
+inline _LIBCPP_INLINE_VISIBILITY float frexp(float __lcpp_x, int* __lcpp_e) _NOEXCEPT {return frexpf(__lcpp_x, __lcpp_e);}
+inline _LIBCPP_INLINE_VISIBILITY long double frexp(long double __lcpp_x, int* __lcpp_e) _NOEXCEPT {return frexpl(__lcpp_x, __lcpp_e);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-frexp(_A1 __x, int* __e) _NOEXCEPT {return frexp((double)__x, __e);}
+frexp(_A1 __lcpp_x, int* __lcpp_e) _NOEXCEPT {return frexp((double)__lcpp_x, __lcpp_e);}
// ldexp
@@ -885,14 +885,14 @@
using ::ldexpf;
#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float ldexp(float __x, int __e) _NOEXCEPT {return ldexpf(__x, __e);}
-inline _LIBCPP_INLINE_VISIBILITY long double ldexp(long double __x, int __e) _NOEXCEPT {return ldexpl(__x, __e);}
+inline _LIBCPP_INLINE_VISIBILITY float ldexp(float __lcpp_x, int __lcpp_e) _NOEXCEPT {return ldexpf(__lcpp_x, __lcpp_e);}
+inline _LIBCPP_INLINE_VISIBILITY long double ldexp(long double __lcpp_x, int __lcpp_e) _NOEXCEPT {return ldexpl(__lcpp_x, __lcpp_e);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-ldexp(_A1 __x, int __e) _NOEXCEPT {return ldexp((double)__x, __e);}
+ldexp(_A1 __lcpp_x, int __lcpp_e) _NOEXCEPT {return ldexp((double)__lcpp_x, __lcpp_e);}
// log
@@ -902,14 +902,14 @@
#ifndef __sun__
#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float log(float __x) _NOEXCEPT {return logf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double log(long double __x) _NOEXCEPT {return logl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float log(float __lcpp_x) _NOEXCEPT {return logf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double log(long double __lcpp_x) _NOEXCEPT {return logl(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-log(_A1 __x) _NOEXCEPT {return log((double)__x);}
+log(_A1 __lcpp_x) _NOEXCEPT {return log((double)__lcpp_x);}
// log10
@@ -918,14 +918,14 @@
using ::log10f;
#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float log10(float __x) _NOEXCEPT {return log10f(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double log10(long double __x) _NOEXCEPT {return log10l(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float log10(float __lcpp_x) _NOEXCEPT {return log10f(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double log10(long double __lcpp_x) _NOEXCEPT {return log10l(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-log10(_A1 __x) _NOEXCEPT {return log10((double)__x);}
+log10(_A1 __lcpp_x) _NOEXCEPT {return log10((double)__lcpp_x);}
// modf
@@ -933,8 +933,8 @@
using ::modff;
#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float modf(float __x, float* __y) _NOEXCEPT {return modff(__x, __y);}
-inline _LIBCPP_INLINE_VISIBILITY long double modf(long double __x, long double* __y) _NOEXCEPT {return modfl(__x, __y);}
+inline _LIBCPP_INLINE_VISIBILITY float modf(float __lcpp_x, float* __lcpp_y) _NOEXCEPT {return modff(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double modf(long double __lcpp_x, long double* __lcpp_y) _NOEXCEPT {return modfl(__lcpp_x, __lcpp_y);}
#endif
// pow
@@ -946,24 +946,24 @@
#ifndef __sun__
#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float pow(float __x, float __y) _NOEXCEPT {return powf(__x, __y);}
-inline _LIBCPP_INLINE_VISIBILITY long double pow(long double __x, long double __y) _NOEXCEPT {return powl(__x, __y);}
+inline _LIBCPP_INLINE_VISIBILITY float pow(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return powf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double pow(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return powl(__lcpp_x, __lcpp_y);}
#endif
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
+typename __lazy_enable_if
<
is_arithmetic<_A1>::value &&
is_arithmetic<_A2>::value,
- typename __promote<_A1, _A2>::type
+ __promote<_A1, _A2>
>::type
-pow(_A1 __x, _A2 __y) _NOEXCEPT
+pow(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
typedef typename __promote<_A1, _A2>::type __result_type;
static_assert((!(is_same<_A1, __result_type>::value &&
is_same<_A2, __result_type>::value)), "");
- return pow((__result_type)__x, (__result_type)__y);
+ return pow((__result_type)__lcpp_x, (__result_type)__lcpp_y);
}
// sin
@@ -972,14 +972,14 @@
using ::sinf;
#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float sin(float __x) _NOEXCEPT {return sinf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double sin(long double __x) _NOEXCEPT {return sinl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float sin(float __lcpp_x) _NOEXCEPT {return sinf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double sin(long double __lcpp_x) _NOEXCEPT {return sinl(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-sin(_A1 __x) _NOEXCEPT {return sin((double)__x);}
+sin(_A1 __lcpp_x) _NOEXCEPT {return sin((double)__lcpp_x);}
// sinh
@@ -987,14 +987,14 @@
using ::sinhf;
#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float sinh(float __x) _NOEXCEPT {return sinhf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double sinh(long double __x) _NOEXCEPT {return sinhl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float sinh(float __lcpp_x) _NOEXCEPT {return sinhf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double sinh(long double __lcpp_x) _NOEXCEPT {return sinhl(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-sinh(_A1 __x) _NOEXCEPT {return sinh((double)__x);}
+sinh(_A1 __lcpp_x) _NOEXCEPT {return sinh((double)__lcpp_x);}
// sqrt
@@ -1004,14 +1004,14 @@
#if !(defined(_LIBCPP_MSVCRT) || defined(__sun__) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float sqrt(float __x) _NOEXCEPT {return sqrtf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double sqrt(long double __x) _NOEXCEPT {return sqrtl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float sqrt(float __lcpp_x) _NOEXCEPT {return sqrtf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double sqrt(long double __lcpp_x) _NOEXCEPT {return sqrtl(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-sqrt(_A1 __x) _NOEXCEPT {return sqrt((double)__x);}
+sqrt(_A1 __lcpp_x) _NOEXCEPT {return sqrt((double)__lcpp_x);}
// tan
@@ -1020,14 +1020,14 @@
#ifndef __sun__
#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float tan(float __x) _NOEXCEPT {return tanf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double tan(long double __x) _NOEXCEPT {return tanl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float tan(float __lcpp_x) _NOEXCEPT {return tanf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double tan(long double __lcpp_x) _NOEXCEPT {return tanl(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-tan(_A1 __x) _NOEXCEPT {return tan((double)__x);}
+tan(_A1 __lcpp_x) _NOEXCEPT {return tan((double)__lcpp_x);}
// tanh
@@ -1035,14 +1035,14 @@
using ::tanhf;
#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
-inline _LIBCPP_INLINE_VISIBILITY float tanh(float __x) _NOEXCEPT {return tanhf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double tanh(long double __x) _NOEXCEPT {return tanhl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float tanh(float __lcpp_x) _NOEXCEPT {return tanhf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double tanh(long double __lcpp_x) _NOEXCEPT {return tanhl(__lcpp_x);}
#endif
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-tanh(_A1 __x) _NOEXCEPT {return tanh((double)__x);}
+tanh(_A1 __lcpp_x) _NOEXCEPT {return tanh((double)__lcpp_x);}
// acosh
@@ -1050,13 +1050,13 @@
using ::acosh;
using ::acoshf;
-inline _LIBCPP_INLINE_VISIBILITY float acosh(float __x) _NOEXCEPT {return acoshf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double acosh(long double __x) _NOEXCEPT {return acoshl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float acosh(float __lcpp_x) _NOEXCEPT {return acoshf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double acosh(long double __lcpp_x) _NOEXCEPT {return acoshl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-acosh(_A1 __x) _NOEXCEPT {return acosh((double)__x);}
+acosh(_A1 __lcpp_x) _NOEXCEPT {return acosh((double)__lcpp_x);}
#endif
// asinh
@@ -1065,13 +1065,13 @@
using ::asinh;
using ::asinhf;
-inline _LIBCPP_INLINE_VISIBILITY float asinh(float __x) _NOEXCEPT {return asinhf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double asinh(long double __x) _NOEXCEPT {return asinhl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float asinh(float __lcpp_x) _NOEXCEPT {return asinhf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double asinh(long double __lcpp_x) _NOEXCEPT {return asinhl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-asinh(_A1 __x) _NOEXCEPT {return asinh((double)__x);}
+asinh(_A1 __lcpp_x) _NOEXCEPT {return asinh((double)__lcpp_x);}
#endif
// atanh
@@ -1080,13 +1080,13 @@
using ::atanh;
using ::atanhf;
-inline _LIBCPP_INLINE_VISIBILITY float atanh(float __x) _NOEXCEPT {return atanhf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double atanh(long double __x) _NOEXCEPT {return atanhl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float atanh(float __lcpp_x) _NOEXCEPT {return atanhf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double atanh(long double __lcpp_x) _NOEXCEPT {return atanhl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-atanh(_A1 __x) _NOEXCEPT {return atanh((double)__x);}
+atanh(_A1 __lcpp_x) _NOEXCEPT {return atanh((double)__lcpp_x);}
#endif
// cbrt
@@ -1095,13 +1095,13 @@
using ::cbrt;
using ::cbrtf;
-inline _LIBCPP_INLINE_VISIBILITY float cbrt(float __x) _NOEXCEPT {return cbrtf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double cbrt(long double __x) _NOEXCEPT {return cbrtl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float cbrt(float __lcpp_x) _NOEXCEPT {return cbrtf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double cbrt(long double __lcpp_x) _NOEXCEPT {return cbrtl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-cbrt(_A1 __x) _NOEXCEPT {return cbrt((double)__x);}
+cbrt(_A1 __lcpp_x) _NOEXCEPT {return cbrt((double)__lcpp_x);}
#endif
// copysign
@@ -1109,23 +1109,23 @@
using ::copysign;
using ::copysignf;
-inline _LIBCPP_INLINE_VISIBILITY float copysign(float __x, float __y) _NOEXCEPT {return copysignf(__x, __y);}
-inline _LIBCPP_INLINE_VISIBILITY long double copysign(long double __x, long double __y) _NOEXCEPT {return copysignl(__x, __y);}
+inline _LIBCPP_INLINE_VISIBILITY float copysign(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return copysignf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double copysign(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return copysignl(__lcpp_x, __lcpp_y);}
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
+typename __lazy_enable_if
<
is_arithmetic<_A1>::value &&
is_arithmetic<_A2>::value,
- typename __promote<_A1, _A2>::type
+ __promote<_A1, _A2>
>::type
-copysign(_A1 __x, _A2 __y) _NOEXCEPT
+copysign(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
typedef typename __promote<_A1, _A2>::type __result_type;
static_assert((!(is_same<_A1, __result_type>::value &&
is_same<_A2, __result_type>::value)), "");
- return copysign((__result_type)__x, (__result_type)__y);
+ return copysign((__result_type)__lcpp_x, (__result_type)__lcpp_y);
}
#ifndef _LIBCPP_MSVCRT
@@ -1135,75 +1135,75 @@
using ::erf;
using ::erff;
-inline _LIBCPP_INLINE_VISIBILITY float erf(float __x) _NOEXCEPT {return erff(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double erf(long double __x) _NOEXCEPT {return erfl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float erf(float __lcpp_x) _NOEXCEPT {return erff(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double erf(long double __lcpp_x) _NOEXCEPT {return erfl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-erf(_A1 __x) _NOEXCEPT {return erf((double)__x);}
+erf(_A1 __lcpp_x) _NOEXCEPT {return erf((double)__lcpp_x);}
// erfc
using ::erfc;
using ::erfcf;
-inline _LIBCPP_INLINE_VISIBILITY float erfc(float __x) _NOEXCEPT {return erfcf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double erfc(long double __x) _NOEXCEPT {return erfcl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float erfc(float __lcpp_x) _NOEXCEPT {return erfcf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double erfc(long double __lcpp_x) _NOEXCEPT {return erfcl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-erfc(_A1 __x) _NOEXCEPT {return erfc((double)__x);}
+erfc(_A1 __lcpp_x) _NOEXCEPT {return erfc((double)__lcpp_x);}
// exp2
using ::exp2;
using ::exp2f;
-inline _LIBCPP_INLINE_VISIBILITY float exp2(float __x) _NOEXCEPT {return exp2f(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double exp2(long double __x) _NOEXCEPT {return exp2l(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float exp2(float __lcpp_x) _NOEXCEPT {return exp2f(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double exp2(long double __lcpp_x) _NOEXCEPT {return exp2l(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-exp2(_A1 __x) _NOEXCEPT {return exp2((double)__x);}
+exp2(_A1 __lcpp_x) _NOEXCEPT {return exp2((double)__lcpp_x);}
// expm1
using ::expm1;
using ::expm1f;
-inline _LIBCPP_INLINE_VISIBILITY float expm1(float __x) _NOEXCEPT {return expm1f(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double expm1(long double __x) _NOEXCEPT {return expm1l(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float expm1(float __lcpp_x) _NOEXCEPT {return expm1f(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double expm1(long double __lcpp_x) _NOEXCEPT {return expm1l(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-expm1(_A1 __x) _NOEXCEPT {return expm1((double)__x);}
+expm1(_A1 __lcpp_x) _NOEXCEPT {return expm1((double)__lcpp_x);}
// fdim
using ::fdim;
using ::fdimf;
-inline _LIBCPP_INLINE_VISIBILITY float fdim(float __x, float __y) _NOEXCEPT {return fdimf(__x, __y);}
-inline _LIBCPP_INLINE_VISIBILITY long double fdim(long double __x, long double __y) _NOEXCEPT {return fdiml(__x, __y);}
+inline _LIBCPP_INLINE_VISIBILITY float fdim(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return fdimf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double fdim(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fdiml(__lcpp_x, __lcpp_y);}
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
+typename __lazy_enable_if
<
is_arithmetic<_A1>::value &&
is_arithmetic<_A2>::value,
- typename __promote<_A1, _A2>::type
+ __promote<_A1, _A2>
>::type
-fdim(_A1 __x, _A2 __y) _NOEXCEPT
+fdim(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
typedef typename __promote<_A1, _A2>::type __result_type;
static_assert((!(is_same<_A1, __result_type>::value &&
is_same<_A2, __result_type>::value)), "");
- return fdim((__result_type)__x, (__result_type)__y);
+ return fdim((__result_type)__lcpp_x, (__result_type)__lcpp_y);
}
// fma
@@ -1211,25 +1211,25 @@
using ::fmaf;
using ::fma;
-inline _LIBCPP_INLINE_VISIBILITY float fma(float __x, float __y, float __z) _NOEXCEPT {return fmaf(__x, __y, __z);}
-inline _LIBCPP_INLINE_VISIBILITY long double fma(long double __x, long double __y, long double __z) _NOEXCEPT {return fmal(__x, __y, __z);}
+inline _LIBCPP_INLINE_VISIBILITY float fma(float __lcpp_x, float __lcpp_y, float __lcpp_z) _NOEXCEPT {return fmaf(__lcpp_x, __lcpp_y, __lcpp_z);}
+inline _LIBCPP_INLINE_VISIBILITY long double fma(long double __lcpp_x, long double __lcpp_y, long double __lcpp_z) _NOEXCEPT {return fmal(__lcpp_x, __lcpp_y, __lcpp_z);}
template <class _A1, class _A2, class _A3>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
+typename __lazy_enable_if
<
is_arithmetic<_A1>::value &&
is_arithmetic<_A2>::value &&
is_arithmetic<_A3>::value,
- typename __promote<_A1, _A2, _A3>::type
+ __promote<_A1, _A2, _A3>
>::type
-fma(_A1 __x, _A2 __y, _A3 __z) _NOEXCEPT
+fma(_A1 __lcpp_x, _A2 __lcpp_y, _A3 __lcpp_z) _NOEXCEPT
{
typedef typename __promote<_A1, _A2, _A3>::type __result_type;
static_assert((!(is_same<_A1, __result_type>::value &&
is_same<_A2, __result_type>::value &&
is_same<_A3, __result_type>::value)), "");
- return fma((__result_type)__x, (__result_type)__y, (__result_type)__z);
+ return fma((__result_type)__lcpp_x, (__result_type)__lcpp_y, (__result_type)__lcpp_z);
}
// fmax
@@ -1237,23 +1237,23 @@
using ::fmax;
using ::fmaxf;
-inline _LIBCPP_INLINE_VISIBILITY float fmax(float __x, float __y) _NOEXCEPT {return fmaxf(__x, __y);}
-inline _LIBCPP_INLINE_VISIBILITY long double fmax(long double __x, long double __y) _NOEXCEPT {return fmaxl(__x, __y);}
+inline _LIBCPP_INLINE_VISIBILITY float fmax(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return fmaxf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double fmax(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fmaxl(__lcpp_x, __lcpp_y);}
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
+typename __lazy_enable_if
<
is_arithmetic<_A1>::value &&
is_arithmetic<_A2>::value,
- typename __promote<_A1, _A2>::type
+ __promote<_A1, _A2>
>::type
-fmax(_A1 __x, _A2 __y) _NOEXCEPT
+fmax(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
typedef typename __promote<_A1, _A2>::type __result_type;
static_assert((!(is_same<_A1, __result_type>::value &&
is_same<_A2, __result_type>::value)), "");
- return fmax((__result_type)__x, (__result_type)__y);
+ return fmax((__result_type)__lcpp_x, (__result_type)__lcpp_y);
}
// fmin
@@ -1261,23 +1261,23 @@
using ::fmin;
using ::fminf;
-inline _LIBCPP_INLINE_VISIBILITY float fmin(float __x, float __y) _NOEXCEPT {return fminf(__x, __y);}
-inline _LIBCPP_INLINE_VISIBILITY long double fmin(long double __x, long double __y) _NOEXCEPT {return fminl(__x, __y);}
+inline _LIBCPP_INLINE_VISIBILITY float fmin(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return fminf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double fmin(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fminl(__lcpp_x, __lcpp_y);}
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
+typename __lazy_enable_if
<
is_arithmetic<_A1>::value &&
is_arithmetic<_A2>::value,
- typename __promote<_A1, _A2>::type
+ __promote<_A1, _A2>
>::type
-fmin(_A1 __x, _A2 __y) _NOEXCEPT
+fmin(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
typedef typename __promote<_A1, _A2>::type __result_type;
static_assert((!(is_same<_A1, __result_type>::value &&
is_same<_A2, __result_type>::value)), "");
- return fmin((__result_type)__x, (__result_type)__y);
+ return fmin((__result_type)__lcpp_x, (__result_type)__lcpp_y);
}
// hypot
@@ -1285,23 +1285,23 @@
using ::hypot;
using ::hypotf;
-inline _LIBCPP_INLINE_VISIBILITY float hypot(float __x, float __y) _NOEXCEPT {return hypotf(__x, __y);}
-inline _LIBCPP_INLINE_VISIBILITY long double hypot(long double __x, long double __y) _NOEXCEPT {return hypotl(__x, __y);}
+inline _LIBCPP_INLINE_VISIBILITY float hypot(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return hypotf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double hypot(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return hypotl(__lcpp_x, __lcpp_y);}
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
+typename __lazy_enable_if
<
is_arithmetic<_A1>::value &&
is_arithmetic<_A2>::value,
- typename __promote<_A1, _A2>::type
+ __promote<_A1, _A2>
>::type
-hypot(_A1 __x, _A2 __y) _NOEXCEPT
+hypot(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
typedef typename __promote<_A1, _A2>::type __result_type;
static_assert((!(is_same<_A1, __result_type>::value &&
is_same<_A2, __result_type>::value)), "");
- return hypot((__result_type)__x, (__result_type)__y);
+ return hypot((__result_type)__lcpp_x, (__result_type)__lcpp_y);
}
// ilogb
@@ -1309,27 +1309,27 @@
using ::ilogb;
using ::ilogbf;
-inline _LIBCPP_INLINE_VISIBILITY int ilogb(float __x) _NOEXCEPT {return ilogbf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY int ilogb(long double __x) _NOEXCEPT {return ilogbl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY int ilogb(float __lcpp_x) _NOEXCEPT {return ilogbf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY int ilogb(long double __lcpp_x) _NOEXCEPT {return ilogbl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, int>::type
-ilogb(_A1 __x) _NOEXCEPT {return ilogb((double)__x);}
+ilogb(_A1 __lcpp_x) _NOEXCEPT {return ilogb((double)__lcpp_x);}
// lgamma
using ::lgamma;
using ::lgammaf;
-inline _LIBCPP_INLINE_VISIBILITY float lgamma(float __x) _NOEXCEPT {return lgammaf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double lgamma(long double __x) _NOEXCEPT {return lgammal(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float lgamma(float __lcpp_x) _NOEXCEPT {return lgammaf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double lgamma(long double __lcpp_x) _NOEXCEPT {return lgammal(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-lgamma(_A1 __x) _NOEXCEPT {return lgamma((double)__x);}
+lgamma(_A1 __lcpp_x) _NOEXCEPT {return lgamma((double)__lcpp_x);}
// llrint
@@ -1337,91 +1337,91 @@
using ::llrint;
using ::llrintf;
-inline _LIBCPP_INLINE_VISIBILITY long long llrint(float __x) _NOEXCEPT {return llrintf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __x) _NOEXCEPT {return llrintl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY long long llrint(float __lcpp_x) _NOEXCEPT {return llrintf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __lcpp_x) _NOEXCEPT {return llrintl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, long long>::type
-llrint(_A1 __x) _NOEXCEPT {return llrint((double)__x);}
+llrint(_A1 __lcpp_x) _NOEXCEPT {return llrint((double)__lcpp_x);}
// llround
using ::llround;
using ::llroundf;
-inline _LIBCPP_INLINE_VISIBILITY long long llround(float __x) _NOEXCEPT {return llroundf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long long llround(long double __x) _NOEXCEPT {return llroundl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY long long llround(float __lcpp_x) _NOEXCEPT {return llroundf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long long llround(long double __lcpp_x) _NOEXCEPT {return llroundl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, long long>::type
-llround(_A1 __x) _NOEXCEPT {return llround((double)__x);}
+llround(_A1 __lcpp_x) _NOEXCEPT {return llround((double)__lcpp_x);}
// log1p
using ::log1p;
using ::log1pf;
-inline _LIBCPP_INLINE_VISIBILITY float log1p(float __x) _NOEXCEPT {return log1pf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double log1p(long double __x) _NOEXCEPT {return log1pl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float log1p(float __lcpp_x) _NOEXCEPT {return log1pf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double log1p(long double __lcpp_x) _NOEXCEPT {return log1pl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-log1p(_A1 __x) _NOEXCEPT {return log1p((double)__x);}
+log1p(_A1 __lcpp_x) _NOEXCEPT {return log1p((double)__lcpp_x);}
// log2
using ::log2;
using ::log2f;
-inline _LIBCPP_INLINE_VISIBILITY float log2(float __x) _NOEXCEPT {return log2f(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double log2(long double __x) _NOEXCEPT {return log2l(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float log2(float __lcpp_x) _NOEXCEPT {return log2f(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double log2(long double __lcpp_x) _NOEXCEPT {return log2l(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-log2(_A1 __x) _NOEXCEPT {return log2((double)__x);}
+log2(_A1 __lcpp_x) _NOEXCEPT {return log2((double)__lcpp_x);}
// logb
using ::logb;
using ::logbf;
-inline _LIBCPP_INLINE_VISIBILITY float logb(float __x) _NOEXCEPT {return logbf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double logb(long double __x) _NOEXCEPT {return logbl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float logb(float __lcpp_x) _NOEXCEPT {return logbf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double logb(long double __lcpp_x) _NOEXCEPT {return logbl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-logb(_A1 __x) _NOEXCEPT {return logb((double)__x);}
+logb(_A1 __lcpp_x) _NOEXCEPT {return logb((double)__lcpp_x);}
// lrint
using ::lrint;
using ::lrintf;
-inline _LIBCPP_INLINE_VISIBILITY long lrint(float __x) _NOEXCEPT {return lrintf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long lrint(long double __x) _NOEXCEPT {return lrintl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY long lrint(float __lcpp_x) _NOEXCEPT {return lrintf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long lrint(long double __lcpp_x) _NOEXCEPT {return lrintl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, long>::type
-lrint(_A1 __x) _NOEXCEPT {return lrint((double)__x);}
+lrint(_A1 __lcpp_x) _NOEXCEPT {return lrint((double)__lcpp_x);}
// lround
using ::lround;
using ::lroundf;
-inline _LIBCPP_INLINE_VISIBILITY long lround(float __x) _NOEXCEPT {return lroundf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long lround(long double __x) _NOEXCEPT {return lroundl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY long lround(float __lcpp_x) _NOEXCEPT {return lroundf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long lround(long double __lcpp_x) _NOEXCEPT {return lroundl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, long>::type
-lround(_A1 __x) _NOEXCEPT {return lround((double)__x);}
+lround(_A1 __lcpp_x) _NOEXCEPT {return lround((double)__lcpp_x);}
#endif // _LIBCPP_MSVCRT
#endif // __sun__
@@ -1441,36 +1441,36 @@
using ::nearbyint;
using ::nearbyintf;
-inline _LIBCPP_INLINE_VISIBILITY float nearbyint(float __x) _NOEXCEPT {return nearbyintf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double nearbyint(long double __x) _NOEXCEPT {return nearbyintl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float nearbyint(float __lcpp_x) _NOEXCEPT {return nearbyintf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double nearbyint(long double __lcpp_x) _NOEXCEPT {return nearbyintl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-nearbyint(_A1 __x) _NOEXCEPT {return nearbyint((double)__x);}
+nearbyint(_A1 __lcpp_x) _NOEXCEPT {return nearbyint((double)__lcpp_x);}
// nextafter
using ::nextafter;
using ::nextafterf;
-inline _LIBCPP_INLINE_VISIBILITY float nextafter(float __x, float __y) _NOEXCEPT {return nextafterf(__x, __y);}
-inline _LIBCPP_INLINE_VISIBILITY long double nextafter(long double __x, long double __y) _NOEXCEPT {return nextafterl(__x, __y);}
+inline _LIBCPP_INLINE_VISIBILITY float nextafter(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return nextafterf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double nextafter(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nextafterl(__lcpp_x, __lcpp_y);}
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
+typename __lazy_enable_if
<
is_arithmetic<_A1>::value &&
is_arithmetic<_A2>::value,
- typename __promote<_A1, _A2>::type
+ __promote<_A1, _A2>
>::type
-nextafter(_A1 __x, _A2 __y) _NOEXCEPT
+nextafter(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
typedef typename __promote<_A1, _A2>::type __result_type;
static_assert((!(is_same<_A1, __result_type>::value &&
is_same<_A2, __result_type>::value)), "");
- return nextafter((__result_type)__x, (__result_type)__y);
+ return nextafter((__result_type)__lcpp_x, (__result_type)__lcpp_y);
}
// nexttoward
@@ -1478,36 +1478,36 @@
using ::nexttoward;
using ::nexttowardf;
-inline _LIBCPP_INLINE_VISIBILITY float nexttoward(float __x, long double __y) _NOEXCEPT {return nexttowardf(__x, __y);}
-inline _LIBCPP_INLINE_VISIBILITY long double nexttoward(long double __x, long double __y) _NOEXCEPT {return nexttowardl(__x, __y);}
+inline _LIBCPP_INLINE_VISIBILITY float nexttoward(float __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nexttowardf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double nexttoward(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nexttowardl(__lcpp_x, __lcpp_y);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-nexttoward(_A1 __x, long double __y) _NOEXCEPT {return nexttoward((double)__x, __y);}
+nexttoward(_A1 __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nexttoward((double)__lcpp_x, __lcpp_y);}
// remainder
using ::remainder;
using ::remainderf;
-inline _LIBCPP_INLINE_VISIBILITY float remainder(float __x, float __y) _NOEXCEPT {return remainderf(__x, __y);}
-inline _LIBCPP_INLINE_VISIBILITY long double remainder(long double __x, long double __y) _NOEXCEPT {return remainderl(__x, __y);}
+inline _LIBCPP_INLINE_VISIBILITY float remainder(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return remainderf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double remainder(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return remainderl(__lcpp_x, __lcpp_y);}
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
+typename __lazy_enable_if
<
is_arithmetic<_A1>::value &&
is_arithmetic<_A2>::value,
- typename __promote<_A1, _A2>::type
+ __promote<_A1, _A2>
>::type
-remainder(_A1 __x, _A2 __y) _NOEXCEPT
+remainder(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
{
typedef typename __promote<_A1, _A2>::type __result_type;
static_assert((!(is_same<_A1, __result_type>::value &&
is_same<_A2, __result_type>::value)), "");
- return remainder((__result_type)__x, (__result_type)__y);
+ return remainder((__result_type)__lcpp_x, (__result_type)__lcpp_y);
}
// remquo
@@ -1515,23 +1515,23 @@
using ::remquo;
using ::remquof;
-inline _LIBCPP_INLINE_VISIBILITY float remquo(float __x, float __y, int* __z) _NOEXCEPT {return remquof(__x, __y, __z);}
-inline _LIBCPP_INLINE_VISIBILITY long double remquo(long double __x, long double __y, int* __z) _NOEXCEPT {return remquol(__x, __y, __z);}
+inline _LIBCPP_INLINE_VISIBILITY float remquo(float __lcpp_x, float __lcpp_y, int* __lcpp_z) _NOEXCEPT {return remquof(__lcpp_x, __lcpp_y, __lcpp_z);}
+inline _LIBCPP_INLINE_VISIBILITY long double remquo(long double __lcpp_x, long double __lcpp_y, int* __lcpp_z) _NOEXCEPT {return remquol(__lcpp_x, __lcpp_y, __lcpp_z);}
template <class _A1, class _A2>
inline _LIBCPP_INLINE_VISIBILITY
-typename enable_if
+typename __lazy_enable_if
<
is_arithmetic<_A1>::value &&
is_arithmetic<_A2>::value,
- typename __promote<_A1, _A2>::type
+ __promote<_A1, _A2>
>::type
-remquo(_A1 __x, _A2 __y, int* __z) _NOEXCEPT
+remquo(_A1 __lcpp_x, _A2 __lcpp_y, int* __lcpp_z) _NOEXCEPT
{
typedef typename __promote<_A1, _A2>::type __result_type;
static_assert((!(is_same<_A1, __result_type>::value &&
is_same<_A2, __result_type>::value)), "");
- return remquo((__result_type)__x, (__result_type)__y, __z);
+ return remquo((__result_type)__lcpp_x, (__result_type)__lcpp_y, __lcpp_z);
}
// rint
@@ -1539,78 +1539,78 @@
using ::rint;
using ::rintf;
-inline _LIBCPP_INLINE_VISIBILITY float rint(float __x) _NOEXCEPT {return rintf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double rint(long double __x) _NOEXCEPT {return rintl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float rint(float __lcpp_x) _NOEXCEPT {return rintf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double rint(long double __lcpp_x) _NOEXCEPT {return rintl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-rint(_A1 __x) _NOEXCEPT {return rint((double)__x);}
+rint(_A1 __lcpp_x) _NOEXCEPT {return rint((double)__lcpp_x);}
// round
using ::round;
using ::roundf;
-inline _LIBCPP_INLINE_VISIBILITY float round(float __x) _NOEXCEPT {return roundf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double round(long double __x) _NOEXCEPT {return roundl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float round(float __lcpp_x) _NOEXCEPT {return roundf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double round(long double __lcpp_x) _NOEXCEPT {return roundl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-round(_A1 __x) _NOEXCEPT {return round((double)__x);}
+round(_A1 __lcpp_x) _NOEXCEPT {return round((double)__lcpp_x);}
// scalbln
using ::scalbln;
using ::scalblnf;
-inline _LIBCPP_INLINE_VISIBILITY float scalbln(float __x, long __y) _NOEXCEPT {return scalblnf(__x, __y);}
-inline _LIBCPP_INLINE_VISIBILITY long double scalbln(long double __x, long __y) _NOEXCEPT {return scalblnl(__x, __y);}
+inline _LIBCPP_INLINE_VISIBILITY float scalbln(float __lcpp_x, long __lcpp_y) _NOEXCEPT {return scalblnf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double scalbln(long double __lcpp_x, long __lcpp_y) _NOEXCEPT {return scalblnl(__lcpp_x, __lcpp_y);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-scalbln(_A1 __x, long __y) _NOEXCEPT {return scalbln((double)__x, __y);}
+scalbln(_A1 __lcpp_x, long __lcpp_y) _NOEXCEPT {return scalbln((double)__lcpp_x, __lcpp_y);}
// scalbn
using ::scalbn;
using ::scalbnf;
-inline _LIBCPP_INLINE_VISIBILITY float scalbn(float __x, int __y) _NOEXCEPT {return scalbnf(__x, __y);}
-inline _LIBCPP_INLINE_VISIBILITY long double scalbn(long double __x, int __y) _NOEXCEPT {return scalbnl(__x, __y);}
+inline _LIBCPP_INLINE_VISIBILITY float scalbn(float __lcpp_x, int __lcpp_y) _NOEXCEPT {return scalbnf(__lcpp_x, __lcpp_y);}
+inline _LIBCPP_INLINE_VISIBILITY long double scalbn(long double __lcpp_x, int __lcpp_y) _NOEXCEPT {return scalbnl(__lcpp_x, __lcpp_y);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-scalbn(_A1 __x, int __y) _NOEXCEPT {return scalbn((double)__x, __y);}
+scalbn(_A1 __lcpp_x, int __lcpp_y) _NOEXCEPT {return scalbn((double)__lcpp_x, __lcpp_y);}
// tgamma
using ::tgamma;
using ::tgammaf;
-inline _LIBCPP_INLINE_VISIBILITY float tgamma(float __x) _NOEXCEPT {return tgammaf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double tgamma(long double __x) _NOEXCEPT {return tgammal(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float tgamma(float __lcpp_x) _NOEXCEPT {return tgammaf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double tgamma(long double __lcpp_x) _NOEXCEPT {return tgammal(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-tgamma(_A1 __x) _NOEXCEPT {return tgamma((double)__x);}
+tgamma(_A1 __lcpp_x) _NOEXCEPT {return tgamma((double)__lcpp_x);}
// trunc
using ::trunc;
using ::truncf;
-inline _LIBCPP_INLINE_VISIBILITY float trunc(float __x) _NOEXCEPT {return truncf(__x);}
-inline _LIBCPP_INLINE_VISIBILITY long double trunc(long double __x) _NOEXCEPT {return truncl(__x);}
+inline _LIBCPP_INLINE_VISIBILITY float trunc(float __lcpp_x) _NOEXCEPT {return truncf(__lcpp_x);}
+inline _LIBCPP_INLINE_VISIBILITY long double trunc(long double __lcpp_x) _NOEXCEPT {return truncl(__lcpp_x);}
template <class _A1>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if<is_integral<_A1>::value, double>::type
-trunc(_A1 __x) _NOEXCEPT {return trunc((double)__x);}
+trunc(_A1 __lcpp_x) _NOEXCEPT {return trunc((double)__lcpp_x);}
#endif // !_LIBCPP_MSVCRT
diff --git a/include/condition_variable b/include/condition_variable
index dc67266..1af2484 100644
--- a/include/condition_variable
+++ b/include/condition_variable
@@ -115,6 +115,8 @@
#pragma GCC system_header
#endif
+#ifndef _LIBCPP_HAS_NO_THREADS
+
_LIBCPP_BEGIN_NAMESPACE_STD
class _LIBCPP_TYPE_VIS condition_variable_any
@@ -253,4 +255,6 @@
_LIBCPP_END_NAMESPACE_STD
+#endif // !_LIBCPP_HAS_NO_THREADS
+
#endif // _LIBCPP_CONDITION_VARIABLE
diff --git a/include/deque b/include/deque
index 9b256b7..5602d4a 100644
--- a/include/deque
+++ b/include/deque
@@ -1588,7 +1588,7 @@
{
iterator __i = __base::begin();
iterator __e = __base::end();
- for (; __f != __l && __i != __e; ++__f, ++__i)
+ for (; __f != __l && __i != __e; ++__f, (void) ++__i)
*__i = *__f;
if (__f != __l)
__append(__f, __l);
@@ -2160,7 +2160,7 @@
if (__n > __de)
{
__m = __de < __n / 2 ? _VSTD::next(__f, __de) : _VSTD::prev(__l, __n - __de);
- for (_BiIter __j = __m; __j != __l; ++__i, ++__j, ++__base::size())
+ for (_BiIter __j = __m; __j != __l; ++__i, (void) ++__j, ++__base::size())
__alloc_traits::construct(__a, _VSTD::addressof(*__i), *__j);
__n = __de;
}
@@ -2200,7 +2200,7 @@
if (__n > __back_capacity)
__add_back_capacity(__n - __back_capacity);
// __n <= __back_capacity
- for (iterator __i = __base::end(); __f != __l; ++__i, ++__f, ++__base::size())
+ for (iterator __i = __base::end(); __f != __l; ++__i, (void) ++__f, ++__base::size())
__alloc_traits::construct(__a, _VSTD::addressof(*__i), *__f);
}
diff --git a/include/experimental/__config b/include/experimental/__config
new file mode 100644
index 0000000..684a3b4
--- /dev/null
+++ b/include/experimental/__config
@@ -0,0 +1,24 @@
+// -*- C++ -*-
+//===--------------------------- __config ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_EXPERIMENTAL_CONFIG
+#define _LIBCPP_EXPERIMENTAL_CONFIG
+
+#include <__config>
+
+#define _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL namespace std { namespace experimental {
+#define _LIBCPP_END_NAMESPACE_EXPERIMENTAL } }
+#define _VSTD_EXPERIMENTAL std::experimental
+
+#define _LIBCPP_BEGIN_NAMESPACE_LFTS _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL inline namespace fundamentals_v1 {
+#define _LIBCPP_END_NAMESPACE_LFTS } } }
+#define _VSTD_LFTS _VSTD_EXPERIMENTAL::fundamentals_v1
+
+#endif
diff --git a/include/experimental/optional b/include/experimental/optional
index 3848da8..2f0df35 100644
--- a/include/experimental/optional
+++ b/include/experimental/optional
@@ -151,11 +151,7 @@
#include <__undef_min_max>
-#ifdef _LIBCPP_DEBUG
-# include <__debug>
-#else
-# define _LIBCPP_ASSERT(x, m) ((void)0)
-#endif
+#include <__debug>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -696,4 +692,4 @@
#endif // _LIBCPP_STD_VER > 11
-#endif // _LIBCPP_ARRAY
+#endif // _LIBCPP_OPTIONAL
diff --git a/include/experimental/string_view b/include/experimental/string_view
new file mode 100644
index 0000000..d423f39
--- /dev/null
+++ b/include/experimental/string_view
@@ -0,0 +1,815 @@
+// -*- C++ -*-
+//===------------------------ string_view ---------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_LFTS_STRING_VIEW
+#define _LIBCPP_LFTS_STRING_VIEW
+
+/*
+string_view synopsis
+
+namespace std {
+ namespace experimental {
+ inline namespace library_fundamentals_v1 {
+
+ // 7.2, Class template basic_string_view
+ template<class charT, class traits = char_traits<charT>>
+ class basic_string_view;
+
+ // 7.9, basic_string_view non-member comparison functions
+ template<class charT, class traits>
+ constexpr bool operator==(basic_string_view<charT, traits> x,
+ basic_string_view<charT, traits> y) noexcept;
+ template<class charT, class traits>
+ constexpr bool operator!=(basic_string_view<charT, traits> x,
+ basic_string_view<charT, traits> y) noexcept;
+ template<class charT, class traits>
+ constexpr bool operator< (basic_string_view<charT, traits> x,
+ basic_string_view<charT, traits> y) noexcept;
+ template<class charT, class traits>
+ constexpr bool operator> (basic_string_view<charT, traits> x,
+ basic_string_view<charT, traits> y) noexcept;
+ template<class charT, class traits>
+ constexpr bool operator<=(basic_string_view<charT, traits> x,
+ basic_string_view<charT, traits> y) noexcept;
+ template<class charT, class traits>
+ constexpr bool operator>=(basic_string_view<charT, traits> x,
+ basic_string_view<charT, traits> y) noexcept;
+ // see below, sufficient additional overloads of comparison functions
+
+ // 7.10, Inserters and extractors
+ template<class charT, class traits>
+ basic_ostream<charT, traits>&
+ operator<<(basic_ostream<charT, traits>& os,
+ basic_string_view<charT, traits> str);
+
+ // basic_string_view typedef names
+ typedef basic_string_view<char> string_view;
+ typedef basic_string_view<char16_t> u16string_view;
+ typedef basic_string_view<char32_t> u32string_view;
+ typedef basic_string_view<wchar_t> wstring_view;
+
+ template<class charT, class traits = char_traits<charT>>
+ class basic_string_view {
+ public:
+ // types
+ typedef traits traits_type;
+ typedef charT value_type;
+ typedef charT* pointer;
+ typedef const charT* const_pointer;
+ typedef charT& reference;
+ typedef const charT& const_reference;
+ typedef implementation-defined const_iterator;
+ typedef const_iterator iterator;
+ typedef reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef const_reverse_iterator reverse_iterator;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ static constexpr size_type npos = size_type(-1);
+
+ // 7.3, basic_string_view constructors and assignment operators
+ constexpr basic_string_view() noexcept;
+ constexpr basic_string_view(const basic_string_view&) noexcept = default;
+ basic_string_view& operator=(const basic_string_view&) noexcept = default;
+ template<class Allocator>
+ basic_string_view(const basic_string<charT, traits, Allocator>& str) noexcept;
+ constexpr basic_string_view(const charT* str);
+ constexpr basic_string_view(const charT* str, size_type len);
+
+ // 7.4, basic_string_view iterator support
+ constexpr const_iterator begin() const noexcept;
+ constexpr const_iterator end() const noexcept;
+ constexpr const_iterator cbegin() const noexcept;
+ constexpr const_iterator cend() const noexcept;
+ const_reverse_iterator rbegin() const noexcept;
+ const_reverse_iterator rend() const noexcept;
+ const_reverse_iterator crbegin() const noexcept;
+ const_reverse_iterator crend() const noexcept;
+
+ // 7.5, basic_string_view capacity
+ constexpr size_type size() const noexcept;
+ constexpr size_type length() const noexcept;
+ constexpr size_type max_size() const noexcept;
+ constexpr bool empty() const noexcept;
+
+ // 7.6, basic_string_view element access
+ constexpr const_reference operator[](size_type pos) const;
+ constexpr const_reference at(size_type pos) const;
+ constexpr const_reference front() const;
+ constexpr const_reference back() const;
+ constexpr const_pointer data() const noexcept;
+
+ // 7.7, basic_string_view modifiers
+ constexpr void clear() noexcept;
+ constexpr void remove_prefix(size_type n);
+ constexpr void remove_suffix(size_type n);
+ constexpr void swap(basic_string_view& s) noexcept;
+
+ // 7.8, basic_string_view string operations
+ template<class Allocator>
+ explicit operator basic_string<charT, traits, Allocator>() const;
+ template<class Allocator = allocator<charT>>
+ basic_string<charT, traits, Allocator> to_string(
+ const Allocator& a = Allocator()) const;
+
+ size_type copy(charT* s, size_type n, size_type pos = 0) const;
+
+ constexpr basic_string_view substr(size_type pos = 0, size_type n = npos) const;
+ constexpr int compare(basic_string_view s) const noexcept;
+ constexpr int compare(size_type pos1, size_type n1, basic_string_view s) const;
+ constexpr int compare(size_type pos1, size_type n1,
+ basic_string_view s, size_type pos2, size_type n2) const;
+ constexpr int compare(const charT* s) const;
+ constexpr int compare(size_type pos1, size_type n1, const charT* s) const;
+ constexpr int compare(size_type pos1, size_type n1,
+ const charT* s, size_type n2) const;
+ constexpr size_type find(basic_string_view s, size_type pos = 0) const noexcept;
+ constexpr size_type find(charT c, size_type pos = 0) const noexcept;
+ constexpr size_type find(const charT* s, size_type pos, size_type n) const;
+ constexpr size_type find(const charT* s, size_type pos = 0) const;
+ constexpr size_type rfind(basic_string_view s, size_type pos = npos) const noexcept;
+ constexpr size_type rfind(charT c, size_type pos = npos) const noexcept;
+ constexpr size_type rfind(const charT* s, size_type pos, size_type n) const;
+ constexpr size_type rfind(const charT* s, size_type pos = npos) const;
+ constexpr size_type find_first_of(basic_string_view s, size_type pos = 0) const noexcept;
+ constexpr size_type find_first_of(charT c, size_type pos = 0) const noexcept;
+ constexpr size_type find_first_of(const charT* s, size_type pos, size_type n) const;
+ constexpr size_type find_first_of(const charT* s, size_type pos = 0) const;
+ constexpr size_type find_last_of(basic_string_view s, size_type pos = npos) const noexcept;
+ constexpr size_type find_last_of(charT c, size_type pos = npos) const noexcept;
+ constexpr size_type find_last_of(const charT* s, size_type pos, size_type n) const;
+ constexpr size_type find_last_of(const charT* s, size_type pos = npos) const;
+ constexpr size_type find_first_not_of(basic_string_view s, size_type pos = 0) const noexcept;
+ constexpr size_type find_first_not_of(charT c, size_type pos = 0) const noexcept;
+ constexpr size_type find_first_not_of(const charT* s, size_type pos, size_type n) const;
+ constexpr size_type find_first_not_of(const charT* s, size_type pos = 0) const;
+ constexpr size_type find_last_not_of(basic_string_view s, size_type pos = npos) const noexcept;
+ constexpr size_type find_last_not_of(charT c, size_type pos = npos) const noexcept;
+ 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;
+
+ private:
+ const_pointer data_; // exposition only
+ size_type size_; // exposition only
+ };
+
+ } // namespace fundamentals_v1
+ } // namespace experimental
+
+ // 7.11, Hash support
+ template <class T> struct hash;
+ template <> struct hash<experimental::string_view>;
+ template <> struct hash<experimental::u16string_view>;
+ template <> struct hash<experimental::u32string_view>;
+ template <> struct hash<experimental::wstring_view>;
+
+} // namespace std
+
+
+*/
+
+#include <experimental/__config>
+
+#include <string>
+#include <algorithm>
+#include <iterator>
+#include <ostream>
+#include <iomanip>
+
+#include <__debug>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
+_LIBCPP_BEGIN_NAMESPACE_LFTS
+
+ template<class _CharT, class _Traits = _VSTD::char_traits<_CharT> >
+ class _LIBCPP_TYPE_VIS_ONLY basic_string_view {
+ public:
+ // types
+ typedef _Traits traits_type;
+ typedef _CharT value_type;
+ typedef const _CharT* pointer;
+ typedef const _CharT* const_pointer;
+ typedef const _CharT& reference;
+ typedef const _CharT& const_reference;
+ typedef const_pointer const_iterator; // See [string.view.iterators]
+ typedef const_iterator iterator;
+ typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef const_reverse_iterator reverse_iterator;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ static _LIBCPP_CONSTEXPR const size_type npos = -1; // size_type(-1);
+
+ // [string.view.cons], construct/copy
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ basic_string_view() _NOEXCEPT : __data (nullptr), __size(0) {}
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ basic_string_view(const basic_string_view&) _NOEXCEPT = default;
+
+ _LIBCPP_INLINE_VISIBILITY
+ basic_string_view& operator=(const basic_string_view&) _NOEXCEPT = default;
+
+ template<class _Allocator>
+ _LIBCPP_INLINE_VISIBILITY
+ basic_string_view(const basic_string<_CharT, _Traits, _Allocator>& __str) _NOEXCEPT
+ : __data (__str.data()), __size(__str.size()) {}
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ basic_string_view(const _CharT* __s, size_type __len)
+ : __data(__s), __size(__len)
+ {
+// _LIBCPP_ASSERT(__len == 0 || __s != nullptr, "string_view::string_view(_CharT *, size_t): recieved nullptr");
+ }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ basic_string_view(const _CharT* __s)
+ : __data(__s), __size(_Traits::length(__s)) {}
+
+ // [string.view.iterators], iterators
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ const_iterator begin() const _NOEXCEPT { return cbegin(); }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ const_iterator end() const _NOEXCEPT { return cend(); }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ const_iterator cbegin() const _NOEXCEPT { return __data; }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ const_iterator cend() const _NOEXCEPT { return __data + __size; }
+
+ _LIBCPP_INLINE_VISIBILITY
+ const_reverse_iterator rbegin() const _NOEXCEPT { return const_reverse_iterator(cend()); }
+
+ _LIBCPP_INLINE_VISIBILITY
+ const_reverse_iterator rend() const _NOEXCEPT { return const_reverse_iterator(cbegin()); }
+
+ _LIBCPP_INLINE_VISIBILITY
+ const_reverse_iterator crbegin() const _NOEXCEPT { return const_reverse_iterator(cend()); }
+
+ _LIBCPP_INLINE_VISIBILITY
+ const_reverse_iterator crend() const _NOEXCEPT { return const_reverse_iterator(cbegin()); }
+
+ // [string.view.capacity], capacity
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ size_type size() const _NOEXCEPT { return __size; }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ size_type length() const _NOEXCEPT { return __size; }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ size_type max_size() const _NOEXCEPT { return _VSTD::numeric_limits<size_type>::max(); }
+
+ _LIBCPP_CONSTEXPR bool _LIBCPP_INLINE_VISIBILITY
+ empty() const _NOEXCEPT { return __size == 0; }
+
+ // [string.view.access], element access
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ const_reference operator[](size_type __pos) const { return __data[__pos]; }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ const_reference at(size_type __pos) const
+ {
+ return __pos >= size()
+ ? throw out_of_range("string_view::at")
+ : __data[__pos];
+// if (__pos >= size())
+// throw out_of_range("string_view::at");
+// return __data[__pos];
+ }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ const_reference front() const
+ {
+ return _LIBCPP_ASSERT(!empty(), "string_view::front(): string is empty"), __data[0];
+ }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ const_reference back() const
+ {
+ return _LIBCPP_ASSERT(!empty(), "string_view::back(): string is empty"), __data[__size-1];
+ }
+
+ _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+ const_pointer data() const _NOEXCEPT { return __data; }
+
+ // [string.view.modifiers], modifiers:
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ void clear() _NOEXCEPT
+ {
+ __data = nullptr;
+ __size = 0;
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ void remove_prefix(size_type __n) _NOEXCEPT
+ {
+ _LIBCPP_ASSERT(n <= size(), "remove_prefix() can't remove more than size()");
+ __data += __n;
+ __size -= __n;
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ void remove_suffix(size_type __n) _NOEXCEPT
+ {
+ _LIBCPP_ASSERT(n <= size(), "remove_suffix() can't remove more than size()");
+ __size -= __n;
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ void swap(basic_string_view& __other) _NOEXCEPT
+ {
+ const value_type *__p = __data;
+ __data = __other.__data;
+ __other.__data = __p;
+
+ size_type __sz = __size;
+ __size = __other.__size;
+ __other.__size = __sz;
+// _VSTD::swap( __data, __other.__data );
+// _VSTD::swap( __size, __other.__size );
+ }
+
+ // [string.view.ops], string operations:
+ template<class _Allocator>
+ _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_EXPLICIT operator basic_string<_CharT, _Traits, _Allocator>() const
+ { return basic_string<_CharT, _Traits, _Allocator>( begin(), end()); }
+
+ template<class _Allocator = allocator<_CharT> >
+ _LIBCPP_INLINE_VISIBILITY
+ basic_string<_CharT, _Traits, _Allocator>
+ to_string( const _Allocator& __a = _Allocator()) const
+ { return basic_string<_CharT, _Traits, _Allocator> ( begin(), end(), __a ); }
+
+ size_type copy(_CharT* __s, size_type __n, size_type __pos = 0) const
+ {
+ if ( __pos > size())
+ throw out_of_range("string_view::copy");
+ size_type __rlen = _VSTD::min( __n, size() - __pos );
+ _VSTD::copy_n(begin() + __pos, __rlen, __s );
+ return __rlen;
+ }
+
+ _LIBCPP_CONSTEXPR
+ basic_string_view substr(size_type __pos = 0, size_type __n = npos) const
+ {
+// if (__pos > size())
+// throw out_of_range("string_view::substr");
+// size_type __rlen = _VSTD::min( __n, size() - __pos );
+// return basic_string_view(data() + __pos, __rlen);
+ return __pos > size()
+ ? throw out_of_range("string_view::substr")
+ : basic_string_view(data() + __pos, _VSTD::min(__n, size() - __pos));
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 int compare(basic_string_view __sv) const _NOEXCEPT
+ {
+ size_type __rlen = _VSTD::min( size(), __sv.size());
+ int __retval = _Traits::compare(data(), __sv.data(), __rlen);
+ if ( __retval == 0 ) // first __rlen chars matched
+ __retval = size() == __sv.size() ? 0 : ( size() < __sv.size() ? -1 : 1 );
+ return __retval;
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ int compare(size_type __pos1, size_type __n1, basic_string_view __sv) const
+ {
+ return substr(__pos1, __n1).compare(__sv);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ int compare( size_type __pos1, size_type __n1,
+ basic_string_view _sv, size_type __pos2, size_type __n2) const
+ {
+ return substr(__pos1, __n1).compare(_sv.substr(__pos2, __n2));
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ int compare(const _CharT* __s) const
+ {
+ return compare(basic_string_view(__s));
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ int compare(size_type __pos1, size_type __n1, const _CharT* __s) const
+ {
+ return substr(__pos1, __n1).compare(basic_string_view(__s));
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ int compare(size_type __pos1, size_type __n1, const _CharT* __s, size_type __n2) const
+ {
+ return substr(__pos1, __n1).compare(basic_string_view(__s, __n2));
+ }
+
+ // find
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find(basic_string_view __s, size_type __pos = 0) const _NOEXCEPT
+ {
+ _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find(): recieved nullptr");
+ return _VSTD::__str_find<value_type, size_type, traits_type, npos>
+ (data(), size(), __s.data(), __pos, __s.size());
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find(_CharT __c, size_type __pos = 0) const _NOEXCEPT
+ {
+ return _VSTD::__str_find<value_type, size_type, traits_type, npos>
+ (data(), size(), __c, __pos);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find(): recieved nullptr");
+ return _VSTD::__str_find<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, __n);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find(const _CharT* __s, size_type __pos = 0) const
+ {
+ _LIBCPP_ASSERT(__s != nullptr, "string_view::find(): recieved nullptr");
+ return _VSTD::__str_find<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, traits_type::length(__s));
+ }
+
+ // rfind
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type rfind(basic_string_view __s, size_type __pos = npos) const _NOEXCEPT
+ {
+ _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find(): recieved nullptr");
+ return _VSTD::__str_rfind<value_type, size_type, traits_type, npos>
+ (data(), size(), __s.data(), __pos, __s.size());
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type rfind(_CharT __c, size_type __pos = npos) const _NOEXCEPT
+ {
+ return _VSTD::__str_rfind<value_type, size_type, traits_type, npos>
+ (data(), size(), __c, __pos);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type rfind(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::rfind(): recieved nullptr");
+ return _VSTD::__str_rfind<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, __n);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type rfind(const _CharT* __s, size_type __pos=npos) const
+ {
+ _LIBCPP_ASSERT(__s != nullptr, "string_view::rfind(): recieved nullptr");
+ return _VSTD::__str_rfind<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, traits_type::length(__s));
+ }
+
+ // find_first_of
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_first_of(basic_string_view __s, size_type __pos = 0) const _NOEXCEPT
+ {
+ _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_first_of(): recieved nullptr");
+ return _VSTD::__str_find_first_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s.data(), __pos, __s.size());
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_first_of(_CharT __c, size_type __pos = 0) const _NOEXCEPT
+ { return find(__c, __pos); }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_first_of(): recieved nullptr");
+ return _VSTD::__str_find_first_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, __n);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_first_of(const _CharT* __s, size_type __pos=0) const
+ {
+ _LIBCPP_ASSERT(__s != nullptr, "string_view::find_first_of(): recieved nullptr");
+ return _VSTD::__str_find_first_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, traits_type::length(__s));
+ }
+
+ // find_last_of
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_last_of(basic_string_view __s, size_type __pos=npos) const _NOEXCEPT
+ {
+ _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_last_of(): recieved nullptr");
+ return _VSTD::__str_find_last_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s.data(), __pos, __s.size());
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_last_of(_CharT __c, size_type __pos = npos) const _NOEXCEPT
+ { return rfind(__c, __pos); }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_last_of(): recieved nullptr");
+ return _VSTD::__str_find_last_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, __n);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_last_of(const _CharT* __s, size_type __pos=npos) const
+ {
+ _LIBCPP_ASSERT(__s != nullptr, "string_view::find_last_of(): recieved nullptr");
+ return _VSTD::__str_find_last_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, traits_type::length(__s));
+ }
+
+ // find_first_not_of
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_first_not_of(basic_string_view __s, size_type __pos=0) const _NOEXCEPT
+ {
+ _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_first_not_of(): recieved nullptr");
+ return _VSTD::__str_find_first_not_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s.data(), __pos, __s.size());
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_first_not_of(_CharT __c, size_type __pos=0) const _NOEXCEPT
+ {
+ return _VSTD::__str_find_first_not_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __c, __pos);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_first_not_of(): recieved nullptr");
+ return _VSTD::__str_find_first_not_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, __n);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_first_not_of(const _CharT* __s, size_type __pos=0) const
+ {
+ _LIBCPP_ASSERT(__s != nullptr, "string_view::find_first_not_of(): recieved nullptr");
+ return _VSTD::__str_find_first_not_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, traits_type::length(__s));
+ }
+
+ // find_last_not_of
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_last_not_of(basic_string_view __s, size_type __pos=npos) const _NOEXCEPT
+ {
+ _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_last_not_of(): recieved nullptr");
+ return _VSTD::__str_find_last_not_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s.data(), __pos, __s.size());
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_last_not_of(_CharT __c, size_type __pos=npos) const _NOEXCEPT
+ {
+ return _VSTD::__str_find_last_not_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __c, __pos);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_last_not_of(): recieved nullptr");
+ return _VSTD::__str_find_last_not_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, __n);
+ }
+
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ size_type find_last_not_of(const _CharT* __s, size_type __pos=npos) const
+ {
+ _LIBCPP_ASSERT(__s != nullptr, "string_view::find_last_not_of(): recieved nullptr");
+ return _VSTD::__str_find_last_not_of<value_type, size_type, traits_type, npos>
+ (data(), size(), __s, __pos, traits_type::length(__s));
+ }
+
+ private:
+ const value_type* __data;
+ size_type __size;
+ };
+
+
+ // [string.view.comparison]
+ // operator ==
+ template<class _CharT, class _Traits>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator==(basic_string_view<_CharT, _Traits> __lhs,
+ basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+ {
+ if ( __lhs.size() != __rhs.size()) return false;
+ return __lhs.compare(__rhs) == 0;
+ }
+
+ template<class _CharT, class _Traits>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator==(basic_string_view<_CharT, _Traits> __lhs,
+ typename _VSTD::common_type<basic_string_view<_CharT, _Traits> >::type __rhs) _NOEXCEPT
+ {
+ if ( __lhs.size() != __rhs.size()) return false;
+ return __lhs.compare(__rhs) == 0;
+ }
+
+ template<class _CharT, class _Traits>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator==(typename _VSTD::common_type<basic_string_view<_CharT, _Traits> >::type __lhs,
+ basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+ {
+ if ( __lhs.size() != __rhs.size()) return false;
+ return __lhs.compare(__rhs) == 0;
+ }
+
+
+ // operator !=
+ template<class _CharT, class _Traits>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator!=(basic_string_view<_CharT, _Traits> __lhs, basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+ {
+ if ( __lhs.size() != __rhs.size())
+ return true;
+ return __lhs.compare(__rhs) != 0;
+ }
+
+ template<class _CharT, class _Traits>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator!=(basic_string_view<_CharT, _Traits> __lhs,
+ typename _VSTD::common_type<basic_string_view<_CharT, _Traits> >::type __rhs) _NOEXCEPT
+ {
+ if ( __lhs.size() != __rhs.size())
+ return true;
+ return __lhs.compare(__rhs) != 0;
+ }
+
+ template<class _CharT, class _Traits>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator!=(typename _VSTD::common_type<basic_string_view<_CharT, _Traits> >::type __lhs,
+ basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+ {
+ if ( __lhs.size() != __rhs.size())
+ return true;
+ return __lhs.compare(__rhs) != 0;
+ }
+
+
+ // operator <
+ template<class _CharT, class _Traits>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator<(basic_string_view<_CharT, _Traits> __lhs, basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+ {
+ return __lhs.compare(__rhs) < 0;
+ }
+
+ template<class _CharT, class _Traits>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator<(basic_string_view<_CharT, _Traits> __lhs,
+ typename _VSTD::common_type<basic_string_view<_CharT, _Traits> >::type __rhs) _NOEXCEPT
+ {
+ return __lhs.compare(__rhs) < 0;
+ }
+
+ template<class _CharT, class _Traits>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator<(typename _VSTD::common_type<basic_string_view<_CharT, _Traits> >::type __lhs,
+ basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+ {
+ return __lhs.compare(__rhs) < 0;
+ }
+
+
+ // operator >
+ template<class _CharT, class _Traits>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator> (basic_string_view<_CharT, _Traits> __lhs, basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+ {
+ return __lhs.compare(__rhs) > 0;
+ }
+
+ template<class _CharT, class _Traits>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator>(basic_string_view<_CharT, _Traits> __lhs,
+ typename _VSTD::common_type<basic_string_view<_CharT, _Traits> >::type __rhs) _NOEXCEPT
+ {
+ return __lhs.compare(__rhs) > 0;
+ }
+
+ template<class _CharT, class _Traits>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator>(typename _VSTD::common_type<basic_string_view<_CharT, _Traits> >::type __lhs,
+ basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+ {
+ return __lhs.compare(__rhs) > 0;
+ }
+
+
+ // operator <=
+ template<class _CharT, class _Traits>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator<=(basic_string_view<_CharT, _Traits> __lhs, basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+ {
+ return __lhs.compare(__rhs) <= 0;
+ }
+
+ template<class _CharT, class _Traits>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator<=(basic_string_view<_CharT, _Traits> __lhs,
+ typename _VSTD::common_type<basic_string_view<_CharT, _Traits> >::type __rhs) _NOEXCEPT
+ {
+ return __lhs.compare(__rhs) <= 0;
+ }
+
+ template<class _CharT, class _Traits>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator<=(typename _VSTD::common_type<basic_string_view<_CharT, _Traits> >::type __lhs,
+ basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+ {
+ return __lhs.compare(__rhs) <= 0;
+ }
+
+
+ // operator >=
+ template<class _CharT, class _Traits>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator>=(basic_string_view<_CharT, _Traits> __lhs, basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+ {
+ return __lhs.compare(__rhs) >= 0;
+ }
+
+
+ template<class _CharT, class _Traits>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator>=(basic_string_view<_CharT, _Traits> __lhs,
+ typename _VSTD::common_type<basic_string_view<_CharT, _Traits> >::type __rhs) _NOEXCEPT
+ {
+ return __lhs.compare(__rhs) >= 0;
+ }
+
+ template<class _CharT, class _Traits>
+ _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+ bool operator>=(typename _VSTD::common_type<basic_string_view<_CharT, _Traits> >::type __lhs,
+ basic_string_view<_CharT, _Traits> __rhs) _NOEXCEPT
+ {
+ return __lhs.compare(__rhs) >= 0;
+ }
+
+
+ // [string.view.io]
+ template<class _CharT, class _Traits>
+ basic_ostream<_CharT, _Traits>&
+ operator<<(basic_ostream<_CharT, _Traits>& __os, basic_string_view<_CharT, _Traits> __sv)
+ {
+ return _VSTD::__put_character_sequence(__os, __sv.data(), __sv.size());
+ }
+
+ typedef basic_string_view<char> string_view;
+ typedef basic_string_view<char16_t> u16string_view;
+ typedef basic_string_view<char32_t> u32string_view;
+ typedef basic_string_view<wchar_t> wstring_view;
+
+_LIBCPP_END_NAMESPACE_LFTS
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+// [string.view.hash]
+// Shamelessly stolen from <string>
+template<class _CharT, class _Traits>
+struct _LIBCPP_TYPE_VIS_ONLY hash<std::experimental::basic_string_view<_CharT, _Traits> >
+ : public unary_function<std::experimental::basic_string_view<_CharT, _Traits>, size_t>
+{
+ size_t operator()(const std::experimental::basic_string_view<_CharT, _Traits>& __val) const _NOEXCEPT;
+};
+
+template<class _CharT, class _Traits>
+size_t
+hash<std::experimental::basic_string_view<_CharT, _Traits> >::operator()(
+ const std::experimental::basic_string_view<_CharT, _Traits>& __val) const _NOEXCEPT
+{
+ return __do_string_hash(__val.data(), __val.data() + __val.size());
+}
+
+#if _LIBCPP_STD_VER > 11
+template <class _CharT, class _Traits>
+__quoted_output_proxy<_CharT, const _CharT *, _Traits>
+quoted ( std::experimental::basic_string_view <_CharT, _Traits> __sv,
+ _CharT __delim = _CharT('"'), _CharT __escape=_CharT('\\'))
+{
+ return __quoted_output_proxy<_CharT, const _CharT *, _Traits>
+ ( __sv.data(), __sv.data() + __sv.size(), __delim, __escape );
+}
+#endif
+
+_LIBCPP_END_NAMESPACE_STD
+
+#endif // _LIBCPP_LFTS_STRING_VIEW
diff --git a/include/experimental/utility b/include/experimental/utility
new file mode 100644
index 0000000..84e461a
--- /dev/null
+++ b/include/experimental/utility
@@ -0,0 +1,44 @@
+// -*- C++ -*-
+//===-------------------------- utility ----------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_EXPERIMENTAL_UTILITY
+#define _LIBCPP_EXPERIMENTAL_UTILITY
+
+/*
+ experimental/utility synopsis
+
+// C++1y
+
+#include <utility>
+
+namespace std {
+namespace experimental {
+inline namespace fundamentals_v1 {
+
+ 3.1.2, erased-type placeholder
+ struct erased_type { };
+
+} // namespace fundamentals_v1
+} // namespace experimental
+} // namespace std
+
+ */
+
+# include <experimental/__config>
+
+# include <utility>
+
+_LIBCPP_BEGIN_NAMESPACE_LFTS
+
+ struct _LIBCPP_TYPE_VIS_ONLY erased_type { };
+
+_LIBCPP_END_NAMESPACE_LFTS
+
+#endif /* _LIBCPP_EXPERIMENTAL_UTILITY */
diff --git a/include/forward_list b/include/forward_list
index a83b195..651452f 100644
--- a/include/forward_list
+++ b/include/forward_list
@@ -991,7 +991,7 @@
iterator __i = before_begin();
iterator __j = _VSTD::next(__i);
iterator __e = end();
- for (; __j != __e && __f != __l; ++__i, ++__j, ++__f)
+ for (; __j != __e && __f != __l; ++__i, (void) ++__j, ++__f)
*__j = *__f;
if (__j == __e)
insert_after(__i, __f, __l);
@@ -1201,7 +1201,7 @@
try
{
#endif // _LIBCPP_NO_EXCEPTIONS
- for (++__f; __f != __l; ++__f, __last = __last->__next_)
+ for (++__f; __f != __l; ++__f, ((void)(__last = __last->__next_)))
{
__h.reset(__node_traits::allocate(__a, 1));
__node_traits::construct(__a, _VSTD::addressof(__h->__value_), *__f);
@@ -1430,7 +1430,7 @@
iterator __j = _VSTD::next(__i, 2);
for (; __j != __e && *__j == __v; ++__j)
;
- __deleted_nodes.splice_after(__deleted_nodes.before_begin(), *this, __i, __j);
+ __deleted_nodes.splice_after(__deleted_nodes.before_begin(), *this, __i, __j);
if (__j == __e)
break;
__i = __j;
diff --git a/include/future b/include/future
index de00f25..6fe6f8d 100644
--- a/include/future
+++ b/include/future
@@ -374,6 +374,10 @@
#pragma GCC system_header
#endif
+#ifdef _LIBCPP_HAS_NO_THREADS
+#error <future> is not supported on this single threaded system
+#else // !_LIBCPP_HAS_NO_THREADS
+
_LIBCPP_BEGIN_NAMESPACE_STD
//enum class future_errc
@@ -779,9 +783,12 @@
{
if (this->__state_ & base::__constructed)
reinterpret_cast<_Rp*>(_VSTD::addressof(this->__value_))->~_Rp();
- typename _Alloc::template rebind<__assoc_state_alloc>::other __a(__alloc_);
+ typedef typename __allocator_traits_rebind<_Alloc, __assoc_state_alloc>::type _A;
+ typedef allocator_traits<_A> _ATraits;
+ typedef pointer_traits<typename _ATraits::pointer> _PTraits;
+ _A __a(__alloc_);
this->~__assoc_state_alloc();
- __a.deallocate(this, 1);
+ __a.deallocate(_PTraits::pointer_to(*this), 1);
}
template <class _Rp, class _Alloc>
@@ -802,9 +809,12 @@
void
__assoc_state_alloc<_Rp&, _Alloc>::__on_zero_shared() _NOEXCEPT
{
- typename _Alloc::template rebind<__assoc_state_alloc>::other __a(__alloc_);
+ typedef typename __allocator_traits_rebind<_Alloc, __assoc_state_alloc>::type _A;
+ typedef allocator_traits<_A> _ATraits;
+ typedef pointer_traits<typename _ATraits::pointer> _PTraits;
+ _A __a(__alloc_);
this->~__assoc_state_alloc();
- __a.deallocate(this, 1);
+ __a.deallocate(_PTraits::pointer_to(*this), 1);
}
template <class _Alloc>
@@ -825,9 +835,12 @@
void
__assoc_sub_state_alloc<_Alloc>::__on_zero_shared() _NOEXCEPT
{
- typename _Alloc::template rebind<__assoc_sub_state_alloc>::other __a(__alloc_);
+ typedef typename __allocator_traits_rebind<_Alloc, __assoc_sub_state_alloc>::type _A;
+ typedef allocator_traits<_A> _ATraits;
+ typedef pointer_traits<typename _ATraits::pointer> _PTraits;
+ _A __a(__alloc_);
this->~__assoc_sub_state_alloc();
- __a.deallocate(this, 1);
+ __a.deallocate(_PTraits::pointer_to(*this), 1);
}
template <class _Rp, class _Fp>
@@ -1410,12 +1423,13 @@
template <class _Alloc>
promise<_Rp>::promise(allocator_arg_t, const _Alloc& __a0)
{
- typedef typename _Alloc::template rebind<__assoc_state_alloc<_Rp, _Alloc> >::other _A2;
+ typedef __assoc_state_alloc<_Rp, _Alloc> _State;
+ typedef typename __allocator_traits_rebind<_Alloc, _State>::type _A2;
typedef __allocator_destructor<_A2> _D2;
_A2 __a(__a0);
- unique_ptr<__assoc_state_alloc<_Rp, _Alloc>, _D2> __hold(__a.allocate(1), _D2(__a, 1));
- ::new(__hold.get()) __assoc_state_alloc<_Rp, _Alloc>(__a0);
- __state_ = __hold.release();
+ unique_ptr<_State, _D2> __hold(__a.allocate(1), _D2(__a, 1));
+ ::new(static_cast<void*>(_VSTD::addressof(*__hold.get()))) _State(__a0);
+ __state_ = _VSTD::addressof(*__hold.release());
}
template <class _Rp>
@@ -1583,12 +1597,13 @@
template <class _Alloc>
promise<_Rp&>::promise(allocator_arg_t, const _Alloc& __a0)
{
- typedef typename _Alloc::template rebind<__assoc_state_alloc<_Rp&, _Alloc> >::other _A2;
+ typedef __assoc_state_alloc<_Rp&, _Alloc> _State;
+ typedef typename __allocator_traits_rebind<_Alloc, _State>::type _A2;
typedef __allocator_destructor<_A2> _D2;
_A2 __a(__a0);
- unique_ptr<__assoc_state_alloc<_Rp&, _Alloc>, _D2> __hold(__a.allocate(1), _D2(__a, 1));
- ::new(__hold.get()) __assoc_state_alloc<_Rp&, _Alloc>(__a0);
- __state_ = __hold.release();
+ unique_ptr<_State, _D2> __hold(__a.allocate(1), _D2(__a, 1));
+ ::new(static_cast<void*>(_VSTD::addressof(*__hold.get()))) _State(__a0);
+ __state_ = _VSTD::addressof(*__hold.release());
}
template <class _Rp>
@@ -1719,12 +1734,13 @@
template <class _Alloc>
promise<void>::promise(allocator_arg_t, const _Alloc& __a0)
{
- typedef typename _Alloc::template rebind<__assoc_sub_state_alloc<_Alloc> >::other _A2;
+ typedef __assoc_sub_state_alloc<_Alloc> _State;
+ typedef typename __allocator_traits_rebind<_Alloc, _State>::type _A2;
typedef __allocator_destructor<_A2> _D2;
_A2 __a(__a0);
- unique_ptr<__assoc_sub_state_alloc<_Alloc>, _D2> __hold(__a.allocate(1), _D2(__a, 1));
- ::new(__hold.get()) __assoc_sub_state_alloc<_Alloc>(__a0);
- __state_ = __hold.release();
+ unique_ptr<_State, _D2> __hold(__a.allocate(1), _D2(__a, 1));
+ ::new(static_cast<void*>(_VSTD::addressof(*__hold.get()))) _State(__a0);
+ __state_ = _VSTD::addressof(*__hold.release());
}
template <class _Rp>
@@ -1804,10 +1820,12 @@
void
__packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>::destroy_deallocate()
{
- typedef typename _Alloc::template rebind<__packaged_task_func>::other _Ap;
+ typedef typename __allocator_traits_rebind<_Alloc, __packaged_task_func>::type _Ap;
+ typedef allocator_traits<_Ap> _ATraits;
+ typedef pointer_traits<typename _ATraits::pointer> _PTraits;
_Ap __a(__f_.second());
__f_.~__compressed_pair<_Fp, _Alloc>();
- __a.deallocate(this, 1);
+ __a.deallocate(_PTraits::pointer_to(*this), 1);
}
template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
@@ -1896,7 +1914,6 @@
allocator_arg_t, const _Alloc& __a0, _Fp&& __f)
: __f_(nullptr)
{
- typedef allocator_traits<_Alloc> __alloc_traits;
typedef typename remove_reference<typename decay<_Fp>::type>::type _FR;
typedef __packaged_task_func<_FR, _Alloc, _Rp(_ArgTypes...)> _FF;
if (sizeof(_FF) <= sizeof(__buf_))
@@ -1906,18 +1923,13 @@
}
else
{
- typedef typename __alloc_traits::template
-#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
- rebind_alloc<_FF>
-#else
- rebind_alloc<_FF>::other
-#endif
- _Ap;
+ typedef typename __allocator_traits_rebind<_Alloc, _FF>::type _Ap;
_Ap __a(__a0);
typedef __allocator_destructor<_Ap> _Dp;
unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
- ::new (__hold.get()) _FF(_VSTD::forward<_Fp>(__f), _Alloc(__a));
- __f_ = __hold.release();
+ ::new (static_cast<void*>(_VSTD::addressof(*__hold.get())))
+ _FF(_VSTD::forward<_Fp>(__f), _Alloc(__a));
+ __f_ = _VSTD::addressof(*__hold.release());
}
}
@@ -2612,4 +2624,6 @@
_LIBCPP_END_NAMESPACE_STD
+#endif // !_LIBCPP_HAS_NO_THREADS
+
#endif // _LIBCPP_FUTURE
diff --git a/include/ios b/include/ios
index d95f18a..ff79998 100644
--- a/include/ios
+++ b/include/ios
@@ -216,7 +216,7 @@
#include <__locale>
#include <system_error>
-#if __has_feature(cxx_atomic)
+#if __has_feature(cxx_atomic) && !defined(_LIBCPP_HAS_NO_THREADS)
#include <atomic> // for __xindex_
#endif
@@ -367,7 +367,7 @@
int* __index_;
size_t __event_size_;
size_t __event_cap_;
-#if __has_feature(cxx_atomic)
+#if __has_feature(cxx_atomic) && !defined(_LIBCPP_HAS_NO_THREADS)
static atomic<int> __xindex_;
#else
static int __xindex_;
diff --git a/include/istream b/include/istream
index 14fa466..168a4d0 100644
--- a/include/istream
+++ b/include/istream
@@ -82,6 +82,13 @@
pos_type tellg();
basic_istream& seekg(pos_type);
basic_istream& seekg(off_type, ios_base::seekdir);
+protected:
+ basic_istream(const basic_istream& rhs) = delete;
+ basic_istream(basic_istream&& rhs);
+ // 27.7.2.1.2 Assign/swap:
+ basic_istream& operator=(const basic_istream& rhs) = delete;
+ basic_istream& operator=(basic_istream&& rhs);
+ void swap(basic_istream& rhs);
};
// 27.7.1.2.3 character extraction templates:
@@ -184,13 +191,22 @@
_LIBCPP_INLINE_VISIBILITY
basic_istream(basic_istream&& __rhs);
#endif
-
// 27.7.1.1.2 Assign/swap:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
basic_istream& operator=(basic_istream&& __rhs);
#endif
void swap(basic_istream& __rhs);
+
+#if _LIBCPP_STD_VER > 11
+#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
+ basic_istream (const basic_istream& __rhs) = delete;
+ basic_istream& operator=(const basic_istream& __rhs) = delete;
+#else
+ basic_istream (const basic_istream& __rhs); // not defined
+ basic_istream& operator=(const basic_istream& __rhs); // not defined
+#endif
+#endif
public:
// 27.7.1.1.3 Prefix/suffix:
diff --git a/include/iterator b/include/iterator
index f338e01..bcf142a 100644
--- a/include/iterator
+++ b/include/iterator
@@ -324,6 +324,17 @@
template <class C> auto crbegin(const C& c) -> decltype(std::rbegin(c)); // C++14
template <class C> auto crend(const C& c) -> decltype(std::rend(c)); // C++14
+// 24.8, container access:
+template <class C> constexpr auto size(const C& c) -> decltype(c.size()); // C++17
+template <class T, size_t N> constexpr size_t size(const T (&array)[N]) noexcept; // C++17
+template <class C> constexpr auto empty(const C& c) -> decltype(c.empty()); // C++17
+template <class T, size_t N> constexpr bool empty(const T (&array)[N]) noexcept; // C++17
+template <class E> constexpr bool empty(initializer_list<E> il) noexcept; // C++17
+template <class C> constexpr auto data(C& c) -> decltype(c.data()); // C++17
+template <class C> constexpr auto data(const C& c) -> decltype(c.data()); // C++17
+template <class T, size_t N> constexpr T* data(T (&array)[N]) noexcept; // C++17
+template <class E> constexpr const E* data(initializer_list<E> il) noexcept; // C++17
+
} // std
*/
@@ -338,11 +349,7 @@
#include <Availability.h>
#endif
-#ifdef _LIBCPP_DEBUG
-# include <__debug>
-#else
-# define _LIBCPP_ASSERT(x, m) ((void)0)
-#endif
+#include <__debug>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -1572,6 +1579,36 @@
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN)
+#if _LIBCPP_STD_VER > 14
+template <class _C>
+constexpr auto size(const _C& __c) -> decltype(__c.size()) { return __c.size(); }
+
+template <class _Tp, size_t _N>
+constexpr size_t size(const _Tp (&__array)[_N]) noexcept { return _N; }
+
+template <class _C>
+constexpr auto empty(const _C& __c) -> decltype(__c.empty()) { return __c.empty(); }
+
+template <class _Tp, size_t _N>
+constexpr bool empty(const _Tp (&__array)[_N]) noexcept { return false; }
+
+template <class _Ep>
+constexpr bool empty(initializer_list<_Ep> __il) noexcept { return __il.size() == 0; }
+
+template <class _C> constexpr
+auto data(_C& __c) -> decltype(__c.data()) { return __c.data(); }
+
+template <class _C> constexpr
+auto data(const _C& __c) -> decltype(__c.data()) { return __c.data(); }
+
+template <class _Tp, size_t _N>
+constexpr _Tp* data(_Tp (&__array)[_N]) noexcept { return __array; }
+
+template <class _Ep>
+constexpr const _Ep* data(initializer_list<_Ep> __il) noexcept { return __il.begin(); }
+#endif
+
+
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_ITERATOR
diff --git a/include/list b/include/list
index c36786d..13f8a53 100644
--- a/include/list
+++ b/include/list
@@ -179,11 +179,7 @@
#include <__undef_min_max>
-#ifdef _LIBCPP_DEBUG
-# include <__debug>
-#else
-# define _LIBCPP_ASSERT(x, m) ((void)0)
-#endif
+#include <__debug>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
diff --git a/include/locale b/include/locale
index fcff402..0d01002 100644
--- a/include/locale
+++ b/include/locale
@@ -193,6 +193,11 @@
#include <ctime>
#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
#include <support/win32/locale_win32.h>
+#elif defined(_NEWLIB_VERSION)
+// FIXME: replace all the uses of _NEWLIB_VERSION with __NEWLIB__ preceded by an
+// include of <sys/cdefs.h> once https://sourceware.org/ml/newlib-cvs/2014-q3/msg00038.html
+// has had a chance to bake for a bit
+#include <support/newlib/xlocale.h>
#elif !defined(__ANDROID__)
#include <nl_types.h>
#endif
@@ -229,7 +234,8 @@
// OSX has nice foo_l() functions that let you turn off use of the global
// locale. Linux, not so much. The following functions avoid the locale when
// that's possible and otherwise do the wrong thing. FIXME.
-#if defined(__linux__) || defined(__EMSCRIPTEN__) || defined(_AIX)
+#if defined(__linux__) || defined(__EMSCRIPTEN__) || defined(_AIX) || \
+ defined(_NEWLIB_VERSION)
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
decltype(MB_CUR_MAX_L(_VSTD::declval<locale_t>()))
@@ -450,7 +456,7 @@
size_t __n_does_match = 0; // but none of them definitely do
// Initialize all statuses to __might_match, except for "" keywords are __does_match
unsigned char* __st = __status;
- for (_ForwardIterator __ky = __kb; __ky != __ke; ++__ky, ++__st)
+ for (_ForwardIterator __ky = __kb; __ky != __ke; ++__ky, (void) ++__st)
{
if (!__ky->empty())
*__st = __might_match;
@@ -476,7 +482,7 @@
// If the keyword doesn't match this character, then change the keyword
// to doesn't match
__st = __status;
- for (_ForwardIterator __ky = __kb; __ky != __ke; ++__ky, ++__st)
+ for (_ForwardIterator __ky = __kb; __ky != __ke; ++__ky, (void) ++__st)
{
if (*__st == __might_match)
{
@@ -510,7 +516,7 @@
if (__n_might_match + __n_does_match > 1)
{
__st = __status;
- for (_ForwardIterator __ky = __kb; __ky != __ke; ++__ky, ++__st)
+ for (_ForwardIterator __ky = __kb; __ky != __ke; ++__ky, (void) ++__st)
{
if (*__st == __does_match && __ky->size() != __indx+1)
{
@@ -525,7 +531,7 @@
if (__b == __e)
__err |= ios_base::eofbit;
// Return the first matching result
- for (__st = __status; __kb != __ke; ++__kb, ++__st)
+ for (__st = __status; __kb != __ke; ++__kb, (void) ++__st)
if (*__st == __does_match)
break;
if (__kb == __ke)
@@ -1851,7 +1857,7 @@
return 0;
}
int __r = __ct.narrow(__c, 0) - '0';
- for (++__b, --__n; __b != __e && __n > 0; ++__b, --__n)
+ for (++__b, (void) --__n; __b != __e && __n > 0; ++__b, (void) --__n)
{
// get next digit
__c = *__b;
@@ -2964,6 +2970,8 @@
size_t __cur_cap = static_cast<size_t>(__e-__b.get()) * sizeof(_Tp);
size_t __new_cap = __cur_cap < numeric_limits<size_t>::max() / 2 ?
2 * __cur_cap : numeric_limits<size_t>::max();
+ if (__new_cap == 0)
+ __new_cap = sizeof(_Tp);
size_t __n_off = static_cast<size_t>(__n - __b.get());
_Tp* __t = (_Tp*)realloc(__owns ? __b.get() : 0, __new_cap);
if (__t == 0)
@@ -3673,7 +3681,7 @@
typename messages<_CharT>::catalog
messages<_CharT>::do_open(const basic_string<char>& __nm, const locale&) const
{
-#if defined(_WIN32) || defined(__ANDROID__)
+#if defined(_WIN32) || defined(__ANDROID__) || defined(_NEWLIB_VERSION)
return -1;
#else // _WIN32 || __ANDROID__
catalog __cat = (catalog)catopen(__nm.c_str(), NL_CAT_LOCALE);
@@ -3688,7 +3696,7 @@
messages<_CharT>::do_get(catalog __c, int __set, int __msgid,
const string_type& __dflt) const
{
-#if defined(_WIN32) || defined(__ANDROID__)
+#if defined(_WIN32) || defined(__ANDROID__) || defined(_NEWLIB_VERSION)
return __dflt;
#else // _WIN32
string __ndflt;
@@ -3710,7 +3718,7 @@
void
messages<_CharT>::do_close(catalog __c) const
{
-#if !defined(_WIN32) && !defined(__ANDROID__)
+#if !defined(_WIN32) && !defined(__ANDROID__) && !defined(_NEWLIB_VERSION)
if (__c != -1)
__c <<= 1;
nl_catd __cat = (nl_catd)__c;
diff --git a/include/memory b/include/memory
index dc9aeba..662faa0 100644
--- a/include/memory
+++ b/include/memory
@@ -610,7 +610,7 @@
#include <cassert>
#endif
-#if __has_feature(cxx_atomic)
+#if __has_feature(cxx_atomic) && !defined(_LIBCPP_HAS_NO_THREADS)
# include <atomic>
#endif
@@ -1450,7 +1450,7 @@
template <class _Tp, class... _Args>
_LIBCPP_INLINE_VISIBILITY
static void construct(allocator_type& __a, _Tp* __p, _Args&&... __args)
- {__construct(__has_construct<allocator_type, pointer, _Args...>(),
+ {__construct(__has_construct<allocator_type, _Tp*, _Args...>(),
__a, __p, _VSTD::forward<_Args>(__args)...);}
#else // _LIBCPP_HAS_NO_VARIADICS
template <class _Tp>
@@ -3660,7 +3660,7 @@
const void*
__shared_ptr_pointer<_Tp, _Dp, _Alloc>::__get_deleter(const type_info& __t) const _NOEXCEPT
{
- return __t == typeid(_Dp) ? &__data_.first().second() : 0;
+ return __t == typeid(_Dp) ? _VSTD::addressof(__data_.first().second()) : 0;
}
#endif // _LIBCPP_NO_RTTI
@@ -3677,9 +3677,13 @@
void
__shared_ptr_pointer<_Tp, _Dp, _Alloc>::__on_zero_shared_weak() _NOEXCEPT
{
- typename _Alloc::template rebind<__shared_ptr_pointer>::other __a(__data_.second());
+ typedef typename __allocator_traits_rebind<_Alloc, __shared_ptr_pointer>::type _A;
+ typedef allocator_traits<_A> _ATraits;
+ typedef pointer_traits<typename _ATraits::pointer> _PTraits;
+
+ _A __a(__data_.second());
__data_.second().~_Alloc();
- __a.deallocate(this, 1);
+ __a.deallocate(_PTraits::pointer_to(*this), 1);
}
template <class _Tp, class _Alloc>
@@ -3742,9 +3746,12 @@
void
__shared_ptr_emplace<_Tp, _Alloc>::__on_zero_shared_weak() _NOEXCEPT
{
- typename _Alloc::template rebind<__shared_ptr_emplace>::other __a(__data_.first());
+ typedef typename __allocator_traits_rebind<_Alloc, __shared_ptr_emplace>::type _A;
+ typedef allocator_traits<_A> _ATraits;
+ typedef pointer_traits<typename _ATraits::pointer> _PTraits;
+ _A __a(__data_.first());
__data_.first().~_Alloc();
- __a.deallocate(this, 1);
+ __a.deallocate(_PTraits::pointer_to(*this), 1);
}
template<class _Tp> class _LIBCPP_TYPE_VIS_ONLY enable_shared_from_this;
@@ -4090,12 +4097,13 @@
{
#endif // _LIBCPP_NO_EXCEPTIONS
typedef __shared_ptr_pointer<_Yp*, _Dp, _Alloc> _CntrlBlk;
- typedef typename _Alloc::template rebind<_CntrlBlk>::other _A2;
+ typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _A2;
typedef __allocator_destructor<_A2> _D2;
_A2 __a2(__a);
unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));
- ::new(__hold2.get()) _CntrlBlk(__p, __d, __a);
- __cntrl_ = __hold2.release();
+ ::new(static_cast<void*>(_VSTD::addressof(*__hold2.get())))
+ _CntrlBlk(__p, __d, __a);
+ __cntrl_ = _VSTD::addressof(*__hold2.release());
__enable_weak_this(__p);
#ifndef _LIBCPP_NO_EXCEPTIONS
}
@@ -4117,12 +4125,13 @@
{
#endif // _LIBCPP_NO_EXCEPTIONS
typedef __shared_ptr_pointer<nullptr_t, _Dp, _Alloc> _CntrlBlk;
- typedef typename _Alloc::template rebind<_CntrlBlk>::other _A2;
+ typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _A2;
typedef __allocator_destructor<_A2> _D2;
_A2 __a2(__a);
unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));
- ::new(__hold2.get()) _CntrlBlk(__p, __d, __a);
- __cntrl_ = __hold2.release();
+ ::new(static_cast<void*>(_VSTD::addressof(*__hold2.get())))
+ _CntrlBlk(__p, __d, __a);
+ __cntrl_ = _VSTD::addressof(*__hold2.release());
#ifndef _LIBCPP_NO_EXCEPTIONS
}
catch (...)
@@ -4282,14 +4291,15 @@
shared_ptr<_Tp>::allocate_shared(const _Alloc& __a, _Args&& ...__args)
{
typedef __shared_ptr_emplace<_Tp, _Alloc> _CntrlBlk;
- typedef typename _Alloc::template rebind<_CntrlBlk>::other _A2;
+ typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _A2;
typedef __allocator_destructor<_A2> _D2;
_A2 __a2(__a);
unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));
- ::new(__hold2.get()) _CntrlBlk(__a, _VSTD::forward<_Args>(__args)...);
+ ::new(static_cast<void*>(_VSTD::addressof(*__hold2.get())))
+ _CntrlBlk(__a, _VSTD::forward<_Args>(__args)...);
shared_ptr<_Tp> __r;
__r.__ptr_ = __hold2.get()->get();
- __r.__cntrl_ = __hold2.release();
+ __r.__cntrl_ = _VSTD::addressof(*__hold2.release());
__r.__enable_weak_this(__r.__ptr_);
return __r;
}
@@ -4373,14 +4383,15 @@
shared_ptr<_Tp>::allocate_shared(const _Alloc& __a)
{
typedef __shared_ptr_emplace<_Tp, _Alloc> _CntrlBlk;
- typedef typename _Alloc::template rebind<_CntrlBlk>::other _Alloc2;
+ typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _Alloc2;
typedef __allocator_destructor<_Alloc2> _D2;
_Alloc2 __alloc2(__a);
unique_ptr<_CntrlBlk, _D2> __hold2(__alloc2.allocate(1), _D2(__alloc2, 1));
- ::new(__hold2.get()) _CntrlBlk(__a);
+ ::new(static_cast<void*>(_VSTD::addressof(*__hold2.get())))
+ _CntrlBlk(__a);
shared_ptr<_Tp> __r;
__r.__ptr_ = __hold2.get()->get();
- __r.__cntrl_ = __hold2.release();
+ __r.__cntrl_ = _VSTD::addressof(*__hold2.release());
__r.__enable_weak_this(__r.__ptr_);
return __r;
}
@@ -4391,14 +4402,15 @@
shared_ptr<_Tp>::allocate_shared(const _Alloc& __a, _A0& __a0)
{
typedef __shared_ptr_emplace<_Tp, _Alloc> _CntrlBlk;
- typedef typename _Alloc::template rebind<_CntrlBlk>::other _Alloc2;
+ typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _Alloc2;
typedef __allocator_destructor<_Alloc2> _D2;
_Alloc2 __alloc2(__a);
unique_ptr<_CntrlBlk, _D2> __hold2(__alloc2.allocate(1), _D2(__alloc2, 1));
- ::new(__hold2.get()) _CntrlBlk(__a, __a0);
+ ::new(static_cast<void*>(_VSTD::addressof(*__hold2.get())))
+ _CntrlBlk(__a, __a0);
shared_ptr<_Tp> __r;
__r.__ptr_ = __hold2.get()->get();
- __r.__cntrl_ = __hold2.release();
+ __r.__cntrl_ = _VSTD::addressof(*__hold2.release());
__r.__enable_weak_this(__r.__ptr_);
return __r;
}
@@ -4409,14 +4421,15 @@
shared_ptr<_Tp>::allocate_shared(const _Alloc& __a, _A0& __a0, _A1& __a1)
{
typedef __shared_ptr_emplace<_Tp, _Alloc> _CntrlBlk;
- typedef typename _Alloc::template rebind<_CntrlBlk>::other _Alloc2;
+ typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _Alloc2;
typedef __allocator_destructor<_Alloc2> _D2;
_Alloc2 __alloc2(__a);
unique_ptr<_CntrlBlk, _D2> __hold2(__alloc2.allocate(1), _D2(__alloc2, 1));
- ::new(__hold2.get()) _CntrlBlk(__a, __a0, __a1);
+ ::new(static_cast<void*>(_VSTD::addressof(*__hold2.get())))
+ _CntrlBlk(__a, __a0, __a1);
shared_ptr<_Tp> __r;
__r.__ptr_ = __hold2.get()->get();
- __r.__cntrl_ = __hold2.release();
+ __r.__cntrl_ = _VSTD::addressof(*__hold2.release());
__r.__enable_weak_this(__r.__ptr_);
return __r;
}
@@ -4427,14 +4440,15 @@
shared_ptr<_Tp>::allocate_shared(const _Alloc& __a, _A0& __a0, _A1& __a1, _A2& __a2)
{
typedef __shared_ptr_emplace<_Tp, _Alloc> _CntrlBlk;
- typedef typename _Alloc::template rebind<_CntrlBlk>::other _Alloc2;
+ typedef typename __allocator_traits_rebind<_Alloc, _CntrlBlk>::type _Alloc2;
typedef __allocator_destructor<_Alloc2> _D2;
_Alloc2 __alloc2(__a);
unique_ptr<_CntrlBlk, _D2> __hold2(__alloc2.allocate(1), _D2(__alloc2, 1));
- ::new(__hold2.get()) _CntrlBlk(__a, __a0, __a1, __a2);
+ ::new(static_cast<void*>(_VSTD::addressof(*__hold2.get())))
+ _CntrlBlk(__a, __a0, __a1, __a2);
shared_ptr<_Tp> __r;
__r.__ptr_ = __hold2.get()->get();
- __r.__cntrl_ = __hold2.release();
+ __r.__cntrl_ = _VSTD::addressof(*__hold2.release());
__r.__enable_weak_this(__r.__ptr_);
return __r;
}
@@ -5262,7 +5276,7 @@
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p);
-#if __has_feature(cxx_atomic)
+#if __has_feature(cxx_atomic) && !defined(_LIBCPP_HAS_NO_THREADS)
class _LIBCPP_TYPE_VIS __sp_mut
{
@@ -5388,7 +5402,7 @@
return atomic_compare_exchange_weak(__p, __v, __w);
}
-#endif // __has_feature(cxx_atomic)
+#endif // __has_feature(cxx_atomic) && !defined(_LIBCPP_HAS_NO_THREADS)
//enum class
struct _LIBCPP_TYPE_VIS pointer_safety
diff --git a/include/module.modulemap b/include/module.modulemap
index a0f4254..6aeb23f 100644
--- a/include/module.modulemap
+++ b/include/module.modulemap
@@ -16,6 +16,7 @@
module atomic {
header "atomic"
export *
+ requires cplusplus11
}
module bitset {
header "bitset"
diff --git a/include/mutex b/include/mutex
index 5dfba63..9c26356 100644
--- a/include/mutex
+++ b/include/mutex
@@ -187,6 +187,8 @@
_LIBCPP_BEGIN_NAMESPACE_STD
+#ifndef _LIBCPP_HAS_NO_THREADS
+
class _LIBCPP_TYPE_VIS recursive_mutex
{
pthread_mutex_t __m_;
@@ -425,6 +427,8 @@
#endif // _LIBCPP_HAS_NO_VARIADICS
+#endif // !_LIBCPP_HAS_NO_THREADS
+
struct _LIBCPP_TYPE_VIS_ONLY once_flag;
#ifndef _LIBCPP_HAS_NO_VARIADICS
diff --git a/include/numeric b/include/numeric
index e520c8e..21c3781 100644
--- a/include/numeric
+++ b/include/numeric
@@ -91,7 +91,7 @@
_Tp
inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _Tp __init)
{
- for (; __first1 != __last1; ++__first1, ++__first2)
+ for (; __first1 != __last1; ++__first1, (void) ++__first2)
__init = __init + *__first1 * *__first2;
return __init;
}
@@ -102,7 +102,7 @@
inner_product(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2,
_Tp __init, _BinaryOperation1 __binary_op1, _BinaryOperation2 __binary_op2)
{
- for (; __first1 != __last1; ++__first1, ++__first2)
+ for (; __first1 != __last1; ++__first1, (void) ++__first2)
__init = __binary_op1(__init, __binary_op2(*__first1, *__first2));
return __init;
}
@@ -116,7 +116,7 @@
{
typename iterator_traits<_InputIterator>::value_type __t(*__first);
*__result = __t;
- for (++__first, ++__result; __first != __last; ++__first, ++__result)
+ for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)
{
__t = __t + *__first;
*__result = __t;
@@ -135,7 +135,7 @@
{
typename iterator_traits<_InputIterator>::value_type __t(*__first);
*__result = __t;
- for (++__first, ++__result; __first != __last; ++__first, ++__result)
+ for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)
{
__t = __binary_op(__t, *__first);
*__result = __t;
@@ -153,7 +153,7 @@
{
typename iterator_traits<_InputIterator>::value_type __t1(*__first);
*__result = __t1;
- for (++__first, ++__result; __first != __last; ++__first, ++__result)
+ for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)
{
typename iterator_traits<_InputIterator>::value_type __t2(*__first);
*__result = __t2 - __t1;
@@ -173,7 +173,7 @@
{
typename iterator_traits<_InputIterator>::value_type __t1(*__first);
*__result = __t1;
- for (++__first, ++__result; __first != __last; ++__first, ++__result)
+ for (++__first, (void) ++__result; __first != __last; ++__first, (void) ++__result)
{
typename iterator_traits<_InputIterator>::value_type __t2(*__first);
*__result = __binary_op(__t2, __t1);
@@ -188,7 +188,7 @@
void
iota(_ForwardIterator __first, _ForwardIterator __last, _Tp __value_)
{
- for (; __first != __last; ++__first, ++__value_)
+ for (; __first != __last; ++__first, (void) ++__value_)
*__first = __value_;
}
diff --git a/include/ostream b/include/ostream
index 9d96fd8..a7af299 100644
--- a/include/ostream
+++ b/include/ostream
@@ -67,6 +67,13 @@
pos_type tellp();
basic_ostream& seekp(pos_type);
basic_ostream& seekp(off_type, ios_base::seekdir);
+protected:
+ basic_ostream(const basic_ostream& rhs) = delete;
+ basic_ostream(basic_ostream&& rhs);
+ // 27.7.3.3 Assign/swap
+ basic_ostream& operator=(basic_ostream& rhs) = delete;
+ basic_ostream& operator=(const basic_ostream&& rhs);
+ void swap(basic_ostream& rhs);
};
// 27.7.2.6.4 character inserters
@@ -162,14 +169,19 @@
#endif
// 27.7.2.3 Assign/swap
-#if _LIBCPP_STD_VER > 11
- basic_ostream& operator=(const basic_ostream&) = delete;
-#endif
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
basic_ostream& operator=(basic_ostream&& __rhs);
#endif
void swap(basic_ostream& __rhs);
+
+#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
+ basic_ostream (const basic_ostream& __rhs) = delete;
+ basic_ostream& operator=(const basic_ostream& __rhs) = delete;
+#else
+ basic_ostream (const basic_ostream& __rhs); // not defined
+ basic_ostream& operator=(const basic_ostream& __rhs); // not defined
+#endif
public:
// 27.7.2.4 Prefix/suffix:
diff --git a/include/random b/include/random
index c0db1ab..e7053ce 100644
--- a/include/random
+++ b/include/random
@@ -4009,6 +4009,8 @@
}
}
+// Reference: Kemp, C.D. (1986). `A modal method for generating binomial
+// variables', Commun. Statist. - Theor. Meth. 15(3), 805-813.
template<class _IntType>
template<class _URNG>
_IntType
@@ -4035,7 +4037,8 @@
if (__u < 0)
return __rd - 1;
}
- --__rd;
+ if ( __rd != 0 )
+ --__rd;
++__ru;
if (__ru <= __pr.__t_)
{
diff --git a/include/shared_mutex b/include/shared_mutex
index 00f816d..9b7f0bf 100644
--- a/include/shared_mutex
+++ b/include/shared_mutex
@@ -112,6 +112,10 @@
#pragma GCC system_header
#endif
+#ifdef _LIBCPP_HAS_NO_THREADS
+#error <shared_mutex> is not supported on this single threaded system
+#else // !_LIBCPP_HAS_NO_THREADS
+
_LIBCPP_BEGIN_NAMESPACE_STD
class _LIBCPP_TYPE_VIS shared_timed_mutex
@@ -414,6 +418,8 @@
_LIBCPP_END_NAMESPACE_STD
+#endif // !_LIBCPP_HAS_NO_THREADS
+
#endif // _LIBCPP_STD_VER > 11
#endif // _LIBCPP_SHARED_MUTEX
diff --git a/include/sstream b/include/sstream
index f90d446..27ae78f 100644
--- a/include/sstream
+++ b/include/sstream
@@ -325,11 +325,16 @@
__p = const_cast<char_type*>(__str_.data());
if (__binp != -1)
this->setg(__p + __binp, __p + __ninp, __p + __einp);
+ else
+ this->setg(nullptr, nullptr, nullptr);
if (__bout != -1)
{
this->setp(__p + __bout, __p + __eout);
this->pbump(__nout);
}
+ else
+ this->setp(nullptr, nullptr);
+
__hm_ = __hm == -1 ? nullptr : __p + __hm;
__mode_ = __rhs.__mode_;
__p = const_cast<char_type*>(__rhs.__str_.data());
diff --git a/include/string b/include/string
index cb30d04..fe42bbf 100644
--- a/include/string
+++ b/include/string
@@ -453,6 +453,8 @@
#include <__undef_min_max>
+#include <__debug>
+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
@@ -507,14 +509,11 @@
typedef streampos pos_type;
typedef mbstate_t state_type;
- _LIBCPP_INLINE_VISIBILITY
- static void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
+ static inline void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
{__c1 = __c2;}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
{return __c1 == __c2;}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
{return __c1 < __c2;}
static int compare(const char_type* __s1, const char_type* __s2, size_t __n);
@@ -524,20 +523,15 @@
static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n);
static char_type* assign(char_type* __s, size_t __n, char_type __a);
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
{return eq_int_type(__c, eof()) ? ~eof() : __c;}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
{return char_type(__c);}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
{return int_type(__c);}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
{return __c1 == __c2;}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
{return int_type(EOF);}
};
@@ -634,51 +628,37 @@
typedef streampos pos_type;
typedef mbstate_t state_type;
- _LIBCPP_INLINE_VISIBILITY
- static void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
+ static inline void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
{__c1 = __c2;}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
{return __c1 == __c2;}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
{return (unsigned char)__c1 < (unsigned char)__c2;}
- _LIBCPP_INLINE_VISIBILITY
- static int compare(const char_type* __s1, const char_type* __s2, size_t __n)
+ static inline int compare(const char_type* __s1, const char_type* __s2, size_t __n)
{return memcmp(__s1, __s2, __n);}
- _LIBCPP_INLINE_VISIBILITY
- static size_t length(const char_type* __s) {return strlen(__s);}
- _LIBCPP_INLINE_VISIBILITY
- static const char_type* find(const char_type* __s, size_t __n, const char_type& __a)
+ static inline size_t length(const char_type* __s) {return strlen(__s);}
+ static inline const char_type* find(const char_type* __s, size_t __n, const char_type& __a)
{return (const char_type*)memchr(__s, to_int_type(__a), __n);}
- _LIBCPP_INLINE_VISIBILITY
- static char_type* move(char_type* __s1, const char_type* __s2, size_t __n)
+ static inline char_type* move(char_type* __s1, const char_type* __s2, size_t __n)
{return (char_type*)memmove(__s1, __s2, __n);}
- _LIBCPP_INLINE_VISIBILITY
- static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n)
+ static inline char_type* copy(char_type* __s1, const char_type* __s2, size_t __n)
{
_LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
return (char_type*)memcpy(__s1, __s2, __n);
}
- _LIBCPP_INLINE_VISIBILITY
- static char_type* assign(char_type* __s, size_t __n, char_type __a)
+ static inline char_type* assign(char_type* __s, size_t __n, char_type __a)
{return (char_type*)memset(__s, to_int_type(__a), __n);}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
{return eq_int_type(__c, eof()) ? ~eof() : __c;}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
{return char_type(__c);}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
{return int_type((unsigned char)__c);}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
{return __c1 == __c2;}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
{return int_type(EOF);}
};
@@ -693,52 +673,38 @@
typedef streampos pos_type;
typedef mbstate_t state_type;
- _LIBCPP_INLINE_VISIBILITY
- static void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
+ static inline void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
{__c1 = __c2;}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
{return __c1 == __c2;}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
{return __c1 < __c2;}
- _LIBCPP_INLINE_VISIBILITY
- static int compare(const char_type* __s1, const char_type* __s2, size_t __n)
+ static inline int compare(const char_type* __s1, const char_type* __s2, size_t __n)
{return wmemcmp(__s1, __s2, __n);}
- _LIBCPP_INLINE_VISIBILITY
- static size_t length(const char_type* __s)
+ static inline size_t length(const char_type* __s)
{return wcslen(__s);}
- _LIBCPP_INLINE_VISIBILITY
- static const char_type* find(const char_type* __s, size_t __n, const char_type& __a)
+ static inline const char_type* find(const char_type* __s, size_t __n, const char_type& __a)
{return (const char_type*)wmemchr(__s, __a, __n);}
- _LIBCPP_INLINE_VISIBILITY
- static char_type* move(char_type* __s1, const char_type* __s2, size_t __n)
+ static inline char_type* move(char_type* __s1, const char_type* __s2, size_t __n)
{return (char_type*)wmemmove(__s1, __s2, __n);}
- _LIBCPP_INLINE_VISIBILITY
- static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n)
+ static inline char_type* copy(char_type* __s1, const char_type* __s2, size_t __n)
{
_LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
return (char_type*)wmemcpy(__s1, __s2, __n);
}
- _LIBCPP_INLINE_VISIBILITY
- static char_type* assign(char_type* __s, size_t __n, char_type __a)
+ static inline char_type* assign(char_type* __s, size_t __n, char_type __a)
{return (char_type*)wmemset(__s, __a, __n);}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
{return eq_int_type(__c, eof()) ? ~eof() : __c;}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
{return char_type(__c);}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
{return int_type(__c);}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
{return __c1 == __c2;}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
{return int_type(WEOF);}
};
@@ -753,14 +719,11 @@
typedef u16streampos pos_type;
typedef mbstate_t state_type;
- _LIBCPP_INLINE_VISIBILITY
- static void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
+ static inline void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
{__c1 = __c2;}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
{return __c1 == __c2;}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
{return __c1 < __c2;}
static int compare(const char_type* __s1, const char_type* __s2, size_t __n);
@@ -770,20 +733,15 @@
static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n);
static char_type* assign(char_type* __s, size_t __n, char_type __a);
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
{return eq_int_type(__c, eof()) ? ~eof() : __c;}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
{return char_type(__c);}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
{return int_type(__c);}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
{return __c1 == __c2;}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
{return int_type(0xDFFF);}
};
@@ -874,14 +832,11 @@
typedef u32streampos pos_type;
typedef mbstate_t state_type;
- _LIBCPP_INLINE_VISIBILITY
- static void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
+ static inline void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
{__c1 = __c2;}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
{return __c1 == __c2;}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
{return __c1 < __c2;}
static int compare(const char_type* __s1, const char_type* __s2, size_t __n);
@@ -891,20 +846,15 @@
static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n);
static char_type* assign(char_type* __s, size_t __n, char_type __a);
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR int_type not_eof(int_type __c) _NOEXCEPT
{return eq_int_type(__c, eof()) ? ~eof() : __c;}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
{return char_type(__c);}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
{return int_type(__c);}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
{return __c1 == __c2;}
- _LIBCPP_INLINE_VISIBILITY
- static _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
+ static inline _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
{return int_type(0xFFFFFFFF);}
};
@@ -990,10 +940,10 @@
// helper fns for basic_string
-// __find
+// __str_find
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__find(const _CharT *__p, _SizeT __sz,
+__str_find(const _CharT *__p, _SizeT __sz,
_CharT __c, _SizeT __pos) _NOEXCEPT
{
if (__pos >= __sz)
@@ -1006,28 +956,28 @@
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__find(const _CharT *__p, _SizeT __sz,
+__str_find(const _CharT *__p, _SizeT __sz,
const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
{
if (__pos > __sz || __sz - __pos < __n)
return __npos;
if (__n == 0)
return __pos;
-// if (__n == 1)
-// return _VSTD::__find<_CharT, _SizeT, _Traits, __npos>(__p, __sz, *__s, __pos);
const _CharT* __r =
- _VSTD::search(__p + __pos, __p + __sz, __s, __s + __n, _Traits::eq);
+ _VSTD::__search(__p + __pos, __p + __sz,
+ __s, __s + __n, _Traits::eq,
+ random_access_iterator_tag(), random_access_iterator_tag());
if (__r == __p + __sz)
return __npos;
return static_cast<_SizeT>(__r - __p);
}
-// __rfind
+// __str_rfind
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__rfind(const _CharT *__p, _SizeT __sz,
+__str_rfind(const _CharT *__p, _SizeT __sz,
_CharT __c, _SizeT __pos) _NOEXCEPT
{
if (__sz < 1)
@@ -1046,7 +996,7 @@
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__rfind(const _CharT *__p, _SizeT __sz,
+__str_rfind(const _CharT *__p, _SizeT __sz,
const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
{
__pos = _VSTD::min(__pos, __sz);
@@ -1054,21 +1004,23 @@
__pos += __n;
else
__pos = __sz;
- const _CharT* __r = _VSTD::find_end(__p, __p + __pos, __s, __s + __n, _Traits::eq);
+ const _CharT* __r = _VSTD::__find_end(
+ __p, __p + __pos, __s, __s + __n, _Traits::eq,
+ random_access_iterator_tag(), random_access_iterator_tag());
if (__n > 0 && __r == __p + __pos)
return __npos;
return static_cast<_SizeT>(__r - __p);
}
-// __find_first_of
+// __str_find_first_of
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__find_first_of(const _CharT *__p, _SizeT __sz,
+__str_find_first_of(const _CharT *__p, _SizeT __sz,
const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
{
if (__pos >= __sz || __n == 0)
return __npos;
- const _CharT* __r = _VSTD::find_first_of
+ const _CharT* __r = _VSTD::__find_first_of_ce
(__p + __pos, __p + __sz, __s, __s + __n, _Traits::eq );
if (__r == __p + __sz)
return __npos;
@@ -1076,10 +1028,10 @@
}
-// __find_last_of
+// __str_find_last_of
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__find_last_of(const _CharT *__p, _SizeT __sz,
+__str_find_last_of(const _CharT *__p, _SizeT __sz,
const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
{
if (__n != 0)
@@ -1099,10 +1051,10 @@
}
-// __find_first_not_of
+// __str_find_first_not_of
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__find_first_not_of(const _CharT *__p, _SizeT __sz,
+__str_find_first_not_of(const _CharT *__p, _SizeT __sz,
const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
{
if (__pos < __sz)
@@ -1118,7 +1070,7 @@
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__find_first_not_of(const _CharT *__p, _SizeT __sz,
+__str_find_first_not_of(const _CharT *__p, _SizeT __sz,
_CharT __c, _SizeT __pos) _NOEXCEPT
{
if (__pos < __sz)
@@ -1132,10 +1084,10 @@
}
-// __find_last_not_of
+// __str_find_last_not_of
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__find_last_not_of(const _CharT *__p, _SizeT __sz,
+__str_find_last_not_of(const _CharT *__p, _SizeT __sz,
const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
{
if (__pos < __sz)
@@ -1151,7 +1103,7 @@
template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
_SizeT _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
-__find_last_not_of(const _CharT *__p, _SizeT __sz,
+__str_find_last_not_of(const _CharT *__p, _SizeT __sz,
_CharT __c, _SizeT __pos) _NOEXCEPT
{
if (__pos < __sz)
@@ -2263,7 +2215,7 @@
__set_long_cap(__cap+1);
__set_long_size(__sz);
}
- for (; __first != __last; ++__first, ++__p)
+ for (; __first != __last; ++__first, (void) ++__p)
traits_type::assign(*__p, *__first);
traits_type::assign(*__p, value_type());
}
@@ -3429,7 +3381,7 @@
size_type __n) const _NOEXCEPT
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::find(): received nullptr");
- return _VSTD::__find<value_type, size_type, traits_type, npos>
+ return _VSTD::__str_find<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -3439,7 +3391,7 @@
basic_string<_CharT, _Traits, _Allocator>::find(const basic_string& __str,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__find<value_type, size_type, traits_type, npos>
+ return _VSTD::__str_find<value_type, size_type, traits_type, npos>
(data(), size(), __str.data(), __pos, __str.size());
}
@@ -3450,7 +3402,7 @@
size_type __pos) const _NOEXCEPT
{
_LIBCPP_ASSERT(__s != nullptr, "string::find(): received nullptr");
- return _VSTD::__find<value_type, size_type, traits_type, npos>
+ return _VSTD::__str_find<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -3459,7 +3411,7 @@
basic_string<_CharT, _Traits, _Allocator>::find(value_type __c,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__find<value_type, size_type, traits_type, npos>
+ return _VSTD::__str_find<value_type, size_type, traits_type, npos>
(data(), size(), __c, __pos);
}
@@ -3472,7 +3424,7 @@
size_type __n) const _NOEXCEPT
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::rfind(): received nullptr");
- return _VSTD::__rfind<value_type, size_type, traits_type, npos>
+ return _VSTD::__str_rfind<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -3482,7 +3434,7 @@
basic_string<_CharT, _Traits, _Allocator>::rfind(const basic_string& __str,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__rfind<value_type, size_type, traits_type, npos>
+ return _VSTD::__str_rfind<value_type, size_type, traits_type, npos>
(data(), size(), __str.data(), __pos, __str.size());
}
@@ -3493,7 +3445,7 @@
size_type __pos) const _NOEXCEPT
{
_LIBCPP_ASSERT(__s != nullptr, "string::rfind(): received nullptr");
- return _VSTD::__rfind<value_type, size_type, traits_type, npos>
+ return _VSTD::__str_rfind<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -3502,7 +3454,7 @@
basic_string<_CharT, _Traits, _Allocator>::rfind(value_type __c,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__rfind<value_type, size_type, traits_type, npos>
+ return _VSTD::__str_rfind<value_type, size_type, traits_type, npos>
(data(), size(), __c, __pos);
}
@@ -3515,7 +3467,7 @@
size_type __n) const _NOEXCEPT
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::find_first_of(): received nullptr");
- return _VSTD::__find_first_of<value_type, size_type, traits_type, npos>
+ return _VSTD::__str_find_first_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -3525,7 +3477,7 @@
basic_string<_CharT, _Traits, _Allocator>::find_first_of(const basic_string& __str,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__find_first_of<value_type, size_type, traits_type, npos>
+ return _VSTD::__str_find_first_of<value_type, size_type, traits_type, npos>
(data(), size(), __str.data(), __pos, __str.size());
}
@@ -3536,7 +3488,7 @@
size_type __pos) const _NOEXCEPT
{
_LIBCPP_ASSERT(__s != nullptr, "string::find_first_of(): received nullptr");
- return _VSTD::__find_first_of<value_type, size_type, traits_type, npos>
+ return _VSTD::__str_find_first_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -3558,7 +3510,7 @@
size_type __n) const _NOEXCEPT
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::find_last_of(): received nullptr");
- return _VSTD::__find_last_of<value_type, size_type, traits_type, npos>
+ return _VSTD::__str_find_last_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -3568,7 +3520,7 @@
basic_string<_CharT, _Traits, _Allocator>::find_last_of(const basic_string& __str,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__find_last_of<value_type, size_type, traits_type, npos>
+ return _VSTD::__str_find_last_of<value_type, size_type, traits_type, npos>
(data(), size(), __str.data(), __pos, __str.size());
}
@@ -3579,7 +3531,7 @@
size_type __pos) const _NOEXCEPT
{
_LIBCPP_ASSERT(__s != nullptr, "string::find_last_of(): received nullptr");
- return _VSTD::__find_last_of<value_type, size_type, traits_type, npos>
+ return _VSTD::__str_find_last_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -3601,7 +3553,7 @@
size_type __n) const _NOEXCEPT
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::find_first_not_of(): received nullptr");
- return _VSTD::__find_first_not_of<value_type, size_type, traits_type, npos>
+ return _VSTD::__str_find_first_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -3611,7 +3563,7 @@
basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(const basic_string& __str,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__find_first_not_of<value_type, size_type, traits_type, npos>
+ return _VSTD::__str_find_first_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __str.data(), __pos, __str.size());
}
@@ -3622,7 +3574,7 @@
size_type __pos) const _NOEXCEPT
{
_LIBCPP_ASSERT(__s != nullptr, "string::find_first_not_of(): received nullptr");
- return _VSTD::__find_first_not_of<value_type, size_type, traits_type, npos>
+ return _VSTD::__str_find_first_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -3632,7 +3584,7 @@
basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(value_type __c,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__find_first_not_of<value_type, size_type, traits_type, npos>
+ return _VSTD::__str_find_first_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __c, __pos);
}
@@ -3645,7 +3597,7 @@
size_type __n) const _NOEXCEPT
{
_LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::find_last_not_of(): received nullptr");
- return _VSTD::__find_last_not_of<value_type, size_type, traits_type, npos>
+ return _VSTD::__str_find_last_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
@@ -3655,7 +3607,7 @@
basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(const basic_string& __str,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__find_last_not_of<value_type, size_type, traits_type, npos>
+ return _VSTD::__str_find_last_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __str.data(), __pos, __str.size());
}
@@ -3666,7 +3618,7 @@
size_type __pos) const _NOEXCEPT
{
_LIBCPP_ASSERT(__s != nullptr, "string::find_last_not_of(): received nullptr");
- return _VSTD::__find_last_not_of<value_type, size_type, traits_type, npos>
+ return _VSTD::__str_find_last_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
@@ -3676,7 +3628,7 @@
basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(value_type __c,
size_type __pos) const _NOEXCEPT
{
- return _VSTD::__find_last_not_of<value_type, size_type, traits_type, npos>
+ return _VSTD::__str_find_last_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __c, __pos);
}
diff --git a/include/support/android/locale_bionic.h b/include/support/android/locale_bionic.h
index 354fcfe..3a020da 100644
--- a/include/support/android/locale_bionic.h
+++ b/include/support/android/locale_bionic.h
@@ -20,173 +20,12 @@
#include <stdlib.h>
#include <xlocale.h>
-static inline int isalnum_l(int c, locale_t) {
- return isalnum(c);
-}
-
-static inline int isalpha_l(int c, locale_t) {
- return isalpha(c);
-}
-
-static inline int isblank_l(int c, locale_t) {
- return isblank(c);
-}
-
-static inline int iscntrl_l(int c, locale_t) {
- return iscntrl(c);
-}
-
-static inline int isdigit_l(int c, locale_t) {
- return isdigit(c);
-}
-
-static inline int isgraph_l(int c, locale_t) {
- return isgraph(c);
-}
-
-static inline int islower_l(int c, locale_t) {
- return islower(c);
-}
-
-static inline int isprint_l(int c, locale_t) {
- return isprint(c);
-}
-
-static inline int ispunct_l(int c, locale_t) {
- return ispunct(c);
-}
-
-static inline int isspace_l(int c, locale_t) {
- return isspace(c);
-}
-
-static inline int isupper_l(int c, locale_t) {
- return isupper(c);
-}
-
-static inline int isxdigit_l(int c, locale_t) {
- return isxdigit(c);
-}
-
-static inline int iswalnum_l(wint_t c, locale_t) {
- return iswalnum(c);
-}
-
-static inline int iswalpha_l(wint_t c, locale_t) {
- return iswalpha(c);
-}
-
-static inline int iswblank_l(wint_t c, locale_t) {
- return iswblank(c);
-}
-
-static inline int iswcntrl_l(wint_t c, locale_t) {
- return iswcntrl(c);
-}
-
-static inline int iswdigit_l(wint_t c, locale_t) {
- return iswdigit(c);
-}
-
-static inline int iswgraph_l(wint_t c, locale_t) {
- return iswgraph(c);
-}
-
-static inline int iswlower_l(wint_t c, locale_t) {
- return iswlower(c);
-}
-
-static inline int iswprint_l(wint_t c, locale_t) {
- return iswprint(c);
-}
-
-static inline int iswpunct_l(wint_t c, locale_t) {
- return iswpunct(c);
-}
-
-static inline int iswspace_l(wint_t c, locale_t) {
- return iswspace(c);
-}
-
-static inline int iswupper_l(wint_t c, locale_t) {
- return iswupper(c);
-}
-
-static inline int iswxdigit_l(wint_t c, locale_t) {
- return iswxdigit(c);
-}
-
-static inline int toupper_l(int c, locale_t) {
- return toupper(c);
-}
-
-static inline int tolower_l(int c, locale_t) {
- return tolower(c);
-}
-
-static inline int towupper_l(int c, locale_t) {
- return towupper(c);
-}
-
-static inline int towlower_l(int c, locale_t) {
- return towlower(c);
-}
-
-static inline int strcoll_l(const char *s1, const char *s2, locale_t) {
- return strcoll(s1, s2);
-}
-
-static inline size_t strxfrm_l(char *dest, const char *src, size_t n,
- locale_t) {
- return strxfrm(dest, src, n);
-}
-
-static inline size_t strftime_l(char *s, size_t max, const char *format,
- const struct tm *tm, locale_t) {
- return strftime(s, max, format, tm);
-}
-
-static inline int wcscoll_l(const wchar_t *ws1, const wchar_t *ws2, locale_t) {
- return wcscoll(ws1, ws2);
-}
-
-static inline size_t wcsxfrm_l(wchar_t *dest, const wchar_t *src, size_t n,
- locale_t) {
- return wcsxfrm(dest, src, n);
-}
-
-static inline long double strtold_l(const char *nptr, char **endptr, locale_t) {
- return strtold(nptr, endptr);
-}
-
-static inline long long strtoll_l(const char *nptr, char **endptr, size_t base,
- locale_t) {
- return strtoll(nptr, endptr, base);
-}
-
-static inline unsigned long long strtoull_l(const char *nptr, char **endptr,
- size_t base, locale_t) {
- return strtoull(nptr, endptr, base);
-}
-
-static inline long long wcstoll_l(const wchar_t *nptr, wchar_t **endptr,
- size_t base, locale_t) {
- return wcstoll(nptr, endptr, base);
-}
-
-static inline unsigned long long wcstoull_l(const wchar_t *nptr,
- wchar_t **endptr, size_t base,
- locale_t) {
- return wcstoull(nptr, endptr, base);
-}
-
-static inline long double wcstold_l(const wchar_t *nptr, wchar_t **endptr,
- locale_t) {
- return wcstold(nptr, endptr);
-}
-
#ifdef __cplusplus
}
#endif
+
+// Share implementation with Newlib
+#include <support/xlocale/xlocale.h>
+
#endif // defined(__ANDROID__)
#endif // _LIBCPP_SUPPORT_ANDROID_LOCALE_BIONIC_H
diff --git a/include/support/newlib/xlocale.h b/include/support/newlib/xlocale.h
new file mode 100644
index 0000000..d067cf8
--- /dev/null
+++ b/include/support/newlib/xlocale.h
@@ -0,0 +1,63 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_NEWLIB_XLOCALE_H
+#define _LIBCPP_SUPPORT_NEWLIB_XLOCALE_H
+
+#if defined(_NEWLIB_VERSION)
+
+#include <cstdlib>
+#include <clocale>
+#include <cwctype>
+#include <ctype.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Patch over newlib's lack of extended locale support
+typedef void *locale_t;
+static inline locale_t duplocale(locale_t) {
+ return NULL;
+}
+
+static inline void freelocale(locale_t) {
+}
+
+static inline locale_t newlocale(int, const char *, locale_t) {
+ return NULL;
+}
+
+static inline locale_t uselocale(locale_t) {
+ return NULL;
+}
+
+#define LC_COLLATE_MASK (1 << LC_COLLATE)
+#define LC_CTYPE_MASK (1 << LC_CTYPE)
+#define LC_MESSAGES_MASK (1 << LC_MESSAGES)
+#define LC_MONETARY_MASK (1 << LC_MONETARY)
+#define LC_NUMERIC_MASK (1 << LC_NUMERIC)
+#define LC_TIME_MASK (1 << LC_TIME)
+#define LC_ALL_MASK (LC_COLLATE_MASK|\
+ LC_CTYPE_MASK|\
+ LC_MONETARY_MASK|\
+ LC_NUMERIC_MASK|\
+ LC_TIME_MASK|\
+ LC_MESSAGES_MASK)
+
+// Share implementation with Android's Bionic
+#include <support/xlocale/xlocale.h>
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _NEWLIB_VERSION
+
+#endif
diff --git a/include/support/xlocale/xlocale.h b/include/support/xlocale/xlocale.h
new file mode 100644
index 0000000..99f710e
--- /dev/null
+++ b/include/support/xlocale/xlocale.h
@@ -0,0 +1,194 @@
+// -*- C++ -*-
+//===------------------- support/xlocale/xlocale.h ------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+// This is a shared implementation of a shim to provide extended locale support
+// on top of libc's that don't support it (like Android's bionic, and Newlib).
+//
+// The 'illusion' only works when the specified locale is "C" or "POSIX", but
+// that's about as good as we can do without implementing full xlocale support
+// in the underlying libc.
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_XLOCALE_XLOCALE_H
+#define _LIBCPP_SUPPORT_XLOCALE_XLOCALE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+static inline int isalnum_l(int c, locale_t) {
+ return isalnum(c);
+}
+
+static inline int isalpha_l(int c, locale_t) {
+ return isalpha(c);
+}
+
+static inline int isblank_l(int c, locale_t) {
+ return isblank(c);
+}
+
+static inline int iscntrl_l(int c, locale_t) {
+ return iscntrl(c);
+}
+
+static inline int isdigit_l(int c, locale_t) {
+ return isdigit(c);
+}
+
+static inline int isgraph_l(int c, locale_t) {
+ return isgraph(c);
+}
+
+static inline int islower_l(int c, locale_t) {
+ return islower(c);
+}
+
+static inline int isprint_l(int c, locale_t) {
+ return isprint(c);
+}
+
+static inline int ispunct_l(int c, locale_t) {
+ return ispunct(c);
+}
+
+static inline int isspace_l(int c, locale_t) {
+ return isspace(c);
+}
+
+static inline int isupper_l(int c, locale_t) {
+ return isupper(c);
+}
+
+static inline int isxdigit_l(int c, locale_t) {
+ return isxdigit(c);
+}
+
+static inline int iswalnum_l(wint_t c, locale_t) {
+ return iswalnum(c);
+}
+
+static inline int iswalpha_l(wint_t c, locale_t) {
+ return iswalpha(c);
+}
+
+static inline int iswblank_l(wint_t c, locale_t) {
+ return iswblank(c);
+}
+
+static inline int iswcntrl_l(wint_t c, locale_t) {
+ return iswcntrl(c);
+}
+
+static inline int iswdigit_l(wint_t c, locale_t) {
+ return iswdigit(c);
+}
+
+static inline int iswgraph_l(wint_t c, locale_t) {
+ return iswgraph(c);
+}
+
+static inline int iswlower_l(wint_t c, locale_t) {
+ return iswlower(c);
+}
+
+static inline int iswprint_l(wint_t c, locale_t) {
+ return iswprint(c);
+}
+
+static inline int iswpunct_l(wint_t c, locale_t) {
+ return iswpunct(c);
+}
+
+static inline int iswspace_l(wint_t c, locale_t) {
+ return iswspace(c);
+}
+
+static inline int iswupper_l(wint_t c, locale_t) {
+ return iswupper(c);
+}
+
+static inline int iswxdigit_l(wint_t c, locale_t) {
+ return iswxdigit(c);
+}
+
+static inline int toupper_l(int c, locale_t) {
+ return toupper(c);
+}
+
+static inline int tolower_l(int c, locale_t) {
+ return tolower(c);
+}
+
+static inline int towupper_l(int c, locale_t) {
+ return towupper(c);
+}
+
+static inline int towlower_l(int c, locale_t) {
+ return towlower(c);
+}
+
+static inline int strcoll_l(const char *s1, const char *s2, locale_t) {
+ return strcoll(s1, s2);
+}
+
+static inline size_t strxfrm_l(char *dest, const char *src, size_t n,
+ locale_t) {
+ return strxfrm(dest, src, n);
+}
+
+static inline size_t strftime_l(char *s, size_t max, const char *format,
+ const struct tm *tm, locale_t) {
+ return strftime(s, max, format, tm);
+}
+
+static inline int wcscoll_l(const wchar_t *ws1, const wchar_t *ws2, locale_t) {
+ return wcscoll(ws1, ws2);
+}
+
+static inline size_t wcsxfrm_l(wchar_t *dest, const wchar_t *src, size_t n,
+ locale_t) {
+ return wcsxfrm(dest, src, n);
+}
+
+static inline long double strtold_l(const char *nptr, char **endptr, locale_t) {
+ return strtold(nptr, endptr);
+}
+
+static inline long long strtoll_l(const char *nptr, char **endptr, int base,
+ locale_t) {
+ return strtoll(nptr, endptr, base);
+}
+
+static inline unsigned long long strtoull_l(const char *nptr, char **endptr,
+ int base, locale_t) {
+ return strtoull(nptr, endptr, base);
+}
+
+static inline long long wcstoll_l(const wchar_t *nptr, wchar_t **endptr,
+ int base, locale_t) {
+ return wcstoll(nptr, endptr, base);
+}
+
+static inline unsigned long long wcstoull_l(const wchar_t *nptr,
+ wchar_t **endptr, int base,
+ locale_t) {
+ return wcstoull(nptr, endptr, base);
+}
+
+static inline long double wcstold_l(const wchar_t *nptr, wchar_t **endptr,
+ locale_t) {
+ return wcstold(nptr, endptr);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _LIBCPP_SUPPORT_XLOCALE_XLOCALE_H
diff --git a/include/thread b/include/thread
index 1f1e4a2..808d76b 100644
--- a/include/thread
+++ b/include/thread
@@ -106,6 +106,10 @@
#define __STDCPP_THREADS__ __cplusplus
+#ifdef _LIBCPP_HAS_NO_THREADS
+#error <thread> is not supported on this single threaded system
+#else // !_LIBCPP_HAS_NO_THREADS
+
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Tp>
@@ -455,4 +459,6 @@
_LIBCPP_END_NAMESPACE_STD
+#endif // !_LIBCPP_HAS_NO_THREADS
+
#endif // _LIBCPP_THREAD
diff --git a/include/tuple b/include/tuple
index c3fdd40..aa7185c 100644
--- a/include/tuple
+++ b/include/tuple
@@ -376,19 +376,18 @@
_LIBCPP_INLINE_VISIBILITY
void __swallow(_Tp&&...) _NOEXCEPT {}
-template <bool ...> struct __all;
+template <bool ..._B>
+struct __all
+ : is_same<__all<_B...>, __all<(_B, true)...>>
+{ };
-template <>
-struct __all<>
-{
- static const bool value = true;
-};
+template <class _Tp>
+struct __all_default_constructible;
-template <bool _B0, bool ... _Bp>
-struct __all<_B0, _Bp...>
-{
- static const bool value = _B0 && __all<_Bp...>::value;
-};
+template <class ..._Tp>
+struct __all_default_constructible<__tuple_types<_Tp...>>
+ : __all<is_default_constructible<_Tp>::value...>
+{ };
// __tuple_impl
@@ -512,6 +511,9 @@
typename tuple_element<_Jp, tuple<_Up...> >::type&& get(tuple<_Up...>&&) _NOEXCEPT;
public:
+ template <bool _Dummy = true, class _Up = typename enable_if<
+ __all<(_Dummy && is_default_constructible<_Tp>::value)...>::value
+ >::type>
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR tuple()
_NOEXCEPT_(__all<is_nothrow_default_constructible<_Tp>::value...>::value) {}
@@ -547,6 +549,12 @@
sizeof...(_Up) < sizeof...(_Tp) ?
sizeof...(_Up) :
sizeof...(_Tp)>::type
+ >::value &&
+ __all_default_constructible<
+ typename __make_tuple_types<tuple, sizeof...(_Tp),
+ sizeof...(_Up) < sizeof...(_Tp) ?
+ sizeof...(_Up) :
+ sizeof...(_Tp)>::type
>::value,
bool
>::type = false
@@ -554,7 +562,7 @@
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
tuple(_Up&&... __u)
_NOEXCEPT_((
- is_nothrow_constructible<
+ is_nothrow_constructible<base,
typename __make_tuple_indices<sizeof...(_Up)>::type,
typename __make_tuple_types<tuple, sizeof...(_Up)>::type,
typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type,
@@ -587,6 +595,12 @@
sizeof...(_Up) < sizeof...(_Tp) ?
sizeof...(_Up) :
sizeof...(_Tp)>::type
+ >::value &&
+ __all_default_constructible<
+ typename __make_tuple_types<tuple, sizeof...(_Tp),
+ sizeof...(_Up) < sizeof...(_Tp) ?
+ sizeof...(_Up) :
+ sizeof...(_Tp)>::type
>::value,
bool
>::type =false
@@ -595,7 +609,7 @@
explicit
tuple(_Up&&... __u)
_NOEXCEPT_((
- is_nothrow_constructible<
+ is_nothrow_constructible<base,
typename __make_tuple_indices<sizeof...(_Up)>::type,
typename __make_tuple_types<tuple, sizeof...(_Up)>::type,
typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type,
@@ -620,6 +634,12 @@
sizeof...(_Up) < sizeof...(_Tp) ?
sizeof...(_Up) :
sizeof...(_Tp)>::type
+ >::value &&
+ __all_default_constructible<
+ typename __make_tuple_types<tuple, sizeof...(_Tp),
+ sizeof...(_Up) < sizeof...(_Tp) ?
+ sizeof...(_Up) :
+ sizeof...(_Tp)>::type
>::value
>::type
>
diff --git a/include/type_traits b/include/type_traits
index c0e1a6d..f467735 100644
--- a/include/type_traits
+++ b/include/type_traits
@@ -197,7 +197,9 @@
template <class F, class... ArgTypes>
using result_of_t = typename result_of<F(ArgTypes...)>::type; // C++14
-} // std
+ template <class...>
+ using void_t = void;
+} // C++17
*/
#include <__config>
@@ -209,6 +211,11 @@
_LIBCPP_BEGIN_NAMESPACE_STD
+#ifndef _LIBCPP_HAS_NO_VARIADICS
+template <class...>
+struct __void_t { typedef void type; };
+#endif
+
template <bool _Bp, class _If, class _Then>
struct _LIBCPP_TYPE_VIS_ONLY conditional {typedef _If type;};
template <class _If, class _Then>
@@ -218,6 +225,9 @@
template <bool _Bp, class _If, class _Then> using conditional_t = typename conditional<_Bp, _If, _Then>::type;
#endif
+template <bool, class _Tp> struct _LIBCPP_TYPE_VIS_ONLY __lazy_enable_if {};
+template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY __lazy_enable_if<true, _Tp> {typedef typename _Tp::type type;};
+
template <bool, class _Tp = void> struct _LIBCPP_TYPE_VIS_ONLY enable_if {};
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY enable_if<true, _Tp> {typedef _Tp type;};
@@ -1208,43 +1218,46 @@
bool = __numeric_type<_A1>::value &&
__numeric_type<_A2>::value &&
__numeric_type<_A3>::value>
-class __promote
+class __promote_imp
{
+public:
static const bool value = false;
};
template <class _A1, class _A2, class _A3>
-class __promote<_A1, _A2, _A3, true>
+class __promote_imp<_A1, _A2, _A3, true>
{
private:
- typedef typename __promote<_A1>::type __type1;
- typedef typename __promote<_A2>::type __type2;
- typedef typename __promote<_A3>::type __type3;
+ typedef typename __promote_imp<_A1>::type __type1;
+ typedef typename __promote_imp<_A2>::type __type2;
+ typedef typename __promote_imp<_A3>::type __type3;
public:
typedef decltype(__type1() + __type2() + __type3()) type;
static const bool value = true;
};
template <class _A1, class _A2>
-class __promote<_A1, _A2, void, true>
+class __promote_imp<_A1, _A2, void, true>
{
private:
- typedef typename __promote<_A1>::type __type1;
- typedef typename __promote<_A2>::type __type2;
+ typedef typename __promote_imp<_A1>::type __type1;
+ typedef typename __promote_imp<_A2>::type __type2;
public:
typedef decltype(__type1() + __type2()) type;
static const bool value = true;
};
template <class _A1>
-class __promote<_A1, void, void, true>
+class __promote_imp<_A1, void, void, true>
{
public:
typedef typename __numeric_type<_A1>::type type;
static const bool value = true;
- static const bool __does_not_throw = _NOEXCEPT_OR_FALSE(static_cast<type>(declval<_A1>()));
};
+template <class _A1, class _A2 = void, class _A3 = void>
+class __promote : public __promote_imp<_A1, _A2, _A3> {};
+
#ifdef _LIBCPP_STORE_AS_OPTIMIZATION
// __transform
@@ -1523,7 +1536,7 @@
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_copy_assignable
: public is_assignable<typename add_lvalue_reference<_Tp>::type,
- const typename add_lvalue_reference<_Tp>::type> {};
+ typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
// is_move_assignable
@@ -1537,11 +1550,11 @@
// is_destructible
-// if it's a reference, return true
-// if it's a function, return false
-// if it's void, return false
-// if it's an array of unknown bound, return false
-// Otherwise, return "std::declval<_Up&>().~_Up()" is well-formed
+// if it's a reference, return true
+// if it's a function, return false
+// if it's void, return false
+// if it's an array of unknown bound, return false
+// Otherwise, return "std::declval<_Up&>().~_Up()" is well-formed
// where _Up is remove_all_extents<_Tp>::type
template <class>
@@ -1549,15 +1562,15 @@
template <typename _Tp>
struct __is_destructor_wellformed {
- template <typename _Tp1>
- static char __test (
+ template <typename _Tp1>
+ static char __test (
typename __is_destructible_apply<decltype(_VSTD::declval<_Tp1&>().~_Tp1())>::type
);
- template <typename _Tp1>
- static __two __test (...);
-
- static const bool value = sizeof(__test<_Tp>(12)) == sizeof(char);
+ template <typename _Tp1>
+ static __two __test (...);
+
+ static const bool value = sizeof(__test<_Tp>(12)) == sizeof(char);
};
template <class _Tp, bool>
@@ -2637,8 +2650,8 @@
template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_copy_constructible
- : public is_constructible<_Tp, const typename add_lvalue_reference<_Tp>::type>
- {};
+ : public is_constructible<_Tp,
+ typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
// is_move_constructible
@@ -2842,8 +2855,7 @@
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_copy_assignable
: public is_trivially_assignable<typename add_lvalue_reference<_Tp>::type,
- const typename add_lvalue_reference<_Tp>::type>
- {};
+ typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
// is_trivially_move_assignable
@@ -2861,7 +2873,7 @@
#if __has_feature(has_trivial_destructor) || (_GNUC_VER >= 403)
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_destructible
- : public integral_constant<bool, __has_trivial_destructor(_Tp)> {};
+ : public integral_constant<bool, is_destructible<_Tp>::value && __has_trivial_destructor(_Tp)> {};
#else
@@ -2889,29 +2901,38 @@
#if __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L)
-template <bool, class _Tp, class... _Args> struct __libcpp_is_nothrow_constructible;
+template <bool, bool, class _Tp, class... _Args> struct __libcpp_is_nothrow_constructible;
template <class _Tp, class... _Args>
-struct __libcpp_is_nothrow_constructible<true, _Tp, _Args...>
+struct __libcpp_is_nothrow_constructible</*is constructible*/true, /*is reference*/false, _Tp, _Args...>
: public integral_constant<bool, noexcept(_Tp(declval<_Args>()...))>
{
};
-template <class _Tp, class... _Args>
-struct __libcpp_is_nothrow_constructible<false, _Tp, _Args...>
+template <class _Tp>
+void __implicit_conversion_to(_Tp) noexcept { }
+
+template <class _Tp, class _Arg>
+struct __libcpp_is_nothrow_constructible</*is constructible*/true, /*is reference*/true, _Tp, _Arg>
+ : public integral_constant<bool, noexcept(__implicit_conversion_to<_Tp>(declval<_Arg>()))>
+{
+};
+
+template <class _Tp, bool _IsReference, class... _Args>
+struct __libcpp_is_nothrow_constructible</*is constructible*/false, _IsReference, _Tp, _Args...>
: public false_type
{
};
template <class _Tp, class... _Args>
struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible
- : __libcpp_is_nothrow_constructible<is_constructible<_Tp, _Args...>::value, _Tp, _Args...>
+ : __libcpp_is_nothrow_constructible<is_constructible<_Tp, _Args...>::value, is_reference<_Tp>::value, _Tp, _Args...>
{
};
template <class _Tp, size_t _Ns>
struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp[_Ns]>
- : __libcpp_is_nothrow_constructible<is_constructible<_Tp>::value, _Tp>
+ : __libcpp_is_nothrow_constructible<is_constructible<_Tp>::value, is_reference<_Tp>::value, _Tp>
{
};
@@ -3034,8 +3055,8 @@
// is_nothrow_copy_constructible
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_copy_constructible
- : public is_nothrow_constructible<_Tp, const typename add_lvalue_reference<_Tp>::type>
- {};
+ : public is_nothrow_constructible<_Tp,
+ typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
// is_nothrow_move_constructible
@@ -3119,8 +3140,7 @@
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_copy_assignable
: public is_nothrow_assignable<typename add_lvalue_reference<_Tp>::type,
- const typename add_lvalue_reference<_Tp>::type>
- {};
+ typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
// is_nothrow_move_assignable
@@ -3629,24 +3649,41 @@
#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
template <class _Tp>
-struct __has_operator_addressof_imp
+struct __has_operator_addressof_member_imp
{
- template <class>
- static auto __test(__any) -> false_type;
template <class _Up>
- static auto __test(_Up* __u)
- -> typename __select_2nd<decltype(__u->operator&()), true_type>::type;
+ static auto __test(int)
+ -> typename __select_2nd<decltype(_VSTD::declval<_Up>().operator&()), true_type>::type;
+ template <class>
+ static auto __test(long) -> false_type;
- static const bool value = decltype(__test<_Tp>(nullptr))::value;
+ static const bool value = decltype(__test<_Tp>(0))::value;
+};
+
+template <class _Tp>
+struct __has_operator_addressof_free_imp
+{
+ template <class _Up>
+ static auto __test(int)
+ -> typename __select_2nd<decltype(operator&(_VSTD::declval<_Up>())), true_type>::type;
+ template <class>
+ static auto __test(long) -> false_type;
+
+ static const bool value = decltype(__test<_Tp>(0))::value;
};
template <class _Tp>
struct __has_operator_addressof
- : public integral_constant<bool, __has_operator_addressof_imp<_Tp>::value>
+ : public integral_constant<bool, __has_operator_addressof_member_imp<_Tp>::value
+ || __has_operator_addressof_free_imp<_Tp>::value>
{};
#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
+#if _LIBCPP_STD_VER > 14
+template <class...> using void_t = void;
+#endif
+
_LIBCPP_END_NAMESPACE_STD
#endif // _LIBCPP_TYPE_TRAITS
diff --git a/include/unordered_map b/include/unordered_map
index 4e2298b..0fa87d1 100644
--- a/include/unordered_map
+++ b/include/unordered_map
@@ -351,6 +351,8 @@
#include <functional>
#include <stdexcept>
+#include <__debug>
+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
diff --git a/include/unordered_set b/include/unordered_set
index fd378fa..d06629f 100644
--- a/include/unordered_set
+++ b/include/unordered_set
@@ -325,6 +325,8 @@
#include <__hash_table>
#include <functional>
+#include <__debug>
+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
#endif
diff --git a/include/utility b/include/utility
index 4eafda4..6f324db 100644
--- a/include/utility
+++ b/include/utility
@@ -207,7 +207,7 @@
_ForwardIterator2
swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2)
{
- for(; __first1 != __last1; ++__first1, ++__first2)
+ for(; __first1 != __last1; ++__first1, (void) ++__first2)
swap(*__first1, *__first2);
return __first2;
}
diff --git a/include/vector b/include/vector
index 5d41bd1..22a6343 100644
--- a/include/vector
+++ b/include/vector
@@ -276,11 +276,7 @@
#include <__undef_min_max>
-#ifdef _LIBCPP_DEBUG
-# include <__debug>
-#else
-# define _LIBCPP_ASSERT(x, m) ((void)0)
-#endif
+#include <__debug>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#pragma GCC system_header
@@ -788,7 +784,6 @@
void
>::type
__construct_at_end(_ForwardIterator __first, _ForwardIterator __last);
- void __move_construct_at_end(pointer __first, pointer __last);
void __append(size_type __n);
void __append(size_type __n, const_reference __x);
_LIBCPP_INLINE_VISIBILITY
@@ -840,7 +835,7 @@
// may not meet the AddressSanitizer alignment constraints.
// See the documentation for __sanitizer_annotate_contiguous_container for more details.
void __annotate_contiguous_container
- (const void *__beg, const void *__end, const void *__old_mid, const void *__new_mid)
+ (const void *__beg, const void *__end, const void *__old_mid, const void *__new_mid) const
{
#ifndef _LIBCPP_HAS_NO_ASAN
if (__beg && is_same<allocator_type, __default_allocator_type>::value)
@@ -848,26 +843,50 @@
#endif
}
- void __annotate_new(size_type __current_size)
+ void __annotate_new(size_type __current_size) const
{
__annotate_contiguous_container(data(), data() + capacity(),
data() + capacity(), data() + __current_size);
}
- void __annotate_delete()
+ void __annotate_delete() const
{
__annotate_contiguous_container(data(), data() + capacity(),
data() + size(), data() + capacity());
}
- void __annotate_increase(size_type __n)
+ void __annotate_increase(size_type __n) const
{
__annotate_contiguous_container(data(), data() + capacity(),
data() + size(), data() + size() + __n);
}
- void __annotate_shrink(size_type __old_size)
+ void __annotate_shrink(size_type __old_size) const
{
__annotate_contiguous_container(data(), data() + capacity(),
data() + __old_size, data() + size());
}
+#ifndef _LIBCPP_HAS_NO_ASAN
+ // The annotation for size increase should happen before the actual increase,
+ // but if an exception is thrown after that the annotation has to be undone.
+ struct __RAII_IncreaseAnnotator {
+ __RAII_IncreaseAnnotator(const vector &__v, size_type __n = 1)
+ : __commit(false), __v(__v), __n(__n) {
+ __v.__annotate_increase(__n);
+ }
+ void __done() { __commit = true; }
+ ~__RAII_IncreaseAnnotator() {
+ if (__commit) return;
+ __v.__annotate_shrink(__v.size() + __n);
+ }
+ bool __commit;
+ size_type __n;
+ const vector &__v;
+ };
+#else
+ struct __RAII_IncreaseAnnotator {
+ inline __RAII_IncreaseAnnotator(const vector &, size_type __n = 1) {}
+ inline void __done() {}
+ };
+#endif
+
};
template <class _Tp, class _Allocator>
@@ -963,12 +982,13 @@
vector<_Tp, _Allocator>::__construct_at_end(size_type __n)
{
allocator_type& __a = this->__alloc();
- __annotate_increase(__n);
do
{
+ __RAII_IncreaseAnnotator __annotator(*this);
__alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_));
++this->__end_;
--__n;
+ __annotator.__done();
} while (__n > 0);
}
@@ -984,12 +1004,13 @@
vector<_Tp, _Allocator>::__construct_at_end(size_type __n, const_reference __x)
{
allocator_type& __a = this->__alloc();
- __annotate_increase(__n);
do
{
+ __RAII_IncreaseAnnotator __annotator(*this);
__alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_), __x);
++this->__end_;
--__n;
+ __annotator.__done();
} while (__n > 0);
}
@@ -1005,22 +1026,9 @@
allocator_type& __a = this->__alloc();
for (; __first != __last; ++__first)
{
- __annotate_increase(1);
+ __RAII_IncreaseAnnotator __annotator(*this);
__alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_), *__first);
- ++this->__end_;
- }
-}
-
-template <class _Tp, class _Allocator>
-void
-vector<_Tp, _Allocator>::__move_construct_at_end(pointer __first, pointer __last)
-{
- allocator_type& __a = this->__alloc();
- for (; __first != __last; ++__first)
- {
- __annotate_increase(1);
- __alloc_traits::construct(__a, _VSTD::__to_raw_pointer(this->__end_),
- _VSTD::move(*__first));
+ __annotator.__done();
++this->__end_;
}
}
@@ -1582,9 +1590,10 @@
{
if (this->__end_ != this->__end_cap())
{
- __annotate_increase(1);
+ __RAII_IncreaseAnnotator __annotator(*this);
__alloc_traits::construct(this->__alloc(),
_VSTD::__to_raw_pointer(this->__end_), __x);
+ __annotator.__done();
++this->__end_;
}
else
@@ -1600,10 +1609,11 @@
{
if (this->__end_ < this->__end_cap())
{
- __annotate_increase(1);
+ __RAII_IncreaseAnnotator __annotator(*this);
__alloc_traits::construct(this->__alloc(),
_VSTD::__to_raw_pointer(this->__end_),
_VSTD::move(__x));
+ __annotator.__done();
++this->__end_;
}
else
@@ -1633,10 +1643,11 @@
{
if (this->__end_ < this->__end_cap())
{
- __annotate_increase(1);
+ __RAII_IncreaseAnnotator __annotator(*this);
__alloc_traits::construct(this->__alloc(),
_VSTD::__to_raw_pointer(this->__end_),
_VSTD::forward<_Args>(__args)...);
+ __annotator.__done();
++this->__end_;
}
else
@@ -1716,7 +1727,7 @@
pointer __p = this->__begin_ + (__position - begin());
if (this->__end_ < this->__end_cap())
{
- __annotate_increase(1);
+ __RAII_IncreaseAnnotator __annotator(*this);
if (__p == this->__end_)
{
__alloc_traits::construct(this->__alloc(),
@@ -1731,6 +1742,7 @@
++__xr;
*__p = *__xr;
}
+ __annotator.__done();
}
else
{
@@ -1756,7 +1768,7 @@
pointer __p = this->__begin_ + (__position - begin());
if (this->__end_ < this->__end_cap())
{
- __annotate_increase(1);
+ __RAII_IncreaseAnnotator __annotator(*this);
if (__p == this->__end_)
{
__alloc_traits::construct(this->__alloc(),
@@ -1769,6 +1781,7 @@
__move_range(__p, this->__end_, __p + 1);
*__p = _VSTD::move(__x);
}
+ __annotator.__done();
}
else
{
@@ -1795,7 +1808,7 @@
pointer __p = this->__begin_ + (__position - begin());
if (this->__end_ < this->__end_cap())
{
- __annotate_increase(1);
+ __RAII_IncreaseAnnotator __annotator(*this);
if (__p == this->__end_)
{
__alloc_traits::construct(this->__alloc(),
@@ -1809,6 +1822,7 @@
__move_range(__p, this->__end_, __p + 1);
*__p = _VSTD::move(__tmp);
}
+ __annotator.__done();
}
else
{
@@ -1847,8 +1861,9 @@
}
if (__n > 0)
{
- __annotate_increase(__n);
+ __RAII_IncreaseAnnotator __annotator(*this, __n);
__move_range(__p, __old_last, __p + __old_n);
+ __annotator.__done();
const_pointer __xr = pointer_traits<const_pointer>::pointer_to(__x);
if (__p <= __xr && __xr < this->__end_)
__xr += __old_n;
@@ -1958,8 +1973,9 @@
}
if (__n > 0)
{
- __annotate_increase(__n);
+ __RAII_IncreaseAnnotator __annotator(*this, __n);
__move_range(__p, __old_last, __p + __old_n);
+ __annotator.__done();
_VSTD::copy(__first, __m, __p);
}
}