Compare commits
77 Commits
svn-tags/l
...
svn-tags/l
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e06f0c4111 | ||
![]() |
2bdb250fe8 | ||
![]() |
b7842d1bad | ||
![]() |
8feadca3fa | ||
![]() |
1122fec973 | ||
![]() |
20542c0b94 | ||
![]() |
ef54251a84 | ||
![]() |
e003ce4899 | ||
![]() |
bd89e4b0dd | ||
![]() |
0148a838d0 | ||
![]() |
57cff290a4 | ||
![]() |
3dd965bdf9 | ||
![]() |
932209b344 | ||
![]() |
fead2e2de9 | ||
![]() |
6b9826b2dc | ||
![]() |
6cbf9f9b25 | ||
![]() |
97ecd64913 | ||
![]() |
ad935d583d | ||
![]() |
656bdc3667 | ||
![]() |
ed22f562e5 | ||
![]() |
941138f8c9 | ||
![]() |
496934a803 | ||
![]() |
37c53b6221 | ||
![]() |
5ec7f5a518 | ||
![]() |
e06b9965ad | ||
![]() |
f6cc833ae7 | ||
![]() |
783b810cae | ||
![]() |
a5a0ba86c8 | ||
![]() |
e80c36e27b | ||
![]() |
d515df2a50 | ||
![]() |
f1151efcb1 | ||
![]() |
2d01bf0665 | ||
![]() |
0a111118a6 | ||
![]() |
11a58a68e1 | ||
![]() |
6063ec176d | ||
![]() |
0cfa1f7cbd | ||
![]() |
9e604b442c | ||
![]() |
d5c2f255c5 | ||
![]() |
7bbce3c0e7 | ||
![]() |
6b41c6047b | ||
![]() |
5d37fb32d2 | ||
![]() |
3666695f0d | ||
![]() |
d982028b92 | ||
![]() |
ffadfd4c1e | ||
![]() |
c6e08d6c44 | ||
![]() |
469d419a17 | ||
![]() |
7ac6af7027 | ||
![]() |
e14ea5835e | ||
![]() |
75f7695c62 | ||
![]() |
ef3b2e2e34 | ||
![]() |
9dbeff919b | ||
![]() |
8c1aa2c24d | ||
![]() |
506b36487c | ||
![]() |
a02851e8a2 | ||
![]() |
3e93e96dff | ||
![]() |
b8a03c763a | ||
![]() |
d615e47bea | ||
![]() |
154002bb5d | ||
![]() |
41fb6e1432 | ||
![]() |
86e78d694c | ||
![]() |
770a3c5116 | ||
![]() |
d0a2fbfe60 | ||
![]() |
f9b8998795 | ||
![]() |
6e5e7e78ee | ||
![]() |
5885da34ce | ||
![]() |
80586729e4 | ||
![]() |
8dcad976e0 | ||
![]() |
542b0f0cf5 | ||
![]() |
fddf722f4e | ||
![]() |
171869e27c | ||
![]() |
df85e57f4a | ||
![]() |
e7c8da6f2d | ||
![]() |
b2080c70d4 | ||
![]() |
5a245dbf52 | ||
![]() |
08774c5a22 | ||
![]() |
6cf5d8c3aa | ||
![]() |
c4cbb5b6b7 |
26
Makefile
26
Makefile
@@ -9,6 +9,12 @@ OBJROOT=.
|
||||
SYMROOT=.
|
||||
export TRIPLE=-apple-
|
||||
|
||||
ifeq (,$(RC_INDIGO))
|
||||
INSTALL_PREFIX=""
|
||||
else
|
||||
INSTALL_PREFIX="$(SDKROOT)"
|
||||
endif
|
||||
|
||||
installsrc:: $(SRCROOT)
|
||||
|
||||
ditto $(SRCDIRS)/include $(SRCROOT)/include
|
||||
@@ -20,19 +26,19 @@ clean::
|
||||
|
||||
installhdrs::
|
||||
|
||||
mkdir -p $(DSTROOT)/usr/include/c++/v1/ext
|
||||
rsync -r --exclude=".*" $(SRCDIRS)/include/* $(DSTROOT)/usr/include/c++/v1/
|
||||
chown -R root:wheel $(DSTROOT)/usr/include
|
||||
chmod 755 $(DSTROOT)/usr/include/c++/v1
|
||||
chmod 644 $(DSTROOT)/usr/include/c++/v1/*
|
||||
chmod 755 $(DSTROOT)/usr/include/c++/v1/ext
|
||||
chmod 644 $(DSTROOT)/usr/include/c++/v1/ext/*
|
||||
mkdir -p $(DSTROOT)/$(INSTALL_PREFIX)/usr/include/c++/v1/ext
|
||||
rsync -r --exclude=".*" $(SRCDIRS)/include/* $(DSTROOT)/$(INSTALL_PREFIX)/usr/include/c++/v1/
|
||||
chown -R root:wheel $(DSTROOT)/$(INSTALL_PREFIX)/usr/include
|
||||
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/usr/include/c++/v1
|
||||
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/usr/include/c++/v1/*
|
||||
chmod 755 $(DSTROOT)/$(INSTALL_PREFIX)/usr/include/c++/v1/ext
|
||||
chmod 644 $(DSTROOT)/$(INSTALL_PREFIX)/usr/include/c++/v1/ext/*
|
||||
|
||||
install:: installhdrs $(DESTDIR)
|
||||
|
||||
cd lib && ./buildit
|
||||
ditto lib/libc++.1.dylib $(SYMROOT)/usr/lib/libc++.1.dylib
|
||||
cd lib && dsymutil -o $(SYMROOT)/libc++.1.dylib.dSYM $(SYMROOT)/usr/lib/libc++.1.dylib
|
||||
mkdir -p $(DSTROOT)/usr/lib
|
||||
strip -S -o $(DSTROOT)/usr/lib/libc++.1.dylib $(SYMROOT)/usr/lib/libc++.1.dylib
|
||||
cd $(DSTROOT)/usr/lib && ln -s libc++.1.dylib libc++.dylib
|
||||
mkdir -p $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib
|
||||
strip -S -o $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib/libc++.1.dylib $(SYMROOT)/usr/lib/libc++.1.dylib
|
||||
cd $(DSTROOT)/$(INSTALL_PREFIX)/usr/lib && ln -s libc++.1.dylib libc++.dylib
|
||||
|
@@ -25,6 +25,7 @@ check_cxx_compiler_flag(/GR- LIBCXX_HAS_NO_GR_FLAG)
|
||||
check_library_exists(pthread pthread_create "" LIBCXX_HAS_PTHREAD_LIB)
|
||||
check_library_exists(c printf "" LIBCXX_HAS_C_LIB)
|
||||
check_library_exists(m ccos "" LIBCXX_HAS_M_LIB)
|
||||
check_library_exists(rt clock_gettime "" LIBCXX_HAS_RT_LIB)
|
||||
check_library_exists(gcc_s __gcc_personality_v0 "" LIBCXX_HAS_GCC_S_LIB)
|
||||
|
||||
# Check C++0x features
|
||||
|
@@ -47,6 +47,11 @@
|
||||
# endif // _BYTE_ORDER == _LITTLE_ENDIAN
|
||||
#endif // __FreeBSD__
|
||||
|
||||
#ifdef _WIN32
|
||||
# define _LIBCPP_LITTLE_ENDIAN 1
|
||||
# define _LIBCPP_BIG_ENDIAN 0
|
||||
#endif // _WIN32
|
||||
|
||||
#if !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN)
|
||||
# include <endian.h>
|
||||
# if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
@@ -86,8 +91,9 @@
|
||||
|
||||
#if defined(__clang__)
|
||||
|
||||
#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
||||
//#if !__has_feature(cxx_alias_templates)
|
||||
#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
//#endif
|
||||
|
||||
#ifndef __GXX_EXPERIMENTAL_CXX0X__
|
||||
#ifdef __linux__
|
||||
@@ -138,6 +144,7 @@ typedef __char32_t char32_t;
|
||||
|
||||
#if !(__has_feature(cxx_auto_type))
|
||||
#define _LIBCPP_HAS_NO_AUTO_TYPE
|
||||
#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
||||
#endif
|
||||
|
||||
#if !(__has_feature(cxx_variadic_templates))
|
||||
@@ -162,6 +169,14 @@ namespace std {
|
||||
#define _LIBCPP_HAS_NO_CONSTEXPR
|
||||
#endif
|
||||
|
||||
#if (__has_feature(cxx_noexcept))
|
||||
# define _NOEXCEPT noexcept
|
||||
# define _NOEXCEPT_(x) noexcept(x)
|
||||
#else
|
||||
# define _NOEXCEPT throw()
|
||||
# define _NOEXCEPT_(x)
|
||||
#endif
|
||||
|
||||
// end defined(__clang__)
|
||||
|
||||
#elif defined(__GNUC__)
|
||||
@@ -173,6 +188,9 @@ namespace std {
|
||||
#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
#define _LIBCPP_HAS_NO_CONSTEXPR
|
||||
|
||||
#define _NOEXCEPT throw()
|
||||
#define _NOEXCEPT_(x)
|
||||
|
||||
#ifndef __GXX_EXPERIMENTAL_CXX0X__
|
||||
|
||||
#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
||||
@@ -184,10 +202,12 @@ namespace std {
|
||||
#define _LIBCPP_HAS_NO_UNICODE_CHARS
|
||||
#define _LIBCPP_HAS_NO_VARIADICS
|
||||
#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
|
||||
|
||||
#else // __GXX_EXPERIMENTAL_CXX0X__
|
||||
|
||||
#define _LIBCPP_HAS_NO_TRAILING_RETURN
|
||||
#define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
|
||||
|
||||
#if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 3)
|
||||
#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
@@ -207,7 +227,6 @@ namespace std {
|
||||
#endif // !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
|
||||
|
||||
#if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 6)
|
||||
#define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS
|
||||
#define _LIBCPP_HAS_NO_NULLPTR
|
||||
#endif
|
||||
|
||||
|
@@ -281,161 +281,55 @@ struct __weak_result_type<_R (_C::*)(_A1, _A2, _A3...) const volatile>
|
||||
|
||||
// __invoke
|
||||
|
||||
// first bullet
|
||||
// bullets 1 and 2
|
||||
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
template <class _F, class _A0, class ..._Args>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
sizeof...(_Param) == sizeof...(_Arg) &&
|
||||
is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
||||
_R
|
||||
>::type
|
||||
__invoke(_R (_T::*__f)(_Param...), _T1&& __t1, _Arg&& ...__arg)
|
||||
auto
|
||||
__invoke(_F&& __f, _A0&& __a0, _Args&& ...__args)
|
||||
-> decltype((_STD::forward<_A0>(__a0).*__f)(_STD::forward<_Args>(__args)...))
|
||||
{
|
||||
return (_STD::forward<_T>(__t1).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
return (_STD::forward<_A0>(__a0).*__f)(_STD::forward<_Args>(__args)...);
|
||||
}
|
||||
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
template <class _F, class _A0, class ..._Args>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
sizeof...(_Param) == sizeof...(_Arg) &&
|
||||
is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
||||
_R
|
||||
>::type
|
||||
__invoke(_R (_T::*__f)(_Param...) const, _T1&& __t1, _Arg&& ...__arg)
|
||||
auto
|
||||
__invoke(_F&& __f, _A0&& __a0, _Args&& ...__args)
|
||||
-> decltype(((*_STD::forward<_A0>(__a0)).*__f)(_STD::forward<_Args>(__args)...))
|
||||
{
|
||||
return (_STD::forward<const _T>(__t1).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
return ((*_STD::forward<_A0>(__a0)).*__f)(_STD::forward<_Args>(__args)...);
|
||||
}
|
||||
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
// bullets 3 and 4
|
||||
|
||||
template <class _F, class _A0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
sizeof...(_Param) == sizeof...(_Arg) &&
|
||||
is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
||||
_R
|
||||
>::type
|
||||
__invoke(_R (_T::*__f)(_Param...) volatile, _T1&& __t1, _Arg&& ...__arg)
|
||||
auto
|
||||
__invoke(_F&& __f, _A0&& __a0)
|
||||
-> decltype(_STD::forward<_A0>(__a0).*__f)
|
||||
{
|
||||
return (_STD::forward<volatile _T>(__t1).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
return _STD::forward<_A0>(__a0).*__f;
|
||||
}
|
||||
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
template <class _F, class _A0>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
sizeof...(_Param) == sizeof...(_Arg) &&
|
||||
is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
||||
_R
|
||||
>::type
|
||||
__invoke(_R (_T::*__f)(_Param...) const volatile, _T1&& __t1, _Arg&& ...__arg)
|
||||
auto
|
||||
__invoke(_F&& __f, _A0&& __a0)
|
||||
-> decltype((*_STD::forward<_A0>(__a0)).*__f)
|
||||
{
|
||||
return (_STD::forward<const volatile _T>(__t1).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
return (*_STD::forward<_A0>(__a0)).*__f;
|
||||
}
|
||||
|
||||
// second bullet
|
||||
// bullet 5
|
||||
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
template <class _F, class ..._Args>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
sizeof...(_Param) == sizeof...(_Arg) &&
|
||||
!is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
||||
_R
|
||||
>::type
|
||||
__invoke(_R (_T::*__f)(_Param...), _T1&& __t1, _Arg&& ...__arg)
|
||||
auto
|
||||
__invoke(_F&& __f, _Args&& ...__args)
|
||||
-> decltype(_STD::forward<_F>(__f)(_STD::forward<_Args>(__args)...))
|
||||
{
|
||||
return ((*_STD::forward<_T1>(__t1)).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
}
|
||||
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
sizeof...(_Param) == sizeof...(_Arg) &&
|
||||
!is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
||||
_R
|
||||
>::type
|
||||
__invoke(_R (_T::*__f)(_Param...) const, _T1&& __t1, _Arg&& ...__arg)
|
||||
{
|
||||
return ((*_STD::forward<_T1>(__t1)).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
}
|
||||
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
sizeof...(_Param) == sizeof...(_Arg) &&
|
||||
!is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
||||
_R
|
||||
>::type
|
||||
__invoke(_R (_T::*__f)(_Param...) volatile, _T1&& __t1, _Arg&& ...__arg)
|
||||
{
|
||||
return ((*_STD::forward<_T1>(__t1)).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
}
|
||||
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
sizeof...(_Param) == sizeof...(_Arg) &&
|
||||
!is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
||||
_R
|
||||
>::type
|
||||
__invoke(_R (_T::*__f)(_Param...) const volatile, _T1&& __t1, _Arg&& ...__arg)
|
||||
{
|
||||
return ((*_STD::forward<_T1>(__t1)).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
}
|
||||
|
||||
// third bullet
|
||||
|
||||
template <class _R, class _T, class _T1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_base_of<_T, typename remove_reference<_T1>::type>::value,
|
||||
typename __apply_cv<_T1, _R>::type&&
|
||||
>::type
|
||||
__invoke(_R _T::* __f, _T1&& __t1)
|
||||
{
|
||||
return _STD::forward<_T1>(__t1).*__f;
|
||||
}
|
||||
|
||||
// forth bullet
|
||||
|
||||
template <class _T1, class _R, bool>
|
||||
struct __4th_helper
|
||||
{
|
||||
};
|
||||
|
||||
template <class _T1, class _R>
|
||||
struct __4th_helper<_T1, _R, true>
|
||||
{
|
||||
typedef typename __apply_cv<decltype(*_STD::declval<_T1>()), _R>::type type;
|
||||
};
|
||||
|
||||
template <class _R, class _T, class _T1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename __4th_helper<_T1, _R,
|
||||
!is_base_of<_T,
|
||||
typename remove_reference<_T1>::type
|
||||
>::value
|
||||
>::type&&
|
||||
__invoke(_R _T::* __f, _T1&& __t1)
|
||||
{
|
||||
return (*_STD::forward<_T1>(__t1)).*__f;
|
||||
}
|
||||
|
||||
// fifth bullet
|
||||
|
||||
template <class _F, class ..._T>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename result_of<_F(_T...)>::type
|
||||
__invoke(_F&& __f, _T&& ...__t)
|
||||
{
|
||||
return _STD::forward<_F>(__f)(_STD::forward<_T>(__t)...);
|
||||
return _STD::forward<_F>(__f)(_STD::forward<_Args>(__args)...);
|
||||
}
|
||||
|
||||
template <class _Tp, class ..._Args>
|
||||
@@ -468,7 +362,7 @@ public:
|
||||
// invoke
|
||||
template <class... _ArgTypes>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename __invoke_return<type&, _ArgTypes...>::type
|
||||
typename __invoke_of<type&, _ArgTypes...>::type
|
||||
operator() (_ArgTypes&&... __args) const
|
||||
{
|
||||
return __invoke(get(), _STD::forward<_ArgTypes>(__args)...);
|
||||
|
@@ -29,9 +29,9 @@ template <class _NodePtr>
|
||||
struct __hash_node_base
|
||||
{
|
||||
typedef __hash_node_base __first_node;
|
||||
typedef _NodePtr pointer;
|
||||
// typedef _NodePtr pointer;
|
||||
|
||||
pointer __next_;
|
||||
_NodePtr __next_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_node_base() : __next_(nullptr) {}
|
||||
};
|
||||
|
@@ -97,7 +97,7 @@ typename __stdinbuf<_CharT>::int_type
|
||||
__stdinbuf<_CharT>::__getchar(bool __consume)
|
||||
{
|
||||
char __extbuf[__limit];
|
||||
int __nread = max(1, __encoding_);
|
||||
int __nread = _STD::max(1, __encoding_);
|
||||
for (int __i = 0; __i < __nread; ++__i)
|
||||
{
|
||||
char __c = getc(__file_);
|
||||
|
@@ -769,6 +769,7 @@ public:
|
||||
typedef typename __alloc_traits::difference_type difference_type;
|
||||
|
||||
typedef __tree_node<value_type, typename __alloc_traits::void_pointer> __node;
|
||||
typedef __tree_node_base<typename __alloc_traits::void_pointer> __node_base;
|
||||
typedef typename __alloc_traits::template
|
||||
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
rebind_alloc<__node>
|
||||
@@ -779,10 +780,10 @@ public:
|
||||
typedef allocator_traits<__node_allocator> __node_traits;
|
||||
typedef typename __node_traits::pointer __node_pointer;
|
||||
typedef typename __node_traits::const_pointer __node_const_pointer;
|
||||
typedef typename __node::base::pointer __node_base_pointer;
|
||||
typedef typename __node::base::const_pointer __node_base_const_pointer;
|
||||
typedef typename __node_base::pointer __node_base_pointer;
|
||||
typedef typename __node_base::const_pointer __node_base_const_pointer;
|
||||
private:
|
||||
typedef typename __node::base::base __end_node_t;
|
||||
typedef typename __node_base::base __end_node_t;
|
||||
typedef typename pointer_traits<__node_pointer>::template
|
||||
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
rebind<__end_node_t>
|
||||
@@ -910,13 +911,12 @@ public:
|
||||
iterator __insert_multi(_V&& __v);
|
||||
template <class _V>
|
||||
iterator __insert_multi(const_iterator __p, _V&& __v);
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
pair<iterator, bool> __insert_unique(const value_type& __v);
|
||||
iterator __insert_unique(const_iterator __p, const value_type& __v);
|
||||
iterator __insert_multi(const value_type& __v);
|
||||
iterator __insert_multi(const_iterator __p, const value_type& __v);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
pair<iterator, bool> __node_insert_unique(__node_pointer __nd);
|
||||
iterator __node_insert_unique(const_iterator __p,
|
||||
@@ -997,19 +997,19 @@ public:
|
||||
|
||||
__node_holder remove(const_iterator __p);
|
||||
private:
|
||||
typename __node::base::pointer&
|
||||
__find_leaf_low(typename __node::base::pointer& __parent, const value_type& __v);
|
||||
typename __node::base::pointer&
|
||||
__find_leaf_high(typename __node::base::pointer& __parent, const value_type& __v);
|
||||
typename __node::base::pointer&
|
||||
typename __node_base::pointer&
|
||||
__find_leaf_low(typename __node_base::pointer& __parent, const value_type& __v);
|
||||
typename __node_base::pointer&
|
||||
__find_leaf_high(typename __node_base::pointer& __parent, const value_type& __v);
|
||||
typename __node_base::pointer&
|
||||
__find_leaf(const_iterator __hint,
|
||||
typename __node::base::pointer& __parent, const value_type& __v);
|
||||
typename __node_base::pointer& __parent, const value_type& __v);
|
||||
template <class _Key>
|
||||
typename __node::base::pointer&
|
||||
__find_equal(typename __node::base::pointer& __parent, const _Key& __v);
|
||||
typename __node_base::pointer&
|
||||
__find_equal(typename __node_base::pointer& __parent, const _Key& __v);
|
||||
template <class _Key>
|
||||
typename __node::base::pointer&
|
||||
__find_equal(const_iterator __hint, typename __node::base::pointer& __parent,
|
||||
typename __node_base::pointer&
|
||||
__find_equal(const_iterator __hint, typename __node_base::pointer& __parent,
|
||||
const _Key& __v);
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
|
||||
@@ -1411,8 +1411,8 @@ __tree<_Tp, _Compare, _Allocator>::clear()
|
||||
// Set __parent to parent of null leaf
|
||||
// Return reference to null leaf
|
||||
template <class _Tp, class _Compare, class _Allocator>
|
||||
typename __tree<_Tp, _Compare, _Allocator>::__node::base::pointer&
|
||||
__tree<_Tp, _Compare, _Allocator>::__find_leaf_low(typename __node::base::pointer& __parent,
|
||||
typename __tree<_Tp, _Compare, _Allocator>::__node_base::pointer&
|
||||
__tree<_Tp, _Compare, _Allocator>::__find_leaf_low(typename __node_base::pointer& __parent,
|
||||
const value_type& __v)
|
||||
{
|
||||
__node_pointer __nd = __root();
|
||||
@@ -1450,8 +1450,8 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf_low(typename __node::base::pointe
|
||||
// Set __parent to parent of null leaf
|
||||
// Return reference to null leaf
|
||||
template <class _Tp, class _Compare, class _Allocator>
|
||||
typename __tree<_Tp, _Compare, _Allocator>::__node::base::pointer&
|
||||
__tree<_Tp, _Compare, _Allocator>::__find_leaf_high(typename __node::base::pointer& __parent,
|
||||
typename __tree<_Tp, _Compare, _Allocator>::__node_base::pointer&
|
||||
__tree<_Tp, _Compare, _Allocator>::__find_leaf_high(typename __node_base::pointer& __parent,
|
||||
const value_type& __v)
|
||||
{
|
||||
__node_pointer __nd = __root();
|
||||
@@ -1492,9 +1492,9 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf_high(typename __node::base::point
|
||||
// Set __parent to parent of null leaf
|
||||
// Return reference to null leaf
|
||||
template <class _Tp, class _Compare, class _Allocator>
|
||||
typename __tree<_Tp, _Compare, _Allocator>::__node::base::pointer&
|
||||
typename __tree<_Tp, _Compare, _Allocator>::__node_base::pointer&
|
||||
__tree<_Tp, _Compare, _Allocator>::__find_leaf(const_iterator __hint,
|
||||
typename __node::base::pointer& __parent,
|
||||
typename __node_base::pointer& __parent,
|
||||
const value_type& __v)
|
||||
{
|
||||
if (__hint == end() || !value_comp()(*__hint, __v)) // check before
|
||||
@@ -1528,8 +1528,8 @@ __tree<_Tp, _Compare, _Allocator>::__find_leaf(const_iterator __hint,
|
||||
// If __v exists, set parent to node of __v and return reference to node of __v
|
||||
template <class _Tp, class _Compare, class _Allocator>
|
||||
template <class _Key>
|
||||
typename __tree<_Tp, _Compare, _Allocator>::__node::base::pointer&
|
||||
__tree<_Tp, _Compare, _Allocator>::__find_equal(typename __node::base::pointer& __parent,
|
||||
typename __tree<_Tp, _Compare, _Allocator>::__node_base::pointer&
|
||||
__tree<_Tp, _Compare, _Allocator>::__find_equal(typename __node_base::pointer& __parent,
|
||||
const _Key& __v)
|
||||
{
|
||||
__node_pointer __nd = __root();
|
||||
@@ -1577,9 +1577,9 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(typename __node::base::pointer&
|
||||
// If __v exists, set parent to node of __v and return reference to node of __v
|
||||
template <class _Tp, class _Compare, class _Allocator>
|
||||
template <class _Key>
|
||||
typename __tree<_Tp, _Compare, _Allocator>::__node::base::pointer&
|
||||
typename __tree<_Tp, _Compare, _Allocator>::__node_base::pointer&
|
||||
__tree<_Tp, _Compare, _Allocator>::__find_equal(const_iterator __hint,
|
||||
typename __node::base::pointer& __parent,
|
||||
typename __node_base::pointer& __parent,
|
||||
const _Key& __v)
|
||||
{
|
||||
if (__hint == end() || value_comp()(__v, *__hint)) // check before
|
||||
@@ -1609,7 +1609,7 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(const_iterator __hint,
|
||||
const_iterator __next = _STD::next(__hint);
|
||||
if (__next == end() || value_comp()(__v, *__next))
|
||||
{
|
||||
// *__hint < __v < *next(__hint)
|
||||
// *__hint < __v < *_STD::next(__hint)
|
||||
if (__hint.__ptr_->__right_ == nullptr)
|
||||
{
|
||||
__parent = const_cast<__node_pointer&>(__hint.__ptr_);
|
||||
@@ -1728,18 +1728,11 @@ template <class _V>
|
||||
pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
|
||||
__tree<_Tp, _Compare, _Allocator>::__insert_unique(_V&& __v)
|
||||
{
|
||||
__node_base_pointer __parent;
|
||||
__node_base_pointer& __child = __find_equal(__parent, __v);
|
||||
__node_pointer __r = static_cast<__node_pointer>(__child);
|
||||
bool __inserted = false;
|
||||
if (__child == nullptr)
|
||||
{
|
||||
__node_holder __h = __construct_node(_STD::forward<_V>(__v));
|
||||
__insert_node_at(__parent, __child, __h.get());
|
||||
__r = __h.release();
|
||||
__inserted = true;
|
||||
}
|
||||
return pair<iterator, bool>(iterator(__r), __inserted);
|
||||
__node_holder __h = __construct_node(_STD::forward<_V>(__v));
|
||||
pair<iterator, bool> __r = __node_insert_unique(__h.get());
|
||||
if (__r.second)
|
||||
__h.release();
|
||||
return __r;
|
||||
}
|
||||
|
||||
template <class _Tp, class _Compare, class _Allocator>
|
||||
@@ -1747,16 +1740,11 @@ template <class _V>
|
||||
typename __tree<_Tp, _Compare, _Allocator>::iterator
|
||||
__tree<_Tp, _Compare, _Allocator>::__insert_unique(const_iterator __p, _V&& __v)
|
||||
{
|
||||
__node_base_pointer __parent;
|
||||
__node_base_pointer& __child = __find_equal(__p, __parent, __v);
|
||||
__node_pointer __r = static_cast<__node_pointer>(__child);
|
||||
if (__child == nullptr)
|
||||
{
|
||||
__node_holder __h = __construct_node(_STD::forward<_V>(__v));
|
||||
__insert_node_at(__parent, __child, __h.get());
|
||||
__r = __h.release();
|
||||
}
|
||||
return iterator(__r);
|
||||
__node_holder __h = __construct_node(_STD::forward<_V>(__v));
|
||||
iterator __r = __node_insert_unique(__p, __h.get());
|
||||
if (__r.__ptr_ == __h.get())
|
||||
__h.release();
|
||||
return __r;
|
||||
}
|
||||
|
||||
template <class _Tp, class _Compare, class _Allocator>
|
||||
@@ -1796,6 +1784,8 @@ __tree<_Tp, _Compare, _Allocator>::__construct_node(const value_type& __v)
|
||||
return _STD::move(__h);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class _Tp, class _Compare, class _Allocator>
|
||||
pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
|
||||
__tree<_Tp, _Compare, _Allocator>::__insert_unique(const value_type& __v)
|
||||
@@ -1852,8 +1842,6 @@ __tree<_Tp, _Compare, _Allocator>::__insert_multi(const_iterator __p, const valu
|
||||
return iterator(__h.release());
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class _Tp, class _Compare, class _Allocator>
|
||||
pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
|
||||
__tree<_Tp, _Compare, _Allocator>::__node_insert_unique(__node_pointer __nd)
|
||||
|
@@ -214,7 +214,11 @@ 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...> >
|
||||
: public integral_constant<bool,
|
||||
#if 1 // waiting on cwg 1170
|
||||
is_convertible<_Tp0, _Up0>::value &&
|
||||
#else
|
||||
is_constructible<_Up0, _Tp0>::value &&
|
||||
#endif
|
||||
__tuple_convertible_imp<true, __tuple_types<_Tp...>, __tuple_types<_Up...> >::value> {};
|
||||
|
||||
template <>
|
||||
|
@@ -1559,8 +1559,17 @@ typename enable_if
|
||||
>::type
|
||||
copy_n(_InputIterator __first, _Size __n, _OutputIterator __result)
|
||||
{
|
||||
for (; __n > 0; --__n, ++__first, ++__result)
|
||||
if (__n > 0)
|
||||
{
|
||||
*__result = *__first;
|
||||
++__result;
|
||||
for (--__n; __n > 0; --__n)
|
||||
{
|
||||
++__first;
|
||||
*__result = *__first;
|
||||
++__result;
|
||||
}
|
||||
}
|
||||
return __result;
|
||||
}
|
||||
|
||||
@@ -1573,7 +1582,7 @@ typename enable_if
|
||||
>::type
|
||||
copy_n(_InputIterator __first, _Size __n, _OutputIterator __result)
|
||||
{
|
||||
return copy(__first, __first + __n, __result);
|
||||
return _STD::copy(__first, __first + __n, __result);
|
||||
}
|
||||
|
||||
// move
|
||||
|
@@ -530,6 +530,10 @@ void atomic_signal_fence(memory_order m);
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#if !__has_feature(cxx_atomic)
|
||||
#error <atomic> is not implemented
|
||||
#else
|
||||
|
||||
typedef enum memory_order
|
||||
{
|
||||
memory_order_relaxed, memory_order_consume, memory_order_acquire,
|
||||
@@ -1502,6 +1506,8 @@ typedef atomic<uintmax_t> atomic_uintmax_t;
|
||||
#define ATOMIC_LONG_LOCK_FREE 0
|
||||
#define ATOMIC_LLONG_LOCK_FREE 0
|
||||
|
||||
#endif // !__has_feature(cxx_atomic)
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
#endif // _LIBCPP_ATOMIC
|
||||
|
@@ -30,25 +30,43 @@ Macros:
|
||||
|
||||
#if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
|
||||
|
||||
#ifdef ELAST
|
||||
|
||||
const int __elast1 = ELAST+1;
|
||||
const int __elast2 = ELAST+2;
|
||||
#undef ELAST
|
||||
|
||||
#else
|
||||
|
||||
const int __elast1 = 104;
|
||||
const int __elast2 = 105;
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef ENOTRECOVERABLE
|
||||
|
||||
#define EOWNERDEAD __elast1
|
||||
|
||||
#ifdef ELAST
|
||||
#undef ELAST
|
||||
#define ELAST EOWNERDEAD
|
||||
#endif
|
||||
|
||||
#elif defined(EOWNERDEAD)
|
||||
|
||||
#define ENOTRECOVERABLE __elast1
|
||||
#ifdef ELAST
|
||||
#undef ELAST
|
||||
#define ELAST ENOTRECOVERABLE
|
||||
#endif
|
||||
|
||||
#else // defined(EOWNERDEAD)
|
||||
|
||||
#define EOWNERDEAD __elast1
|
||||
#define ENOTRECOVERABLE __elast2
|
||||
#ifdef ELAST
|
||||
#undef ELAST
|
||||
#define ELAST ENOTRECOVERABLE
|
||||
#endif
|
||||
|
||||
#endif // defined(EOWNERDEAD)
|
||||
|
||||
|
674
include/cmath
674
include/cmath
@@ -303,8 +303,340 @@ long double truncl(long double x);
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
// signbit
|
||||
|
||||
#ifdef signbit
|
||||
|
||||
template <class _A1>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_signbit(_A1 __x)
|
||||
{
|
||||
return signbit(__x);
|
||||
}
|
||||
|
||||
#undef signbit
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
|
||||
signbit(_A1 __x)
|
||||
{
|
||||
return __libcpp_signbit(__x);
|
||||
}
|
||||
|
||||
#endif // signbit
|
||||
|
||||
// fpclassify
|
||||
|
||||
#ifdef fpclassify
|
||||
|
||||
template <class _A1>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
int
|
||||
__libcpp_fpclassify(_A1 __x)
|
||||
{
|
||||
return fpclassify(__x);
|
||||
}
|
||||
|
||||
#undef fpclassify
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename std::enable_if<std::is_floating_point<_A1>::value, int>::type
|
||||
fpclassify(_A1 __x)
|
||||
{
|
||||
return __libcpp_fpclassify(__x);
|
||||
}
|
||||
|
||||
#endif // fpclassify
|
||||
|
||||
// isfinite
|
||||
|
||||
#ifdef isfinite
|
||||
|
||||
template <class _A1>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isfinite(_A1 __x)
|
||||
{
|
||||
return isfinite(__x);
|
||||
}
|
||||
|
||||
#undef isfinite
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
|
||||
isfinite(_A1 __x)
|
||||
{
|
||||
return __libcpp_isfinite(__x);
|
||||
}
|
||||
|
||||
#endif // isfinite
|
||||
|
||||
// isinf
|
||||
|
||||
#ifdef isinf
|
||||
|
||||
template <class _A1>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isinf(_A1 __x)
|
||||
{
|
||||
return isinf(__x);
|
||||
}
|
||||
|
||||
#undef isinf
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
|
||||
isinf(_A1 __x)
|
||||
{
|
||||
return __libcpp_isinf(__x);
|
||||
}
|
||||
|
||||
#endif // isinf
|
||||
|
||||
// isnan
|
||||
|
||||
#ifdef isnan
|
||||
|
||||
template <class _A1>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isnan(_A1 __x)
|
||||
{
|
||||
return isnan(__x);
|
||||
}
|
||||
|
||||
#undef isnan
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
|
||||
isnan(_A1 __x)
|
||||
{
|
||||
return __libcpp_isnan(__x);
|
||||
}
|
||||
|
||||
#endif // isnan
|
||||
|
||||
// isnormal
|
||||
|
||||
#ifdef isnormal
|
||||
|
||||
template <class _A1>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isnormal(_A1 __x)
|
||||
{
|
||||
return isnormal(__x);
|
||||
}
|
||||
|
||||
#undef isnormal
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
|
||||
isnormal(_A1 __x)
|
||||
{
|
||||
return __libcpp_isnormal(__x);
|
||||
}
|
||||
|
||||
#endif // isnormal
|
||||
|
||||
// isgreater
|
||||
|
||||
#ifdef isgreater
|
||||
|
||||
template <class _A1, class _A2>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isgreater(_A1 __x, _A2 __y)
|
||||
{
|
||||
return isgreater(__x, __y);
|
||||
}
|
||||
|
||||
#undef isgreater
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename std::enable_if
|
||||
<
|
||||
std::is_floating_point<_A1>::value &&
|
||||
std::is_floating_point<_A2>::value,
|
||||
bool
|
||||
>::type
|
||||
isgreater(_A1 __x, _A2 __y)
|
||||
{
|
||||
return __libcpp_isgreater(__x, __y);
|
||||
}
|
||||
|
||||
#endif // isgreater
|
||||
|
||||
// isgreaterequal
|
||||
|
||||
#ifdef isgreaterequal
|
||||
|
||||
template <class _A1, class _A2>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isgreaterequal(_A1 __x, _A2 __y)
|
||||
{
|
||||
return isgreaterequal(__x, __y);
|
||||
}
|
||||
|
||||
#undef isgreaterequal
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename std::enable_if
|
||||
<
|
||||
std::is_floating_point<_A1>::value &&
|
||||
std::is_floating_point<_A2>::value,
|
||||
bool
|
||||
>::type
|
||||
isgreaterequal(_A1 __x, _A2 __y)
|
||||
{
|
||||
return __libcpp_isgreaterequal(__x, __y);
|
||||
}
|
||||
|
||||
#endif // isgreaterequal
|
||||
|
||||
// isless
|
||||
|
||||
#ifdef isless
|
||||
|
||||
template <class _A1, class _A2>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isless(_A1 __x, _A2 __y)
|
||||
{
|
||||
return isless(__x, __y);
|
||||
}
|
||||
|
||||
#undef isless
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename std::enable_if
|
||||
<
|
||||
std::is_floating_point<_A1>::value &&
|
||||
std::is_floating_point<_A2>::value,
|
||||
bool
|
||||
>::type
|
||||
isless(_A1 __x, _A2 __y)
|
||||
{
|
||||
return __libcpp_isless(__x, __y);
|
||||
}
|
||||
|
||||
#endif // isless
|
||||
|
||||
// islessequal
|
||||
|
||||
#ifdef islessequal
|
||||
|
||||
template <class _A1, class _A2>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_islessequal(_A1 __x, _A2 __y)
|
||||
{
|
||||
return islessequal(__x, __y);
|
||||
}
|
||||
|
||||
#undef islessequal
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename std::enable_if
|
||||
<
|
||||
std::is_floating_point<_A1>::value &&
|
||||
std::is_floating_point<_A2>::value,
|
||||
bool
|
||||
>::type
|
||||
islessequal(_A1 __x, _A2 __y)
|
||||
{
|
||||
return __libcpp_islessequal(__x, __y);
|
||||
}
|
||||
|
||||
#endif // islessequal
|
||||
|
||||
// islessgreater
|
||||
|
||||
#ifdef islessgreater
|
||||
|
||||
template <class _A1, class _A2>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_islessgreater(_A1 __x, _A2 __y)
|
||||
{
|
||||
return islessgreater(__x, __y);
|
||||
}
|
||||
|
||||
#undef islessgreater
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename std::enable_if
|
||||
<
|
||||
std::is_floating_point<_A1>::value &&
|
||||
std::is_floating_point<_A2>::value,
|
||||
bool
|
||||
>::type
|
||||
islessgreater(_A1 __x, _A2 __y)
|
||||
{
|
||||
return __libcpp_islessgreater(__x, __y);
|
||||
}
|
||||
|
||||
#endif // islessgreater
|
||||
|
||||
// isunordered
|
||||
|
||||
#ifdef isunordered
|
||||
|
||||
template <class _A1, class _A2>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isunordered(_A1 __x, _A2 __y)
|
||||
{
|
||||
return isunordered(__x, __y);
|
||||
}
|
||||
|
||||
#undef isunordered
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename std::enable_if
|
||||
<
|
||||
std::is_floating_point<_A1>::value &&
|
||||
std::is_floating_point<_A2>::value,
|
||||
bool
|
||||
>::type
|
||||
isunordered(_A1 __x, _A2 __y)
|
||||
{
|
||||
return __libcpp_isunordered(__x, __y);
|
||||
}
|
||||
|
||||
#endif // isunordered
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
using ::signbit;
|
||||
using ::fpclassify;
|
||||
using ::isfinite;
|
||||
using ::isinf;
|
||||
using ::isnan;
|
||||
using ::isnormal;
|
||||
using ::isgreater;
|
||||
using ::isgreaterequal;
|
||||
using ::isless;
|
||||
using ::islessequal;
|
||||
using ::islessgreater;
|
||||
using ::isunordered;
|
||||
using ::isunordered;
|
||||
|
||||
using ::float_t;
|
||||
using ::double_t;
|
||||
|
||||
@@ -629,348 +961,6 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_integral<_A1>::value, double>::type
|
||||
tanh(_A1 __x) {return tanh((double)__x);}
|
||||
|
||||
// signbit
|
||||
|
||||
#ifndef signbit
|
||||
#error Implementation error: signbit not defined
|
||||
#else
|
||||
|
||||
template <class _A1>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_signbit(_A1 __x)
|
||||
{
|
||||
return signbit(__x);
|
||||
}
|
||||
|
||||
#undef signbit
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_floating_point<_A1>::value, bool>::type
|
||||
signbit(_A1 __x)
|
||||
{
|
||||
return __libcpp_signbit(__x);
|
||||
}
|
||||
|
||||
#endif // signbit
|
||||
|
||||
// fpclassify
|
||||
|
||||
#ifndef fpclassify
|
||||
#error Implementation error: fpclassify not defined
|
||||
#else
|
||||
|
||||
template <class _A1>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
int
|
||||
__libcpp_fpclassify(_A1 __x)
|
||||
{
|
||||
return fpclassify(__x);
|
||||
}
|
||||
|
||||
#undef fpclassify
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_floating_point<_A1>::value, int>::type
|
||||
fpclassify(_A1 __x)
|
||||
{
|
||||
return __libcpp_fpclassify(__x);
|
||||
}
|
||||
|
||||
#endif // fpclassify
|
||||
|
||||
// isfinite
|
||||
|
||||
#ifndef isfinite
|
||||
#error Implementation error: isfinite not defined
|
||||
#else
|
||||
|
||||
template <class _A1>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isfinite(_A1 __x)
|
||||
{
|
||||
return isfinite(__x);
|
||||
}
|
||||
|
||||
#undef isfinite
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_floating_point<_A1>::value, bool>::type
|
||||
isfinite(_A1 __x)
|
||||
{
|
||||
return __libcpp_isfinite(__x);
|
||||
}
|
||||
|
||||
#endif // isfinite
|
||||
|
||||
// isinf
|
||||
|
||||
#ifndef isinf
|
||||
#error Implementation error: isinf not defined
|
||||
#else
|
||||
|
||||
template <class _A1>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isinf(_A1 __x)
|
||||
{
|
||||
return isinf(__x);
|
||||
}
|
||||
|
||||
#undef isinf
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_floating_point<_A1>::value, bool>::type
|
||||
isinf(_A1 __x)
|
||||
{
|
||||
return __libcpp_isinf(__x);
|
||||
}
|
||||
|
||||
#endif // isinf
|
||||
|
||||
// isnan
|
||||
|
||||
#ifndef isnan
|
||||
#error Implementation error: isnan not defined
|
||||
#else
|
||||
|
||||
template <class _A1>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isnan(_A1 __x)
|
||||
{
|
||||
return isnan(__x);
|
||||
}
|
||||
|
||||
#undef isnan
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_floating_point<_A1>::value, bool>::type
|
||||
isnan(_A1 __x)
|
||||
{
|
||||
return __libcpp_isnan(__x);
|
||||
}
|
||||
|
||||
#endif // isnan
|
||||
|
||||
// isnormal
|
||||
|
||||
#ifndef isnormal
|
||||
#error Implementation error: isnormal not defined
|
||||
#else
|
||||
|
||||
template <class _A1>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isnormal(_A1 __x)
|
||||
{
|
||||
return isnormal(__x);
|
||||
}
|
||||
|
||||
#undef isnormal
|
||||
|
||||
template <class _A1>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<is_floating_point<_A1>::value, bool>::type
|
||||
isnormal(_A1 __x)
|
||||
{
|
||||
return __libcpp_isnormal(__x);
|
||||
}
|
||||
|
||||
#endif // isnormal
|
||||
|
||||
// isgreater
|
||||
|
||||
#ifndef isgreater
|
||||
#error Implementation error: isgreater not defined
|
||||
#else
|
||||
|
||||
template <class _A1, class _A2>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isgreater(_A1 __x, _A2 __y)
|
||||
{
|
||||
return isgreater(__x, __y);
|
||||
}
|
||||
|
||||
#undef isgreater
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_floating_point<_A1>::value &&
|
||||
is_floating_point<_A2>::value,
|
||||
bool
|
||||
>::type
|
||||
isgreater(_A1 __x, _A2 __y)
|
||||
{
|
||||
return __libcpp_isgreater(__x, __y);
|
||||
}
|
||||
|
||||
#endif // isgreater
|
||||
|
||||
// isgreaterequal
|
||||
|
||||
#ifndef isgreaterequal
|
||||
#error Implementation error: isgreaterequal not defined
|
||||
#else
|
||||
|
||||
template <class _A1, class _A2>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isgreaterequal(_A1 __x, _A2 __y)
|
||||
{
|
||||
return isgreaterequal(__x, __y);
|
||||
}
|
||||
|
||||
#undef isgreaterequal
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_floating_point<_A1>::value &&
|
||||
is_floating_point<_A2>::value,
|
||||
bool
|
||||
>::type
|
||||
isgreaterequal(_A1 __x, _A2 __y)
|
||||
{
|
||||
return __libcpp_isgreaterequal(__x, __y);
|
||||
}
|
||||
|
||||
#endif // isgreaterequal
|
||||
|
||||
// isless
|
||||
|
||||
#ifndef isless
|
||||
#error Implementation error: isless not defined
|
||||
#else
|
||||
|
||||
template <class _A1, class _A2>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isless(_A1 __x, _A2 __y)
|
||||
{
|
||||
return isless(__x, __y);
|
||||
}
|
||||
|
||||
#undef isless
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_floating_point<_A1>::value &&
|
||||
is_floating_point<_A2>::value,
|
||||
bool
|
||||
>::type
|
||||
isless(_A1 __x, _A2 __y)
|
||||
{
|
||||
return __libcpp_isless(__x, __y);
|
||||
}
|
||||
|
||||
#endif // isless
|
||||
|
||||
// islessequal
|
||||
|
||||
#ifndef islessequal
|
||||
#error Implementation error: islessequal not defined
|
||||
#else
|
||||
|
||||
template <class _A1, class _A2>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_islessequal(_A1 __x, _A2 __y)
|
||||
{
|
||||
return islessequal(__x, __y);
|
||||
}
|
||||
|
||||
#undef islessequal
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_floating_point<_A1>::value &&
|
||||
is_floating_point<_A2>::value,
|
||||
bool
|
||||
>::type
|
||||
islessequal(_A1 __x, _A2 __y)
|
||||
{
|
||||
return __libcpp_islessequal(__x, __y);
|
||||
}
|
||||
|
||||
#endif // islessequal
|
||||
|
||||
// islessgreater
|
||||
|
||||
#ifndef islessgreater
|
||||
#error Implementation error: islessgreater not defined
|
||||
#else
|
||||
|
||||
template <class _A1, class _A2>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_islessgreater(_A1 __x, _A2 __y)
|
||||
{
|
||||
return islessgreater(__x, __y);
|
||||
}
|
||||
|
||||
#undef islessgreater
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_floating_point<_A1>::value &&
|
||||
is_floating_point<_A2>::value,
|
||||
bool
|
||||
>::type
|
||||
islessgreater(_A1 __x, _A2 __y)
|
||||
{
|
||||
return __libcpp_islessgreater(__x, __y);
|
||||
}
|
||||
|
||||
#endif // islessgreater
|
||||
|
||||
// isunordered
|
||||
|
||||
#ifndef isunordered
|
||||
#error Implementation error: isunordered not defined
|
||||
#else
|
||||
|
||||
template <class _A1, class _A2>
|
||||
_LIBCPP_ALWAYS_INLINE
|
||||
bool
|
||||
__libcpp_isunordered(_A1 __x, _A2 __y)
|
||||
{
|
||||
return isunordered(__x, __y);
|
||||
}
|
||||
|
||||
#undef isunordered
|
||||
|
||||
template <class _A1, class _A2>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_floating_point<_A1>::value &&
|
||||
is_floating_point<_A2>::value,
|
||||
bool
|
||||
>::type
|
||||
isunordered(_A1 __x, _A2 __y)
|
||||
{
|
||||
return __libcpp_isunordered(__x, __y);
|
||||
}
|
||||
|
||||
#endif // isunordered
|
||||
|
||||
// acosh
|
||||
|
||||
using ::acosh;
|
||||
|
@@ -603,7 +603,7 @@ copy_backward(_RAIter __f,
|
||||
typedef typename __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2>::pointer pointer;
|
||||
while (__f != __l)
|
||||
{
|
||||
__deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __rp = prev(__r);
|
||||
__deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __rp = _STD::prev(__r);
|
||||
pointer __rb = *__rp.__m_iter_;
|
||||
pointer __re = __rp.__ptr_ + 1;
|
||||
difference_type __bs = __re - __rb;
|
||||
@@ -776,7 +776,7 @@ move_backward(_RAIter __f,
|
||||
typedef typename __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2>::pointer pointer;
|
||||
while (__f != __l)
|
||||
{
|
||||
__deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __rp = prev(__r);
|
||||
__deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __rp = _STD::prev(__r);
|
||||
pointer __rb = *__rp.__m_iter_;
|
||||
pointer __re = __rp.__ptr_ + 1;
|
||||
difference_type __bs = __re - __rb;
|
||||
@@ -1780,14 +1780,14 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, const value_type& __v)
|
||||
{
|
||||
const_pointer __vt = pointer_traits<const_pointer>::pointer_to(__v);
|
||||
iterator __b = __base::begin();
|
||||
iterator __bm1 = prev(__b);
|
||||
iterator __bm1 = _STD::prev(__b);
|
||||
if (__vt == pointer_traits<const_pointer>::pointer_to(*__b))
|
||||
__vt = pointer_traits<const_pointer>::pointer_to(*__bm1);
|
||||
__alloc_traits::construct(__a, _STD::addressof(*__bm1), _STD::move(*__b));
|
||||
--__base::__start_;
|
||||
++__base::size();
|
||||
if (__pos > 1)
|
||||
__b = __move_and_check(next(__b), __b + __pos, __b, __vt);
|
||||
__b = __move_and_check(_STD::next(__b), __b + __pos, __b, __vt);
|
||||
*__b = *__vt;
|
||||
}
|
||||
}
|
||||
@@ -1806,7 +1806,7 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, const value_type& __v)
|
||||
{
|
||||
const_pointer __vt = pointer_traits<const_pointer>::pointer_to(__v);
|
||||
iterator __e = __base::end();
|
||||
iterator __em1 = prev(__e);
|
||||
iterator __em1 = _STD::prev(__e);
|
||||
if (__vt == pointer_traits<const_pointer>::pointer_to(*__em1))
|
||||
__vt = pointer_traits<const_pointer>::pointer_to(*__e);
|
||||
__alloc_traits::construct(__a, _STD::addressof(*__e), _STD::move(*__em1));
|
||||
@@ -1842,12 +1842,12 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, value_type&& __v)
|
||||
else
|
||||
{
|
||||
iterator __b = __base::begin();
|
||||
iterator __bm1 = prev(__b);
|
||||
iterator __bm1 = _STD::prev(__b);
|
||||
__alloc_traits::construct(__a, _STD::addressof(*__bm1), _STD::move(*__b));
|
||||
--__base::__start_;
|
||||
++__base::size();
|
||||
if (__pos > 1)
|
||||
__b = _STD::move(next(__b), __b + __pos, __b);
|
||||
__b = _STD::move(_STD::next(__b), __b + __pos, __b);
|
||||
*__b = _STD::move(__v);
|
||||
}
|
||||
}
|
||||
@@ -1865,7 +1865,7 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, value_type&& __v)
|
||||
else
|
||||
{
|
||||
iterator __e = __base::end();
|
||||
iterator __em1 = prev(__e);
|
||||
iterator __em1 = _STD::prev(__e);
|
||||
__alloc_traits::construct(__a, _STD::addressof(*__e), _STD::move(*__em1));
|
||||
++__base::size();
|
||||
if (__de > 1)
|
||||
@@ -1900,12 +1900,12 @@ deque<_Tp, _Allocator>::emplace(const_iterator __p, _Args&&... __args)
|
||||
else
|
||||
{
|
||||
iterator __b = __base::begin();
|
||||
iterator __bm1 = prev(__b);
|
||||
iterator __bm1 = _STD::prev(__b);
|
||||
__alloc_traits::construct(__a, _STD::addressof(*__bm1), _STD::move(*__b));
|
||||
--__base::__start_;
|
||||
++__base::size();
|
||||
if (__pos > 1)
|
||||
__b = _STD::move(next(__b), __b + __pos, __b);
|
||||
__b = _STD::move(_STD::next(__b), __b + __pos, __b);
|
||||
*__b = value_type(_STD::forward<_Args>(__args)...);
|
||||
}
|
||||
}
|
||||
@@ -1923,7 +1923,7 @@ deque<_Tp, _Allocator>::emplace(const_iterator __p, _Args&&... __args)
|
||||
else
|
||||
{
|
||||
iterator __e = __base::end();
|
||||
iterator __em1 = prev(__e);
|
||||
iterator __em1 = _STD::prev(__e);
|
||||
__alloc_traits::construct(__a, _STD::addressof(*__e), _STD::move(*__em1));
|
||||
++__base::size();
|
||||
if (__de > 1)
|
||||
@@ -2209,7 +2209,7 @@ deque<_Tp, _Allocator>::__add_front_capacity(size_type __n)
|
||||
size_type __nb = __recommend_blocks(__n + __base::__map_.empty());
|
||||
// Number of unused blocks at back:
|
||||
size_type __back_capacity = __back_spare() / __base::__block_size;
|
||||
__back_capacity = min(__back_capacity, __nb); // don't take more than you need
|
||||
__back_capacity = _STD::min(__back_capacity, __nb); // don't take more than you need
|
||||
__nb -= __back_capacity; // number of blocks need to allocate
|
||||
// If __nb == 0, then we have sufficient capacity.
|
||||
if (__nb == 0)
|
||||
@@ -2354,7 +2354,7 @@ deque<_Tp, _Allocator>::__add_back_capacity(size_type __n)
|
||||
size_type __nb = __recommend_blocks(__n + __base::__map_.empty());
|
||||
// Number of unused blocks at front:
|
||||
size_type __front_capacity = __front_spare() / __base::__block_size;
|
||||
__front_capacity = min(__front_capacity, __nb); // don't take more than you need
|
||||
__front_capacity = _STD::min(__front_capacity, __nb); // don't take more than you need
|
||||
__nb -= __front_capacity; // number of blocks need to allocate
|
||||
// If __nb == 0, then we have sufficient capacity.
|
||||
if (__nb == 0)
|
||||
@@ -2608,7 +2608,7 @@ deque<_Tp, _Allocator>::erase(const_iterator __f)
|
||||
allocator_type& __a = __base::__alloc();
|
||||
if (__pos < (__base::size() - 1) / 2)
|
||||
{ // erase from front
|
||||
_STD::move_backward(__b, __p, next(__p));
|
||||
_STD::move_backward(__b, __p, _STD::next(__p));
|
||||
__alloc_traits::destroy(__a, _STD::addressof(*__b));
|
||||
--__base::size();
|
||||
++__base::__start_;
|
||||
@@ -2621,7 +2621,7 @@ deque<_Tp, _Allocator>::erase(const_iterator __f)
|
||||
}
|
||||
else
|
||||
{ // erase from back
|
||||
iterator __i = _STD::move(next(__p), __base::end(), __p);
|
||||
iterator __i = _STD::move(_STD::next(__p), __base::end(), __p);
|
||||
__alloc_traits::destroy(__a, _STD::addressof(*__i));
|
||||
--__base::size();
|
||||
if (__back_spare() >= 2 * __base::__block_size)
|
||||
|
@@ -871,7 +871,7 @@ typename enable_if
|
||||
forward_list<_Tp, _Alloc>::assign(_InputIterator __f, _InputIterator __l)
|
||||
{
|
||||
iterator __i = before_begin();
|
||||
iterator __j = next(__i);
|
||||
iterator __j = _STD::next(__i);
|
||||
iterator __e = end();
|
||||
for (; __j != __e && __f != __l; ++__i, ++__j, ++__f)
|
||||
*__j = *__f;
|
||||
@@ -886,7 +886,7 @@ void
|
||||
forward_list<_Tp, _Alloc>::assign(size_type __n, const value_type& __v)
|
||||
{
|
||||
iterator __i = before_begin();
|
||||
iterator __j = next(__i);
|
||||
iterator __j = _STD::next(__i);
|
||||
iterator __e = end();
|
||||
for (; __j != __e && __n > 0; --__n, ++__i, ++__j)
|
||||
*__j = __v;
|
||||
@@ -1235,7 +1235,7 @@ forward_list<_Tp, _Alloc>::splice_after(const_iterator __p,
|
||||
forward_list& __x,
|
||||
const_iterator __i)
|
||||
{
|
||||
const_iterator __lm1 = next(__i);
|
||||
const_iterator __lm1 = _STD::next(__i);
|
||||
if (__p != __i && __p != __lm1)
|
||||
{
|
||||
const_cast<__node_pointer>(__i.__ptr_)->__next_ =
|
||||
@@ -1312,7 +1312,7 @@ forward_list<_Tp, _Alloc>::remove(const value_type& __v)
|
||||
{
|
||||
if (__i.__ptr_->__next_->__value_ == __v)
|
||||
{
|
||||
iterator __j = next(__i, 2);
|
||||
iterator __j = _STD::next(__i, 2);
|
||||
for (; __j != __e && *__j == __v; ++__j)
|
||||
;
|
||||
erase_after(__i, __j);
|
||||
@@ -1335,7 +1335,7 @@ forward_list<_Tp, _Alloc>::remove_if(_Predicate __pred)
|
||||
{
|
||||
if (__pred(__i.__ptr_->__next_->__value_))
|
||||
{
|
||||
iterator __j = next(__i, 2);
|
||||
iterator __j = _STD::next(__i, 2);
|
||||
for (; __j != __e && __pred(*__j); ++__j)
|
||||
;
|
||||
erase_after(__i, __j);
|
||||
@@ -1355,7 +1355,7 @@ forward_list<_Tp, _Alloc>::unique(_BinaryPredicate __binary_pred)
|
||||
{
|
||||
for (iterator __i = begin(), __e = end(); __i != __e;)
|
||||
{
|
||||
iterator __j = next(__i);
|
||||
iterator __j = _STD::next(__i);
|
||||
for (; __j != __e && __binary_pred(*__i, *__j); ++__j)
|
||||
;
|
||||
if (__i.__ptr_->__next_ != __j.__ptr_)
|
||||
@@ -1456,7 +1456,7 @@ forward_list<_Tp, _Alloc>::__sort(__node_pointer __f1, difference_type __sz,
|
||||
}
|
||||
difference_type __sz1 = __sz / 2;
|
||||
difference_type __sz2 = __sz - __sz1;
|
||||
__node_pointer __t = next(iterator(__f1), __sz1 - 1).__ptr_;
|
||||
__node_pointer __t = _STD::next(iterator(__f1), __sz1 - 1).__ptr_;
|
||||
__node_pointer __f2 = __t->__next_;
|
||||
__t->__next_ = nullptr;
|
||||
return __merge(__sort(__f1, __sz1, __comp),
|
||||
|
@@ -587,7 +587,7 @@ basic_filebuf<_CharT, _Traits>::underflow()
|
||||
memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
|
||||
__extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_);
|
||||
__extbufend_ = __extbuf_ + (__extbuf_ == __extbuf_min_ ? sizeof(__extbuf_min_) : __ebs_);
|
||||
size_t __nmemb = min(static_cast<size_t>(this->egptr() - this->eback() - __unget_sz),
|
||||
size_t __nmemb = _STD::min(static_cast<size_t>(this->egptr() - this->eback() - __unget_sz),
|
||||
static_cast<size_t>(__extbufend_ - __extbufnext_));
|
||||
codecvt_base::result __r;
|
||||
state_type __svs = __st_;
|
||||
|
@@ -1510,21 +1510,12 @@ __mu(reference_wrapper<_Tp> __t, _Uj&)
|
||||
return __t.get();
|
||||
}
|
||||
|
||||
template <bool _IsBindExpr, class _Ti, class ..._Uj>
|
||||
struct __mu_return1 {};
|
||||
|
||||
template <class _Ti, class ..._Uj>
|
||||
struct __mu_return1<true, _Ti, _Uj...>
|
||||
{
|
||||
typedef typename result_of<_Ti(_Uj...)>::type type;
|
||||
};
|
||||
|
||||
template <class _Ti, class ..._Uj, size_t ..._Indx>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename __mu_return1<true, _Ti, _Uj...>::type
|
||||
__mu_expand(_Ti& __ti, tuple<_Uj...>&& __uj, __tuple_indices<_Indx...>)
|
||||
typename __invoke_of<_Ti&, _Uj...>::type
|
||||
__mu_expand(_Ti& __ti, tuple<_Uj...>& __uj, __tuple_indices<_Indx...>)
|
||||
{
|
||||
return __ti(_STD::forward<typename tuple_element<_Indx, _Uj>::type>(get<_Indx>(__uj))...);
|
||||
return __ti(_STD::forward<_Uj>(get<_Indx>(__uj))...);
|
||||
}
|
||||
|
||||
template <class _Ti, class ..._Uj>
|
||||
@@ -1532,7 +1523,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_bind_expression<_Ti>::value,
|
||||
typename __mu_return1<is_bind_expression<_Ti>::value, _Ti, _Uj...>::type
|
||||
typename __invoke_of<_Ti&, _Uj...>::type
|
||||
>::type
|
||||
__mu(_Ti& __ti, tuple<_Uj...>& __uj)
|
||||
{
|
||||
@@ -1576,24 +1567,31 @@ __mu(_Ti& __ti, _Uj& __uj)
|
||||
return __ti;
|
||||
}
|
||||
|
||||
template <class _Ti, bool IsBindEx, bool IsPh, class _TupleUj>
|
||||
template <class _Ti, bool IsReferenceWrapper, bool IsBindEx, bool IsPh,
|
||||
class _TupleUj>
|
||||
struct ____mu_return;
|
||||
|
||||
template <class _Ti, class ..._Uj>
|
||||
struct ____mu_return<_Ti, true, false, tuple<_Uj...> >
|
||||
struct ____mu_return<_Ti, false, true, false, tuple<_Uj...> >
|
||||
{
|
||||
typedef typename result_of<_Ti(_Uj...)>::type type;
|
||||
typedef typename __invoke_of<_Ti&, _Uj...>::type type;
|
||||
};
|
||||
|
||||
template <class _Ti, class _TupleUj>
|
||||
struct ____mu_return<_Ti, false, true, _TupleUj>
|
||||
struct ____mu_return<_Ti, false, false, true, _TupleUj>
|
||||
{
|
||||
typedef typename tuple_element<is_placeholder<_Ti>::value - 1,
|
||||
_TupleUj>::type&& type;
|
||||
};
|
||||
|
||||
template <class _Ti, class _TupleUj>
|
||||
struct ____mu_return<_Ti, false, false, _TupleUj>
|
||||
struct ____mu_return<_Ti, true, false, false, _TupleUj>
|
||||
{
|
||||
typedef typename _Ti::type& type;
|
||||
};
|
||||
|
||||
template <class _Ti, class _TupleUj>
|
||||
struct ____mu_return<_Ti, false, false, false, _TupleUj>
|
||||
{
|
||||
typedef _Ti& type;
|
||||
};
|
||||
@@ -1601,25 +1599,20 @@ struct ____mu_return<_Ti, false, false, _TupleUj>
|
||||
template <class _Ti, class _TupleUj>
|
||||
struct __mu_return
|
||||
: public ____mu_return<_Ti,
|
||||
__is_reference_wrapper<_Ti>::value,
|
||||
is_bind_expression<_Ti>::value,
|
||||
0 < is_placeholder<_Ti>::value,
|
||||
_TupleUj>
|
||||
{
|
||||
};
|
||||
|
||||
template <class _Ti, class _TupleUj>
|
||||
struct __mu_return<reference_wrapper<_Ti>, _TupleUj>
|
||||
{
|
||||
typedef _Ti& type;
|
||||
};
|
||||
|
||||
template <class _F, class _BoundArgs, class _TupleUj>
|
||||
struct __bind_return;
|
||||
|
||||
template <class _F, class ..._BoundArgs, class _TupleUj>
|
||||
struct __bind_return<_F, tuple<_BoundArgs...>, _TupleUj>
|
||||
{
|
||||
typedef typename __invoke_return
|
||||
typedef typename __invoke_of
|
||||
<
|
||||
_F&,
|
||||
typename __mu_return
|
||||
@@ -1633,7 +1626,7 @@ struct __bind_return<_F, tuple<_BoundArgs...>, _TupleUj>
|
||||
template <class _F, class ..._BoundArgs, class _TupleUj>
|
||||
struct __bind_return<_F, const tuple<_BoundArgs...>, _TupleUj>
|
||||
{
|
||||
typedef typename __invoke_return
|
||||
typedef typename __invoke_of
|
||||
<
|
||||
_F&,
|
||||
typename __mu_return
|
||||
@@ -1655,10 +1648,12 @@ __apply_functor(_F& __f, _BoundArgs& __bound_args, __tuple_indices<_Indx...>,
|
||||
|
||||
template<class _F, class ..._BoundArgs>
|
||||
class __bind
|
||||
: public __weak_result_type<_F>
|
||||
: public __weak_result_type<typename decay<_F>::type>
|
||||
{
|
||||
_F __f_;
|
||||
tuple<_BoundArgs...> __bound_args_;
|
||||
typedef typename decay<_F>::type _Fd;
|
||||
typedef tuple<typename decay<_BoundArgs>::type...> _Td;
|
||||
_Fd __f_;
|
||||
_Td __bound_args_;
|
||||
|
||||
typedef typename __make_tuple_indices<sizeof...(_BoundArgs)>::type __indices;
|
||||
public:
|
||||
@@ -1675,17 +1670,16 @@ public:
|
||||
|
||||
template <class ..._Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename __bind_return<_F, tuple<_BoundArgs...>, tuple<_Args&&...> >::type
|
||||
typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type
|
||||
operator()(_Args&& ...__args)
|
||||
{
|
||||
// compiler bug workaround
|
||||
return __apply_functor(__f_, __bound_args_, __indices(),
|
||||
tuple<_Args&&...>(_STD::forward<_Args>(__args)...));
|
||||
}
|
||||
|
||||
template <class ..._Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename __bind_return<_F, tuple<_BoundArgs...>, tuple<_Args&&...> >::type
|
||||
typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type
|
||||
operator()(_Args&& ...__args) const
|
||||
{
|
||||
return __apply_functor(__f_, __bound_args_, __indices(),
|
||||
@@ -1704,6 +1698,10 @@ class __bind_r
|
||||
public:
|
||||
typedef _R result_type;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__bind_r(__bind_r&& __b)
|
||||
: base(_STD::forward<base>(__b)) {}
|
||||
|
||||
template <class _G, class ..._BA>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __bind_r(_G&& __f, _BA&& ...__bound_args)
|
||||
@@ -1732,19 +1730,19 @@ struct __is_bind_expression<__bind_r<_R, _F, _BoundArgs...> > : public true_type
|
||||
|
||||
template<class _F, class ..._BoundArgs>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__bind<typename decay<_F>::type, typename decay<_BoundArgs>::type...>
|
||||
__bind<_F, _BoundArgs...>
|
||||
bind(_F&& __f, _BoundArgs&&... __bound_args)
|
||||
{
|
||||
typedef __bind<typename decay<_F>::type, typename decay<_BoundArgs>::type...> type;
|
||||
typedef __bind<_F, _BoundArgs...> type;
|
||||
return type(_STD::forward<_F>(__f), _STD::forward<_BoundArgs>(__bound_args)...);
|
||||
}
|
||||
|
||||
template<class _R, class _F, class ..._BoundArgs>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__bind_r<_R, typename decay<_F>::type, typename decay<_BoundArgs>::type...>
|
||||
__bind_r<_R, _F, _BoundArgs...>
|
||||
bind(_F&& __f, _BoundArgs&&... __bound_args)
|
||||
{
|
||||
typedef __bind_r<_R, typename decay<_F>::type, typename decay<_BoundArgs>::type...> type;
|
||||
typedef __bind_r<_R, _F, _BoundArgs...> type;
|
||||
return type(_STD::forward<_F>(__f), _STD::forward<_BoundArgs>(__bound_args)...);
|
||||
}
|
||||
|
||||
|
208
include/future
208
include/future
@@ -858,6 +858,115 @@ __deferred_assoc_state<void, _F>::__execute()
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
|
||||
template <class _R, class _F>
|
||||
class __async_assoc_state
|
||||
: public __assoc_state<_R>
|
||||
{
|
||||
typedef __assoc_state<_R> base;
|
||||
|
||||
_F __func_;
|
||||
|
||||
virtual void __on_zero_shared();
|
||||
public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
explicit __async_assoc_state(_F&& __f);
|
||||
#endif
|
||||
|
||||
virtual void __execute();
|
||||
};
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class _R, class _F>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__async_assoc_state<_R, _F>::__async_assoc_state(_F&& __f)
|
||||
: __func_(_STD::forward<_F>(__f))
|
||||
{
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class _R, class _F>
|
||||
void
|
||||
__async_assoc_state<_R, _F>::__execute()
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
try
|
||||
{
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
this->set_value(__func_());
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
this->set_exception(current_exception());
|
||||
}
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
|
||||
template <class _R, class _F>
|
||||
void
|
||||
__async_assoc_state<_R, _F>::__on_zero_shared()
|
||||
{
|
||||
this->wait();
|
||||
base::__on_zero_shared();
|
||||
}
|
||||
|
||||
template <class _F>
|
||||
class __async_assoc_state<void, _F>
|
||||
: public __assoc_sub_state
|
||||
{
|
||||
typedef __assoc_sub_state base;
|
||||
|
||||
_F __func_;
|
||||
|
||||
virtual void __on_zero_shared();
|
||||
public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
explicit __async_assoc_state(_F&& __f);
|
||||
#endif
|
||||
|
||||
virtual void __execute();
|
||||
};
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class _F>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__async_assoc_state<void, _F>::__async_assoc_state(_F&& __f)
|
||||
: __func_(_STD::forward<_F>(__f))
|
||||
{
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class _F>
|
||||
void
|
||||
__async_assoc_state<void, _F>::__execute()
|
||||
{
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
try
|
||||
{
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
__func_();
|
||||
this->set_value();
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
this->set_exception(current_exception());
|
||||
}
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
|
||||
template <class _F>
|
||||
void
|
||||
__async_assoc_state<void, _F>::__on_zero_shared()
|
||||
{
|
||||
this->wait();
|
||||
base::__on_zero_shared();
|
||||
}
|
||||
|
||||
template <class> class promise;
|
||||
template <class> class shared_future;
|
||||
template <class> class atomic_future;
|
||||
@@ -874,6 +983,14 @@ __make_deferred_assoc_state(_F&& __f);
|
||||
__make_deferred_assoc_state(_F __f);
|
||||
#endif
|
||||
|
||||
template <class _R, class _F>
|
||||
future<_R>
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
__make_async_assoc_state(_F&& __f);
|
||||
#else
|
||||
__make_async_assoc_state(_F __f);
|
||||
#endif
|
||||
|
||||
template <class _R>
|
||||
class _LIBCPP_VISIBLE future
|
||||
{
|
||||
@@ -885,11 +1002,16 @@ class _LIBCPP_VISIBLE future
|
||||
template <class> friend class shared_future;
|
||||
template <class> friend class atomic_future;
|
||||
|
||||
template <class _R1, class _F>
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
template <class _R1, class _F>
|
||||
friend future<_R1> __make_deferred_assoc_state(_F&& __f);
|
||||
template <class _R1, class _F>
|
||||
friend future<_R1> __make_async_assoc_state(_F&& __f);
|
||||
#else
|
||||
template <class _R1, class _F>
|
||||
friend future<_R1> __make_deferred_assoc_state(_F __f);
|
||||
template <class _R1, class _F>
|
||||
friend future<_R1> __make_async_assoc_state(_F __f);
|
||||
#endif
|
||||
|
||||
public:
|
||||
@@ -983,11 +1105,16 @@ class _LIBCPP_VISIBLE future<_R&>
|
||||
template <class> friend class shared_future;
|
||||
template <class> friend class atomic_future;
|
||||
|
||||
template <class _R1, class _F>
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
template <class _R1, class _F>
|
||||
friend future<_R1> __make_deferred_assoc_state(_F&& __f);
|
||||
template <class _R1, class _F>
|
||||
friend future<_R1> __make_async_assoc_state(_F&& __f);
|
||||
#else
|
||||
template <class _R1, class _F>
|
||||
friend future<_R1> __make_deferred_assoc_state(_F __f);
|
||||
template <class _R1, class _F>
|
||||
friend future<_R1> __make_async_assoc_state(_F __f);
|
||||
#endif
|
||||
|
||||
public:
|
||||
@@ -1076,11 +1203,16 @@ class _LIBCPP_VISIBLE future<void>
|
||||
template <class> friend class shared_future;
|
||||
template <class> friend class atomic_future;
|
||||
|
||||
template <class _R1, class _F>
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
template <class _R1, class _F>
|
||||
friend future<_R1> __make_deferred_assoc_state(_F&& __f);
|
||||
template <class _R1, class _F>
|
||||
friend future<_R1> __make_async_assoc_state(_F&& __f);
|
||||
#else
|
||||
template <class _R1, class _F>
|
||||
friend future<_R1> __make_deferred_assoc_state(_F __f);
|
||||
template <class _R1, class _F>
|
||||
friend future<_R1> __make_async_assoc_state(_F __f);
|
||||
#endif
|
||||
|
||||
public:
|
||||
@@ -2034,36 +2166,72 @@ __make_deferred_assoc_state(_F __f)
|
||||
return future<_R>(__h.get());
|
||||
}
|
||||
|
||||
template <class _R, class _F>
|
||||
future<_R>
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
__make_async_assoc_state(_F&& __f)
|
||||
#else
|
||||
__make_async_assoc_state(_F __f)
|
||||
#endif
|
||||
{
|
||||
unique_ptr<__async_assoc_state<_R, _F>, __release_shared_count>
|
||||
__h(new __async_assoc_state<_R, _F>(_STD::forward<_F>(__f)));
|
||||
_STD::thread(&__async_assoc_state<_R, _F>::__execute, __h.get()).detach();
|
||||
return future<_R>(__h.get());
|
||||
}
|
||||
|
||||
template <class _F, class... _Args>
|
||||
future<typename result_of<_F(_Args...)>::type>
|
||||
class __async_func
|
||||
{
|
||||
tuple<_F, _Args...> __f_;
|
||||
|
||||
public:
|
||||
typedef typename __invoke_of<_F, _Args...>::type _R;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __async_func(_F&& __f, _Args&&... __args)
|
||||
: __f_(_STD::move(__f), _STD::move(__args)...) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__async_func(__async_func&& __f) : __f_(_STD::move(__f.__f_)) {}
|
||||
|
||||
_R operator()()
|
||||
{
|
||||
typedef typename __make_tuple_indices<1+sizeof...(_Args), 1>::type _Index;
|
||||
return __execute(_Index());
|
||||
}
|
||||
private:
|
||||
template <size_t ..._Indices>
|
||||
_R
|
||||
__execute(__tuple_indices<_Indices...>)
|
||||
{
|
||||
return __invoke(_STD::move(_STD::get<0>(__f_)), _STD::move(_STD::get<_Indices>(__f_))...);
|
||||
}
|
||||
};
|
||||
|
||||
template <class _F, class... _Args>
|
||||
future<typename __invoke_of<typename decay<_F>::type, typename decay<_Args>::type...>::type>
|
||||
async(launch __policy, _F&& __f, _Args&&... __args)
|
||||
{
|
||||
typedef typename result_of<_F(_Args...)>::type _R;
|
||||
typedef __async_func<typename decay<_F>::type, typename decay<_Args>::type...> _BF;
|
||||
typedef typename _BF::_R _R;
|
||||
future<_R> __r;
|
||||
if (__policy & launch::async)
|
||||
{
|
||||
packaged_task<_R()> __pk(bind(_STD::forward<_F>(__f),
|
||||
_STD::forward<_Args>(__args)...));
|
||||
__r = __pk.get_future();
|
||||
thread(_STD::move(__pk)).detach();
|
||||
}
|
||||
__r = _STD::__make_async_assoc_state<_R>(_BF(__decay_copy(_STD::forward<_F>(__f)),
|
||||
__decay_copy(_STD::forward<_Args>(__args))...));
|
||||
else if (__policy & launch::deferred)
|
||||
__r = _STD::__make_deferred_assoc_state<_R>(bind(_STD::forward<_F>(__f),
|
||||
_STD::forward<_Args>(__args)...));
|
||||
__r = _STD::__make_deferred_assoc_state<_R>(_BF(__decay_copy(_STD::forward<_F>(__f)),
|
||||
__decay_copy(_STD::forward<_Args>(__args))...));
|
||||
return __r;
|
||||
}
|
||||
|
||||
template <class _F, class... _Args>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
!is_same<typename decay<_F>::type, launch>::value,
|
||||
future<typename result_of<_F(_Args...)>::type>
|
||||
>::type
|
||||
future<typename __invoke_of<typename decay<_F>::type, typename decay<_Args>::type...>::type>
|
||||
async(_F&& __f, _Args&&... __args)
|
||||
{
|
||||
return async(launch::any, _STD::forward<_F>(__f),
|
||||
_STD::forward<_Args>(__args)...);
|
||||
return _STD::async(launch::any, _STD::forward<_F>(__f),
|
||||
_STD::forward<_Args>(__args)...);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
@@ -20,6 +20,7 @@ namespace std
|
||||
template<class charT> struct char_traits;
|
||||
template<class T> class allocator;
|
||||
|
||||
class ios_base;
|
||||
template <class charT, class traits = char_traits<charT> > class basic_ios;
|
||||
|
||||
template <class charT, class traits = char_traits<charT> > class basic_streambuf;
|
||||
|
@@ -801,6 +801,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is, _CharT& __c)
|
||||
typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
|
||||
if (__sen)
|
||||
{
|
||||
#if 1
|
||||
typename _Traits::int_type __i = __is.rdbuf()->sbumpc();
|
||||
if (_Traits::eq_int_type(__i, _Traits::eof()))
|
||||
__is.setstate(ios_base::eofbit | ios_base::failbit);
|
||||
else
|
||||
__c = _Traits::to_char_type(__i);
|
||||
#else
|
||||
typedef istreambuf_iterator<_CharT, _Traits> _I;
|
||||
_I __i(__is);
|
||||
_I __eof;
|
||||
@@ -812,6 +819,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, _CharT& __c)
|
||||
}
|
||||
else
|
||||
__is.setstate(ios_base::eofbit | ios_base::failbit);
|
||||
#endif
|
||||
}
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
@@ -1265,7 +1273,7 @@ basic_istream<_CharT, _Traits>::readsome(char_type* __s, streamsize __n)
|
||||
case 0:
|
||||
break;
|
||||
default:
|
||||
__c = min(__c, __n);
|
||||
__c = _STD::min(__c, __n);
|
||||
for (streamsize __k = 0; __k < __c; ++__k, ++__s, ++__i)
|
||||
*__s = *__i;
|
||||
}
|
||||
|
@@ -488,7 +488,7 @@ next(_ForwardIter __x,
|
||||
typename iterator_traits<_ForwardIter>::difference_type __n = 1,
|
||||
typename enable_if<__is_forward_iterator<_ForwardIter>::value>::type* = 0)
|
||||
{
|
||||
advance(__x, __n);
|
||||
_STD::advance(__x, __n);
|
||||
return __x;
|
||||
}
|
||||
|
||||
@@ -499,7 +499,7 @@ prev(_BidiretionalIter __x,
|
||||
typename iterator_traits<_BidiretionalIter>::difference_type __n = 1,
|
||||
typename enable_if<__is_bidirectional_iterator<_BidiretionalIter>::value>::type* = 0)
|
||||
{
|
||||
advance(__x, -__n);
|
||||
_STD::advance(__x, -__n);
|
||||
return __x;
|
||||
}
|
||||
|
||||
|
26
include/list
26
include/list
@@ -714,8 +714,8 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename list<_Tp, _Alloc>::iterator
|
||||
list<_Tp, _Alloc>::__iterator(size_type __n)
|
||||
{
|
||||
return __n <= base::__sz() / 2 ? next(begin(), __n)
|
||||
: prev(end(), base::__sz() - __n);
|
||||
return __n <= base::__sz() / 2 ? _STD::next(begin(), __n)
|
||||
: _STD::prev(end(), base::__sz() - __n);
|
||||
}
|
||||
|
||||
template <class _Tp, class _Alloc>
|
||||
@@ -1321,7 +1321,7 @@ template <class _Tp, class _Alloc>
|
||||
void
|
||||
list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __i)
|
||||
{
|
||||
if (__p != __i && __p != next(__i))
|
||||
if (__p != __i && __p != _STD::next(__i))
|
||||
{
|
||||
__node& __f = const_cast<__node&>(*__i.__ptr_);
|
||||
base::__unlink_nodes(__f, __f);
|
||||
@@ -1359,7 +1359,7 @@ list<_Tp, _Alloc>::remove(const value_type& __x)
|
||||
{
|
||||
if (*__i == __x)
|
||||
{
|
||||
iterator __j = next(__i);
|
||||
iterator __j = _STD::next(__i);
|
||||
for (; __j != __e && *__j == __x; ++__j)
|
||||
;
|
||||
__i = erase(__i, __j);
|
||||
@@ -1378,7 +1378,7 @@ list<_Tp, _Alloc>::remove_if(_Pred __pred)
|
||||
{
|
||||
if (__pred(*__i))
|
||||
{
|
||||
iterator __j = next(__i);
|
||||
iterator __j = _STD::next(__i);
|
||||
for (; __j != __e && __pred(*__j); ++__j)
|
||||
;
|
||||
__i = erase(__i, __j);
|
||||
@@ -1403,7 +1403,7 @@ list<_Tp, _Alloc>::unique(_BinaryPred __binary_pred)
|
||||
{
|
||||
for (iterator __i = begin(), __e = end(); __i != __e;)
|
||||
{
|
||||
iterator __j = next(__i);
|
||||
iterator __j = _STD::next(__i);
|
||||
for (; __j != __e && __binary_pred(*__i, *__j); ++__j)
|
||||
;
|
||||
if (++__i != __j)
|
||||
@@ -1435,7 +1435,7 @@ list<_Tp, _Alloc>::merge(list& __c, _Comp __comp)
|
||||
if (__comp(*__f2, *__f1))
|
||||
{
|
||||
size_type __ds = 1;
|
||||
iterator __m2 = next(__f2);
|
||||
iterator __m2 = _STD::next(__f2);
|
||||
for (; __m2 != __e2 && __comp(*__m2, *__f1); ++__m2, ++__ds)
|
||||
;
|
||||
base::__sz() += __ds;
|
||||
@@ -1444,7 +1444,7 @@ list<_Tp, _Alloc>::merge(list& __c, _Comp __comp)
|
||||
__node& __l = *__m2.__ptr_->__prev_;
|
||||
__f2 = __m2;
|
||||
base::__unlink_nodes(__f, __l);
|
||||
__m2 = next(__f1);
|
||||
__m2 = _STD::next(__f1);
|
||||
__link_nodes(*__f1.__ptr_, __f, __l);
|
||||
__f1 = __m2;
|
||||
}
|
||||
@@ -1493,12 +1493,12 @@ list<_Tp, _Alloc>::__sort(iterator __f1, iterator __e2, size_type __n, _Comp& __
|
||||
return __f1;
|
||||
}
|
||||
size_type __n2 = __n / 2;
|
||||
iterator __e1 = next(__f1, __n2);
|
||||
iterator __e1 = _STD::next(__f1, __n2);
|
||||
iterator __r = __f1 = __sort(__f1, __e1, __n2, __comp);
|
||||
iterator __f2 = __e1 = __sort(__e1, __e2, __n - __n2, __comp);
|
||||
if (__comp(*__f2, *__f1))
|
||||
{
|
||||
iterator __m2 = next(__f2);
|
||||
iterator __m2 = _STD::next(__f2);
|
||||
for (; __m2 != __e2 && __comp(*__m2, *__f1); ++__m2)
|
||||
;
|
||||
__node& __f = *__f2.__ptr_;
|
||||
@@ -1506,7 +1506,7 @@ list<_Tp, _Alloc>::__sort(iterator __f1, iterator __e2, size_type __n, _Comp& __
|
||||
__r = __f2;
|
||||
__e1 = __f2 = __m2;
|
||||
base::__unlink_nodes(__f, __l);
|
||||
__m2 = next(__f1);
|
||||
__m2 = _STD::next(__f1);
|
||||
__link_nodes(*__f1.__ptr_, __f, __l);
|
||||
__f1 = __m2;
|
||||
}
|
||||
@@ -1516,7 +1516,7 @@ list<_Tp, _Alloc>::__sort(iterator __f1, iterator __e2, size_type __n, _Comp& __
|
||||
{
|
||||
if (__comp(*__f2, *__f1))
|
||||
{
|
||||
iterator __m2 = next(__f2);
|
||||
iterator __m2 = _STD::next(__f2);
|
||||
for (; __m2 != __e2 && __comp(*__m2, *__f1); ++__m2)
|
||||
;
|
||||
__node& __f = *__f2.__ptr_;
|
||||
@@ -1525,7 +1525,7 @@ list<_Tp, _Alloc>::__sort(iterator __f1, iterator __e2, size_type __n, _Comp& __
|
||||
__e1 = __m2;
|
||||
__f2 = __m2;
|
||||
base::__unlink_nodes(__f, __l);
|
||||
__m2 = next(__f1);
|
||||
__m2 = _STD::next(__f1);
|
||||
__link_nodes(*__f1.__ptr_, __f, __l);
|
||||
__f1 = __m2;
|
||||
}
|
||||
|
@@ -522,6 +522,12 @@ __num_get<_CharT>::__stage2_int_loop(_CharT __ct, int __base, char* __a, char*&
|
||||
unsigned& __dc, _CharT __thousands_sep, const string& __grouping,
|
||||
unsigned* __g, unsigned*& __g_end, _CharT* __atoms)
|
||||
{
|
||||
if (__a_end == __a && (__ct == __atoms[24] || __ct == __atoms[25]))
|
||||
{
|
||||
*__a_end++ = __ct == __atoms[24] ? '+' : '-';
|
||||
__dc = 0;
|
||||
return 0;
|
||||
}
|
||||
if (__ct == __thousands_sep && __grouping.size() != 0)
|
||||
{
|
||||
if (__g_end-__g < __num_get_buf_sz)
|
||||
@@ -532,22 +538,28 @@ __num_get<_CharT>::__stage2_int_loop(_CharT __ct, int __base, char* __a, char*&
|
||||
return 0;
|
||||
}
|
||||
ptrdiff_t __f = find(__atoms, __atoms + 26, __ct) - __atoms;
|
||||
if (__f >= 26)
|
||||
if (__f >= 24)
|
||||
return -1;
|
||||
if (__a_end-__a < __num_get_buf_sz - 1)
|
||||
*__a_end++ = __src[__f];
|
||||
switch (__base)
|
||||
{
|
||||
case 8:
|
||||
case 10:
|
||||
if (__f >= __base)
|
||||
return 0;
|
||||
return -1;
|
||||
break;
|
||||
default:
|
||||
if (__f >= 22)
|
||||
case 16:
|
||||
if (__f < 22)
|
||||
break;
|
||||
if (__a_end != __a && __a_end - __a <= 2 && __a_end[-1] == '0')
|
||||
{
|
||||
__dc = 0;
|
||||
*__a_end++ = __src[__f];
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
if (__a_end-__a < __num_get_buf_sz - 1)
|
||||
*__a_end++ = __src[__f];
|
||||
++__dc;
|
||||
return 0;
|
||||
}
|
||||
@@ -733,22 +745,27 @@ __num_get_signed_integral(const char* __a, const char* __a_end,
|
||||
{
|
||||
if (__a != __a_end)
|
||||
{
|
||||
int __save_errno = errno;
|
||||
errno = 0;
|
||||
char *__p2;
|
||||
long long __ll = strtoll_l(__a, &__p2, __base, 0);
|
||||
int __current_errno = errno;
|
||||
if (__current_errno == 0)
|
||||
errno = __save_errno;
|
||||
if (__p2 != __a_end)
|
||||
{
|
||||
__err = ios_base::failbit;
|
||||
return 0;
|
||||
}
|
||||
else if (__ll > numeric_limits<_Tp>::max())
|
||||
else if (__current_errno == ERANGE ||
|
||||
__ll < numeric_limits<_Tp>::min() ||
|
||||
numeric_limits<_Tp>::max() < __ll)
|
||||
{
|
||||
__err = ios_base::failbit;
|
||||
return numeric_limits<_Tp>::max();
|
||||
}
|
||||
else if (__ll < numeric_limits<_Tp>::min())
|
||||
{
|
||||
__err = ios_base::failbit;
|
||||
return numeric_limits<_Tp>::min();
|
||||
if (__ll > 0)
|
||||
return numeric_limits<_Tp>::max();
|
||||
else
|
||||
return numeric_limits<_Tp>::min();
|
||||
}
|
||||
return static_cast<_Tp>(__ll);
|
||||
}
|
||||
@@ -763,14 +780,25 @@ __num_get_unsigned_integral(const char* __a, const char* __a_end,
|
||||
{
|
||||
if (__a != __a_end)
|
||||
{
|
||||
if (*__a == '-')
|
||||
{
|
||||
__err = ios_base::failbit;
|
||||
return 0;
|
||||
}
|
||||
int __save_errno = errno;
|
||||
errno = 0;
|
||||
char *__p2;
|
||||
unsigned long long __ll = strtoull_l(__a, &__p2, __base, 0);
|
||||
int __current_errno = errno;
|
||||
if (__current_errno == 0)
|
||||
errno = __save_errno;
|
||||
if (__p2 != __a_end)
|
||||
{
|
||||
__err = ios_base::failbit;
|
||||
return 0;
|
||||
}
|
||||
else if (__ll > numeric_limits<_Tp>::max())
|
||||
else if (__current_errno == ERANGE ||
|
||||
numeric_limits<_Tp>::max() < __ll)
|
||||
{
|
||||
__err = ios_base::failbit;
|
||||
return numeric_limits<_Tp>::max();
|
||||
@@ -2318,6 +2346,12 @@ time_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
|
||||
__b = get(__b, __e, __iob, __err, __tm, __fmt, __fmt + sizeof(__fmt)/sizeof(__fmt[0]));
|
||||
}
|
||||
break;
|
||||
case 'F':
|
||||
{
|
||||
const char_type __fmt[] = {'%', 'Y', '-', '%', 'm', '-', '%', 'd'};
|
||||
__b = get(__b, __e, __iob, __err, __tm, __fmt, __fmt + sizeof(__fmt)/sizeof(__fmt[0]));
|
||||
}
|
||||
break;
|
||||
case 'H':
|
||||
__get_hour(__tm->tm_hour, __b, __e, __err, __ct);
|
||||
break;
|
||||
@@ -2580,7 +2614,7 @@ time_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
|
||||
char_type* __nb = __nar;
|
||||
char_type* __ne = __nb + 100;
|
||||
__do_put(__nb, __ne, __tm, __fmt, __mod);
|
||||
return copy(__nb, __ne, __s);
|
||||
return _STD::copy(__nb, __ne, __s);
|
||||
}
|
||||
|
||||
extern template class time_put<char>;
|
||||
@@ -3248,7 +3282,7 @@ __money_put<_CharT>::__format(char_type* __mb, char_type*& __mi, char_type*& __m
|
||||
break;
|
||||
case money_base::symbol:
|
||||
if (!__sym.empty() && (__flags & ios_base::showbase))
|
||||
__me = copy(__sym.begin(), __sym.end(), __me);
|
||||
__me = _STD::copy(__sym.begin(), __sym.end(), __me);
|
||||
break;
|
||||
case money_base::value:
|
||||
{
|
||||
@@ -3307,7 +3341,7 @@ __money_put<_CharT>::__format(char_type* __mb, char_type*& __mi, char_type*& __m
|
||||
}
|
||||
// print rest of sign, if any
|
||||
if (__sn.size() > 1)
|
||||
__me = copy(__sn.begin()+1, __sn.end(), __me);
|
||||
__me = _STD::copy(__sn.begin()+1, __sn.end(), __me);
|
||||
// set alignment
|
||||
if ((__flags & ios_base::adjustfield) == ios_base::left)
|
||||
__mi = __me;
|
||||
@@ -3474,7 +3508,7 @@ extern template class money_put<wchar_t>;
|
||||
class _LIBCPP_VISIBLE messages_base
|
||||
{
|
||||
public:
|
||||
typedef nl_catd catalog;
|
||||
typedef ptrdiff_t catalog;
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE messages_base() {}
|
||||
};
|
||||
@@ -3531,7 +3565,10 @@ template <class _CharT>
|
||||
typename messages<_CharT>::catalog
|
||||
messages<_CharT>::do_open(const basic_string<char>& __nm, const locale&) const
|
||||
{
|
||||
return catopen(__nm.c_str(), NL_CAT_LOCALE);
|
||||
catalog __cat = reinterpret_cast<catalog>(catopen(__nm.c_str(), NL_CAT_LOCALE));
|
||||
if (__cat != -1)
|
||||
__cat = static_cast<catalog>((static_cast<size_t>(__cat) >> 1));
|
||||
return __cat;
|
||||
}
|
||||
|
||||
template <class _CharT>
|
||||
@@ -3543,7 +3580,10 @@ messages<_CharT>::do_get(catalog __c, int __set, int __msgid,
|
||||
__narrow_to_utf8<sizeof(char_type)*__CHAR_BIT__>()(back_inserter(__ndflt),
|
||||
__dflt.c_str(),
|
||||
__dflt.c_str() + __dflt.size());
|
||||
char* __n = catgets(__c, __set, __msgid, __ndflt.c_str());
|
||||
if (__c != -1)
|
||||
__c <<= 1;
|
||||
nl_catd __cat = reinterpret_cast<nl_catd>(__c);
|
||||
char* __n = catgets(__cat, __set, __msgid, __ndflt.c_str());
|
||||
string_type __w;
|
||||
__widen_from_utf8<sizeof(char_type)*__CHAR_BIT__>()(back_inserter(__w),
|
||||
__n, __n + strlen(__n));
|
||||
@@ -3554,7 +3594,10 @@ template <class _CharT>
|
||||
void
|
||||
messages<_CharT>::do_close(catalog __c) const
|
||||
{
|
||||
catclose(__c);
|
||||
if (__c != -1)
|
||||
__c <<= 1;
|
||||
nl_catd __cat = reinterpret_cast<nl_catd>(__c);
|
||||
catclose(__cat);
|
||||
}
|
||||
|
||||
extern template class messages<char>;
|
||||
@@ -3967,7 +4010,7 @@ wbuffer_convert<_Codecvt, _Elem, _Tr>::underflow()
|
||||
memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
|
||||
__extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_);
|
||||
__extbufend_ = __extbuf_ + (__extbuf_ == __extbuf_min_ ? sizeof(__extbuf_min_) : __ebs_);
|
||||
streamsize __nmemb = min(static_cast<streamsize>(this->egptr() - this->eback() - __unget_sz),
|
||||
streamsize __nmemb = _STD::min(static_cast<streamsize>(this->egptr() - this->eback() - __unget_sz),
|
||||
static_cast<streamsize>(__extbufend_ - __extbufnext_));
|
||||
codecvt_base::result __r;
|
||||
state_type __svs = __st_;
|
||||
|
18
include/map
18
include/map
@@ -493,11 +493,11 @@ class _LIBCPP_VISIBLE __map_iterator
|
||||
_TreeIterator __i_;
|
||||
|
||||
typedef typename _TreeIterator::__pointer_traits __pointer_traits;
|
||||
typedef const typename _TreeIterator::value_type::first_type key_type;
|
||||
typedef typename _TreeIterator::value_type::second_type mapped_type;
|
||||
typedef const typename _TreeIterator::value_type::first_type __key_type;
|
||||
typedef typename _TreeIterator::value_type::second_type __mapped_type;
|
||||
public:
|
||||
typedef bidirectional_iterator_tag iterator_category;
|
||||
typedef pair<key_type, mapped_type> value_type;
|
||||
typedef pair<__key_type, __mapped_type> value_type;
|
||||
typedef typename _TreeIterator::difference_type difference_type;
|
||||
typedef value_type& reference;
|
||||
typedef typename __pointer_traits::template
|
||||
@@ -558,18 +558,18 @@ class _LIBCPP_VISIBLE __map_const_iterator
|
||||
_TreeIterator __i_;
|
||||
|
||||
typedef typename _TreeIterator::__pointer_traits __pointer_traits;
|
||||
typedef const typename _TreeIterator::value_type::first_type key_type;
|
||||
typedef typename _TreeIterator::value_type::second_type mapped_type;
|
||||
typedef const typename _TreeIterator::value_type::first_type __key_type;
|
||||
typedef typename _TreeIterator::value_type::second_type __mapped_type;
|
||||
public:
|
||||
typedef bidirectional_iterator_tag iterator_category;
|
||||
typedef pair<key_type, mapped_type> value_type;
|
||||
typedef pair<__key_type, __mapped_type> value_type;
|
||||
typedef typename _TreeIterator::difference_type difference_type;
|
||||
typedef const value_type& reference;
|
||||
typedef typename __pointer_traits::template
|
||||
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
rebind<value_type>
|
||||
rebind<const value_type>
|
||||
#else
|
||||
rebind<value_type>::other
|
||||
rebind<const value_type>::other
|
||||
#endif
|
||||
pointer;
|
||||
|
||||
@@ -1042,7 +1042,7 @@ map<_Key, _Tp, _Compare, _Allocator>::__find_equal_key(const_iterator __hint,
|
||||
else if (__tree_.value_comp().key_comp()(__hint->first, __k)) // check after
|
||||
{
|
||||
// *__hint < __k
|
||||
const_iterator __next = next(__hint);
|
||||
const_iterator __next = _STD::next(__hint);
|
||||
if (__next == end() || __tree_.value_comp().key_comp()(__k, __next->first))
|
||||
{
|
||||
// *__hint < __k < *next(__hint)
|
||||
|
@@ -794,7 +794,7 @@ struct _LIBCPP_VISIBLE pointer_traits
|
||||
typedef typename __pointer_traits_difference_type<pointer>::type difference_type;
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
template <class _Up> using rebind = __pointer_traits_rebind<pointer, _Up>::type;
|
||||
template <class _Up> using rebind = typename __pointer_traits_rebind<pointer, _Up>::type;
|
||||
#else
|
||||
template <class _Up> struct rebind
|
||||
{typedef typename __pointer_traits_rebind<pointer, _Up>::type other;};
|
||||
@@ -1331,7 +1331,7 @@ struct _LIBCPP_VISIBLE allocator_traits
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
template <class _Tp> using rebind_alloc =
|
||||
__allocator_traits_rebind<allocator_type, _Tp>::type;
|
||||
typename __allocator_traits_rebind<allocator_type, _Tp>::type;
|
||||
template <class _Tp> using rebind_traits = allocator_traits<rebind_alloc<_Tp>>;
|
||||
#else // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
template <class _Tp> struct rebind_alloc
|
||||
@@ -3338,7 +3338,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
shared_ptr<_Tp>&
|
||||
shared_ptr<_Tp>::operator=(auto_ptr<_Yp>&& __r)
|
||||
{
|
||||
shared_ptr(__r).swap(*this);
|
||||
shared_ptr(_STD::move(__r)).swap(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -3586,10 +3586,10 @@ private:
|
||||
public:
|
||||
weak_ptr();
|
||||
template<class _Yp> weak_ptr(shared_ptr<_Yp> const& __r,
|
||||
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat>::type = __nat());
|
||||
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type = 0);
|
||||
weak_ptr(weak_ptr const& __r);
|
||||
template<class _Yp> weak_ptr(weak_ptr<_Yp> const& __r,
|
||||
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat>::type = __nat());
|
||||
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type = 0);
|
||||
|
||||
~weak_ptr();
|
||||
|
||||
@@ -3640,7 +3640,7 @@ template<class _Tp>
|
||||
template<class _Yp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
weak_ptr<_Tp>::weak_ptr(shared_ptr<_Yp> const& __r,
|
||||
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat>::type)
|
||||
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type)
|
||||
: __ptr_(__r.__ptr_),
|
||||
__cntrl_(__r.__cntrl_)
|
||||
{
|
||||
@@ -3652,7 +3652,7 @@ template<class _Tp>
|
||||
template<class _Yp>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
weak_ptr<_Tp>::weak_ptr(weak_ptr<_Yp> const& __r,
|
||||
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat>::type)
|
||||
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat*>::type)
|
||||
: __ptr_(__r.__ptr_),
|
||||
__cntrl_(__r.__cntrl_)
|
||||
{
|
||||
|
@@ -175,6 +175,9 @@ template<class Callable, class ...Args>
|
||||
#include <__config>
|
||||
#include <__mutex_base>
|
||||
#include <functional>
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
#include <tuple>
|
||||
#endif
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
@@ -455,6 +458,39 @@ private:
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
};
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _F>
|
||||
class __call_once_param
|
||||
{
|
||||
_F __f_;
|
||||
public:
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __call_once_param(_F&& __f) : __f_(_STD::move(__f)) {}
|
||||
#else
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __call_once_param(const _F& __f) : __f_(__f) {}
|
||||
#endif
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void operator()()
|
||||
{
|
||||
typedef typename __make_tuple_indices<tuple_size<_F>::value, 1>::type _Index;
|
||||
__execute(_Index());
|
||||
}
|
||||
|
||||
private:
|
||||
template <size_t ..._Indices>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __execute(__tuple_indices<_Indices...>)
|
||||
{
|
||||
__invoke(_STD::move(_STD::get<0>(__f_)), _STD::move(_STD::get<_Indices>(__f_))...);
|
||||
}
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
template <class _F>
|
||||
class __call_once_param
|
||||
{
|
||||
@@ -475,6 +511,8 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
template <class _F>
|
||||
void
|
||||
__call_once_proxy(void* __vp)
|
||||
@@ -494,10 +532,9 @@ call_once(once_flag& __flag, _Callable&& __func, _Args&&... __args)
|
||||
{
|
||||
if (__builtin_expect(__flag.__state_ , ~0ul) != ~0ul)
|
||||
{
|
||||
typedef decltype(std::bind(std::forward<_Callable>(__func),
|
||||
std::forward<_Args>(__args)...)) _G;
|
||||
__call_once_param<_G> __p(std::bind(std::forward<_Callable>(__func),
|
||||
std::forward<_Args>(__args)...));
|
||||
typedef tuple<typename decay<_Callable>::type, typename decay<_Args>::type...> _G;
|
||||
__call_once_param<_G> __p(_G(__decay_copy(_STD::forward<_Callable>(__func)),
|
||||
__decay_copy(_STD::forward<_Args>(__args))...));
|
||||
__call_once(__flag.__state_, &__p, &__call_once_proxy<_G>);
|
||||
}
|
||||
}
|
||||
|
@@ -1276,7 +1276,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Y> const& __p)
|
||||
|
||||
template <class _CharT, class _Traits, size_t _Size>
|
||||
basic_ostream<_CharT, _Traits>&
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, bitset<_Size>& __x)
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x)
|
||||
{
|
||||
return __os << __x.template to_string<_CharT, _Traits>
|
||||
(use_facet<ctype<_CharT> >(__os.getloc()).widen('0'),
|
||||
|
@@ -1650,6 +1650,16 @@ class piecewise_linear_distribution
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
// __is_seed_sequence
|
||||
|
||||
template <class _Sseq, class _Engine>
|
||||
struct __is_seed_sequence
|
||||
{
|
||||
static const bool value =
|
||||
!is_convertible<_Sseq, typename _Engine::result_type>::value &&
|
||||
!is_same<typename remove_cv<_Sseq>::type, _Engine>::value;
|
||||
};
|
||||
|
||||
// linear_congruential_engine
|
||||
|
||||
template <unsigned long long __a, unsigned long long __c,
|
||||
@@ -1848,7 +1858,7 @@ public:
|
||||
{seed(__s);}
|
||||
template<class _Sseq> explicit linear_congruential_engine(_Sseq& __q,
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<!is_convertible<_Sseq, result_type>::value>::type* = 0)
|
||||
typename enable_if<__is_seed_sequence<_Sseq, linear_congruential_engine>::value>::type* = 0)
|
||||
{seed(__q);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void seed(result_type __s = default_seed)
|
||||
@@ -1858,7 +1868,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
!is_convertible<_Sseq, result_type>::value,
|
||||
__is_seed_sequence<_Sseq, linear_congruential_engine>::value,
|
||||
void
|
||||
>::type
|
||||
seed(_Sseq& __q)
|
||||
@@ -2104,14 +2114,14 @@ public:
|
||||
{seed(__sd);}
|
||||
template<class _Sseq> explicit mersenne_twister_engine(_Sseq& __q,
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<!is_convertible<_Sseq, result_type>::value>::type* = 0)
|
||||
typename enable_if<__is_seed_sequence<_Sseq, mersenne_twister_engine>::value>::type* = 0)
|
||||
{seed(__q);}
|
||||
void seed(result_type __sd = default_seed);
|
||||
template<class _Sseq>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
!is_convertible<_Sseq, result_type>::value,
|
||||
__is_seed_sequence<_Sseq, mersenne_twister_engine>::value,
|
||||
void
|
||||
>::type
|
||||
seed(_Sseq& __q)
|
||||
@@ -2473,7 +2483,7 @@ public:
|
||||
{seed(__sd);}
|
||||
template<class _Sseq> explicit subtract_with_carry_engine(_Sseq& __q,
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<!is_convertible<_Sseq, result_type>::value>::type* = 0)
|
||||
typename enable_if<__is_seed_sequence<_Sseq, subtract_with_carry_engine>::value>::type* = 0)
|
||||
{seed(__q);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void seed(result_type __sd = default_seed)
|
||||
@@ -2482,7 +2492,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
!is_convertible<_Sseq, result_type>::value,
|
||||
__is_seed_sequence<_Sseq, subtract_with_carry_engine>::value,
|
||||
void
|
||||
>::type
|
||||
seed(_Sseq& __q)
|
||||
@@ -2741,7 +2751,7 @@ public:
|
||||
template<class _Sseq>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit discard_block_engine(_Sseq& __q,
|
||||
typename enable_if<!is_convertible<_Sseq, result_type>::value &&
|
||||
typename enable_if<__is_seed_sequence<_Sseq, discard_block_engine>::value &&
|
||||
!is_convertible<_Sseq, _Engine>::value>::type* = 0)
|
||||
: __e_(__q), __n_(0) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -2752,7 +2762,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
!is_convertible<_Sseq, result_type>::value,
|
||||
__is_seed_sequence<_Sseq, discard_block_engine>::value,
|
||||
void
|
||||
>::type
|
||||
seed(_Sseq& __q) {__e_.seed(__q); __n_ = 0;}
|
||||
@@ -2940,7 +2950,7 @@ public:
|
||||
explicit independent_bits_engine(result_type __sd) : __e_(__sd) {}
|
||||
template<class _Sseq> explicit independent_bits_engine(_Sseq& __q,
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<!is_convertible<_Sseq, result_type>::value &&
|
||||
typename enable_if<__is_seed_sequence<_Sseq, independent_bits_engine>::value &&
|
||||
!is_convertible<_Sseq, _Engine>::value>::type* = 0)
|
||||
: __e_(__q) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -2951,7 +2961,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
!is_convertible<_Sseq, result_type>::value,
|
||||
__is_seed_sequence<_Sseq, independent_bits_engine>::value,
|
||||
void
|
||||
>::type
|
||||
seed(_Sseq& __q) {__e_.seed(__q);}
|
||||
@@ -3163,7 +3173,7 @@ public:
|
||||
explicit shuffle_order_engine(result_type __sd) : __e_(__sd) {__init();}
|
||||
template<class _Sseq> explicit shuffle_order_engine(_Sseq& __q,
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<!is_convertible<_Sseq, result_type>::value &&
|
||||
typename enable_if<__is_seed_sequence<_Sseq, shuffle_order_engine>::value &&
|
||||
!is_convertible<_Sseq, _Engine>::value>::type* = 0)
|
||||
: __e_(__q) {__init();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -3174,7 +3184,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
!is_convertible<_Sseq, result_type>::value,
|
||||
__is_seed_sequence<_Sseq, shuffle_order_engine>::value,
|
||||
void
|
||||
>::type
|
||||
seed(_Sseq& __q) {__e_.seed(__q); __init();}
|
||||
@@ -4467,7 +4477,7 @@ poisson_distribution<_IntType>::operator()(_URNG& __urng, const param_type& __pr
|
||||
{
|
||||
result_type __x;
|
||||
uniform_real_distribution<double> __urd;
|
||||
if (__pr.__mean_ <= 10)
|
||||
if (__pr.__mean_ < 10)
|
||||
{
|
||||
__x = 0;
|
||||
for (double __p = __urd(__urng); __p > __pr.__l_; ++__x)
|
||||
|
139
include/regex
139
include/regex
@@ -1264,6 +1264,7 @@ struct __state
|
||||
vector<pair<size_t, const _CharT*> > __loop_data_;
|
||||
const __node<_CharT>* __node_;
|
||||
regex_constants::match_flag_type __flags_;
|
||||
bool __at_first_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__state()
|
||||
@@ -1890,6 +1891,40 @@ __word_boundary<_CharT, _Traits>::__exec(__state& __s) const
|
||||
}
|
||||
}
|
||||
|
||||
// __l_anchor
|
||||
|
||||
template <class _CharT>
|
||||
class __l_anchor
|
||||
: public __owns_one_state<_CharT>
|
||||
{
|
||||
typedef __owns_one_state<_CharT> base;
|
||||
|
||||
public:
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__l_anchor(__node<_CharT>* __s)
|
||||
: base(__s) {}
|
||||
|
||||
virtual void __exec(__state&) const;
|
||||
};
|
||||
|
||||
template <class _CharT>
|
||||
void
|
||||
__l_anchor<_CharT>::__exec(__state& __s) const
|
||||
{
|
||||
if (__s.__at_first_ && __s.__current_ == __s.__first_)
|
||||
{
|
||||
__s.__do_ = __state::__accept_but_not_consume;
|
||||
__s.__node_ = this->first();
|
||||
}
|
||||
else
|
||||
{
|
||||
__s.__do_ = __state::__reject;
|
||||
__s.__node_ = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// __r_anchor
|
||||
|
||||
template <class _CharT>
|
||||
@@ -2228,7 +2263,7 @@ __bracket_expression<_CharT, _Traits>::__exec(__state& __s) const
|
||||
++__consumed;
|
||||
if (__might_have_digraph_)
|
||||
{
|
||||
const _CharT* __next = next(__s.__current_);
|
||||
const _CharT* __next = _STD::next(__s.__current_);
|
||||
if (__next != __s.__last_)
|
||||
{
|
||||
pair<_CharT, _CharT> __ch2(*__s.__current_, *__next);
|
||||
@@ -2394,7 +2429,6 @@ private:
|
||||
int __open_count_;
|
||||
shared_ptr<__empty_state<_CharT> > __start_;
|
||||
__owns_one_state<_CharT>* __end_;
|
||||
bool __left_anchor_;
|
||||
|
||||
typedef _STD::__state<_CharT> __state;
|
||||
typedef _STD::__node<_CharT> __node;
|
||||
@@ -2416,17 +2450,17 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_regex()
|
||||
: __flags_(), __marked_count_(0), __loop_count_(0), __open_count_(0),
|
||||
__end_(0), __left_anchor_(false)
|
||||
__end_(0)
|
||||
{}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit basic_regex(const value_type* __p, flag_type __f = regex_constants::ECMAScript)
|
||||
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
|
||||
__end_(0), __left_anchor_(false)
|
||||
__end_(0)
|
||||
{__parse(__p, __p + __traits_.length(__p));}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_regex(const value_type* __p, size_t __len, flag_type __f)
|
||||
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
|
||||
__end_(0), __left_anchor_(false)
|
||||
__end_(0)
|
||||
{__parse(__p, __p + __len);}
|
||||
// basic_regex(const basic_regex&) = default;
|
||||
// basic_regex(basic_regex&&) = default;
|
||||
@@ -2435,20 +2469,20 @@ public:
|
||||
explicit basic_regex(const basic_string<value_type, _ST, _SA>& __p,
|
||||
flag_type __f = regex_constants::ECMAScript)
|
||||
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
|
||||
__end_(0), __left_anchor_(false)
|
||||
__end_(0)
|
||||
{__parse(__p.begin(), __p.end());}
|
||||
template <class _ForwardIterator>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_regex(_ForwardIterator __first, _ForwardIterator __last,
|
||||
flag_type __f = regex_constants::ECMAScript)
|
||||
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
|
||||
__end_(0), __left_anchor_(false)
|
||||
__end_(0)
|
||||
{__parse(__first, __last);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_regex(initializer_list<value_type> __il,
|
||||
flag_type __f = regex_constants::ECMAScript)
|
||||
: __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
|
||||
__end_(0), __left_anchor_(false)
|
||||
__end_(0)
|
||||
{__parse(__il.begin(), __il.end());}
|
||||
|
||||
// ~basic_regex() = default;
|
||||
@@ -2506,7 +2540,6 @@ private:
|
||||
__loop_count_ = 0;
|
||||
__open_count_ = 0;
|
||||
__end_ = nullptr;
|
||||
__left_anchor_ = false;
|
||||
}
|
||||
public:
|
||||
|
||||
@@ -2694,7 +2727,7 @@ private:
|
||||
basic_string<_CharT>* __str = nullptr);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __push_l_anchor() {__left_anchor_ = true;}
|
||||
void __push_l_anchor();
|
||||
void __push_r_anchor();
|
||||
void __push_match_any();
|
||||
void __push_match_any_but_newline();
|
||||
@@ -2732,22 +2765,22 @@ private:
|
||||
bool
|
||||
__match_at_start(const _CharT* __first, const _CharT* __last,
|
||||
match_results<const _CharT*, _Allocator>& __m,
|
||||
regex_constants::match_flag_type __flags) const;
|
||||
regex_constants::match_flag_type __flags, bool) const;
|
||||
template <class _Allocator>
|
||||
bool
|
||||
__match_at_start_ecma(const _CharT* __first, const _CharT* __last,
|
||||
match_results<const _CharT*, _Allocator>& __m,
|
||||
regex_constants::match_flag_type __flags) const;
|
||||
regex_constants::match_flag_type __flags, bool) const;
|
||||
template <class _Allocator>
|
||||
bool
|
||||
__match_at_start_posix_nosubs(const _CharT* __first, const _CharT* __last,
|
||||
match_results<const _CharT*, _Allocator>& __m,
|
||||
regex_constants::match_flag_type __flags) const;
|
||||
regex_constants::match_flag_type __flags, bool) const;
|
||||
template <class _Allocator>
|
||||
bool
|
||||
__match_at_start_posix_subs(const _CharT* __first, const _CharT* __last,
|
||||
match_results<const _CharT*, _Allocator>& __m,
|
||||
regex_constants::match_flag_type __flags) const;
|
||||
regex_constants::match_flag_type __flags, bool) const;
|
||||
|
||||
template <class _B, class _A, class _C, class _T>
|
||||
friend
|
||||
@@ -2809,7 +2842,6 @@ basic_regex<_CharT, _Traits>::swap(basic_regex& __r)
|
||||
swap(__open_count_, __r.__open_count_);
|
||||
swap(__start_, __r.__start_);
|
||||
swap(__end_, __r.__end_);
|
||||
swap(__left_anchor_, __r.__left_anchor_);
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
@@ -2850,7 +2882,9 @@ __lookahead<_CharT, _Traits>::__exec(__state& __s) const
|
||||
match_results<const _CharT*> __m;
|
||||
__m.__init(1 + __exp_.mark_count(), __s.__current_, __s.__last_);
|
||||
bool __matched = __exp_.__match_at_start_ecma(__s.__current_, __s.__last_,
|
||||
__m, __s.__flags_);
|
||||
__m,
|
||||
__s.__flags_ | regex_constants::match_continuous,
|
||||
true);
|
||||
if (__matched != __invert_)
|
||||
{
|
||||
__s.__do_ = __state::__accept_but_not_consume;
|
||||
@@ -2919,7 +2953,7 @@ basic_regex<_CharT, _Traits>::__parse_basic_reg_exp(_ForwardIterator __first,
|
||||
__first = __parse_RE_expression(__first, __last);
|
||||
if (__first != __last)
|
||||
{
|
||||
_ForwardIterator __temp = next(__first);
|
||||
_ForwardIterator __temp = _STD::next(__first);
|
||||
if (__temp == __last && *__first == '$')
|
||||
{
|
||||
__push_r_anchor();
|
||||
@@ -3148,7 +3182,7 @@ basic_regex<_CharT, _Traits>::__parse_Back_open_paren(_ForwardIterator __first,
|
||||
{
|
||||
if (__first != __last)
|
||||
{
|
||||
_ForwardIterator __temp = next(__first);
|
||||
_ForwardIterator __temp = _STD::next(__first);
|
||||
if (__temp != __last)
|
||||
{
|
||||
if (*__first == '\\' && *__temp == '(')
|
||||
@@ -3166,7 +3200,7 @@ basic_regex<_CharT, _Traits>::__parse_Back_close_paren(_ForwardIterator __first,
|
||||
{
|
||||
if (__first != __last)
|
||||
{
|
||||
_ForwardIterator __temp = next(__first);
|
||||
_ForwardIterator __temp = _STD::next(__first);
|
||||
if (__temp != __last)
|
||||
{
|
||||
if (*__first == '\\' && *__temp == ')')
|
||||
@@ -3184,7 +3218,7 @@ basic_regex<_CharT, _Traits>::__parse_Back_open_brace(_ForwardIterator __first,
|
||||
{
|
||||
if (__first != __last)
|
||||
{
|
||||
_ForwardIterator __temp = next(__first);
|
||||
_ForwardIterator __temp = _STD::next(__first);
|
||||
if (__temp != __last)
|
||||
{
|
||||
if (*__first == '\\' && *__temp == '{')
|
||||
@@ -3202,7 +3236,7 @@ basic_regex<_CharT, _Traits>::__parse_Back_close_brace(_ForwardIterator __first,
|
||||
{
|
||||
if (__first != __last)
|
||||
{
|
||||
_ForwardIterator __temp = next(__first);
|
||||
_ForwardIterator __temp = _STD::next(__first);
|
||||
if (__temp != __last)
|
||||
{
|
||||
if (*__first == '\\' && *__temp == '}')
|
||||
@@ -3220,7 +3254,7 @@ basic_regex<_CharT, _Traits>::__parse_BACKREF(_ForwardIterator __first,
|
||||
{
|
||||
if (__first != __last)
|
||||
{
|
||||
_ForwardIterator __temp = next(__first);
|
||||
_ForwardIterator __temp = _STD::next(__first);
|
||||
if (__temp != __last)
|
||||
{
|
||||
if (*__first == '\\' && '1' <= *__temp && *__temp <= '9')
|
||||
@@ -3241,7 +3275,7 @@ basic_regex<_CharT, _Traits>::__parse_ORD_CHAR(_ForwardIterator __first,
|
||||
{
|
||||
if (__first != __last)
|
||||
{
|
||||
_ForwardIterator __temp = next(__first);
|
||||
_ForwardIterator __temp = _STD::next(__first);
|
||||
if (__temp == __last && *__first == '$')
|
||||
return __first;
|
||||
// Not called inside a bracket
|
||||
@@ -3299,7 +3333,7 @@ basic_regex<_CharT, _Traits>::__parse_QUOTED_CHAR(_ForwardIterator __first,
|
||||
{
|
||||
if (__first != __last)
|
||||
{
|
||||
_ForwardIterator __temp = next(__first);
|
||||
_ForwardIterator __temp = _STD::next(__first);
|
||||
if (__temp != __last)
|
||||
{
|
||||
if (*__first == '\\')
|
||||
@@ -3330,7 +3364,7 @@ basic_regex<_CharT, _Traits>::__parse_QUOTED_CHAR_ERE(_ForwardIterator __first,
|
||||
{
|
||||
if (__first != __last)
|
||||
{
|
||||
_ForwardIterator __temp = next(__first);
|
||||
_ForwardIterator __temp = _STD::next(__first);
|
||||
if (__temp != __last)
|
||||
{
|
||||
if (*__first == '\\')
|
||||
@@ -3640,7 +3674,7 @@ basic_regex<_CharT, _Traits>::__parse_expression_term(_ForwardIterator __first,
|
||||
{
|
||||
if (__first != __last && *__first != ']')
|
||||
{
|
||||
_ForwardIterator __temp = next(__first);
|
||||
_ForwardIterator __temp = _STD::next(__first);
|
||||
basic_string<_CharT> __start_range;
|
||||
if (__temp != __last && *__first == '[')
|
||||
{
|
||||
@@ -3669,7 +3703,7 @@ basic_regex<_CharT, _Traits>::__parse_expression_term(_ForwardIterator __first,
|
||||
}
|
||||
if (__first != __last && *__first != ']')
|
||||
{
|
||||
__temp = next(__first);
|
||||
__temp = _STD::next(__first);
|
||||
if (__temp != __last && *__first == '-' && *__temp != ']')
|
||||
{
|
||||
// parse a range
|
||||
@@ -3891,7 +3925,7 @@ basic_regex<_CharT, _Traits>::__parse_equivalence_class(_ForwardIterator __first
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
}
|
||||
__first = next(__temp, 2);
|
||||
__first = _STD::next(__temp, 2);
|
||||
return __first;
|
||||
}
|
||||
|
||||
@@ -3920,7 +3954,7 @@ basic_regex<_CharT, _Traits>::__parse_character_class(_ForwardIterator __first,
|
||||
throw regex_error(regex_constants::error_brack);
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
__ml->__add_class(__class_type);
|
||||
__first = next(__temp, 2);
|
||||
__first = _STD::next(__temp, 2);
|
||||
return __first;
|
||||
}
|
||||
|
||||
@@ -3953,7 +3987,7 @@ basic_regex<_CharT, _Traits>::__parse_collating_symbol(_ForwardIterator __first,
|
||||
throw regex_error(regex_constants::error_collate);
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
__first = next(__temp, 2);
|
||||
__first = _STD::next(__temp, 2);
|
||||
return __first;
|
||||
}
|
||||
|
||||
@@ -4087,7 +4121,6 @@ basic_regex<_CharT, _Traits>::__parse_assertion(_ForwardIterator __first,
|
||||
basic_regex __exp;
|
||||
__exp.__flags_ = __flags_;
|
||||
__temp = __exp.__parse(++__temp, __last);
|
||||
__exp.__push_l_anchor();
|
||||
__push_lookahead(_STD::move(__exp), false);
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__temp == __last || *__temp != ')')
|
||||
@@ -4101,7 +4134,6 @@ basic_regex<_CharT, _Traits>::__parse_assertion(_ForwardIterator __first,
|
||||
basic_regex __exp;
|
||||
__exp.__flags_ = __flags_;
|
||||
__temp = __exp.__parse(++__temp, __last);
|
||||
__exp.__push_l_anchor();
|
||||
__push_lookahead(_STD::move(__exp), true);
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (__temp == __last || *__temp != ')')
|
||||
@@ -4576,6 +4608,14 @@ basic_regex<_CharT, _Traits>::__push_end_marked_subexpression(unsigned __sub)
|
||||
}
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
void
|
||||
basic_regex<_CharT, _Traits>::__push_l_anchor()
|
||||
{
|
||||
__end_->first() = new __l_anchor<_CharT>(__end_->first());
|
||||
__end_ = static_cast<__owns_one_state<_CharT>*>(__end_->first());
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
void
|
||||
basic_regex<_CharT, _Traits>::__push_r_anchor()
|
||||
@@ -5220,18 +5260,18 @@ public:
|
||||
__matches_.resize(__m.size());
|
||||
for (size_type __i = 0; __i < __matches_.size(); ++__i)
|
||||
{
|
||||
__matches_[__i].first = next(__f, _STD::distance(__mf, __m[__i].first));
|
||||
__matches_[__i].second = next(__f, _STD::distance(__mf, __m[__i].second));
|
||||
__matches_[__i].first = _STD::next(__f, _STD::distance(__mf, __m[__i].first));
|
||||
__matches_[__i].second = _STD::next(__f, _STD::distance(__mf, __m[__i].second));
|
||||
__matches_[__i].matched = __m[__i].matched;
|
||||
}
|
||||
__unmatched_.first = __l;
|
||||
__unmatched_.second = __l;
|
||||
__unmatched_.matched = false;
|
||||
__prefix_.first = next(__f, _STD::distance(__mf, __m.prefix().first));
|
||||
__prefix_.second = next(__f, _STD::distance(__mf, __m.prefix().second));
|
||||
__prefix_.first = _STD::next(__f, _STD::distance(__mf, __m.prefix().first));
|
||||
__prefix_.second = _STD::next(__f, _STD::distance(__mf, __m.prefix().second));
|
||||
__prefix_.matched = __m.prefix().matched;
|
||||
__suffix_.first = next(__f, _STD::distance(__mf, __m.suffix().first));
|
||||
__suffix_.second = next(__f, _STD::distance(__mf, __m.suffix().second));
|
||||
__suffix_.first = _STD::next(__f, _STD::distance(__mf, __m.suffix().first));
|
||||
__suffix_.second = _STD::next(__f, _STD::distance(__mf, __m.suffix().second));
|
||||
__suffix_.matched = __m.suffix().matched;
|
||||
if (!__no_update_pos)
|
||||
__position_start_ = __prefix_.first;
|
||||
@@ -5441,7 +5481,7 @@ bool
|
||||
basic_regex<_CharT, _Traits>::__match_at_start_ecma(
|
||||
const _CharT* __first, const _CharT* __last,
|
||||
match_results<const _CharT*, _Allocator>& __m,
|
||||
regex_constants::match_flag_type __flags) const
|
||||
regex_constants::match_flag_type __flags, bool __at_first) const
|
||||
{
|
||||
vector<__state> __states;
|
||||
ptrdiff_t __j = 0;
|
||||
@@ -5458,6 +5498,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_ecma(
|
||||
__states.back().__loop_data_.resize(__loop_count());
|
||||
__states.back().__node_ = __st;
|
||||
__states.back().__flags_ = __flags;
|
||||
__states.back().__at_first_ = __at_first;
|
||||
bool __matched = false;
|
||||
do
|
||||
{
|
||||
@@ -5506,7 +5547,7 @@ bool
|
||||
basic_regex<_CharT, _Traits>::__match_at_start_posix_nosubs(
|
||||
const _CharT* __first, const _CharT* __last,
|
||||
match_results<const _CharT*, _Allocator>& __m,
|
||||
regex_constants::match_flag_type __flags) const
|
||||
regex_constants::match_flag_type __flags, bool __at_first) const
|
||||
{
|
||||
deque<__state> __states;
|
||||
ptrdiff_t __highest_j = 0;
|
||||
@@ -5522,6 +5563,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_nosubs(
|
||||
__states.back().__loop_data_.resize(__loop_count());
|
||||
__states.back().__node_ = __st;
|
||||
__states.back().__flags_ = __flags;
|
||||
__states.back().__at_first_ = __at_first;
|
||||
bool __matched = false;
|
||||
do
|
||||
{
|
||||
@@ -5583,7 +5625,7 @@ bool
|
||||
basic_regex<_CharT, _Traits>::__match_at_start_posix_subs(
|
||||
const _CharT* __first, const _CharT* __last,
|
||||
match_results<const _CharT*, _Allocator>& __m,
|
||||
regex_constants::match_flag_type __flags) const
|
||||
regex_constants::match_flag_type __flags, bool __at_first) const
|
||||
{
|
||||
vector<__state> __states;
|
||||
__state __best_state;
|
||||
@@ -5602,6 +5644,7 @@ basic_regex<_CharT, _Traits>::__match_at_start_posix_subs(
|
||||
__states.back().__loop_data_.resize(__loop_count());
|
||||
__states.back().__node_ = __st;
|
||||
__states.back().__flags_ = __flags;
|
||||
__states.back().__at_first_ = __at_first;
|
||||
const _CharT* __current = __first;
|
||||
bool __matched = false;
|
||||
do
|
||||
@@ -5667,13 +5710,13 @@ bool
|
||||
basic_regex<_CharT, _Traits>::__match_at_start(
|
||||
const _CharT* __first, const _CharT* __last,
|
||||
match_results<const _CharT*, _Allocator>& __m,
|
||||
regex_constants::match_flag_type __flags) const
|
||||
regex_constants::match_flag_type __flags, bool __at_first) const
|
||||
{
|
||||
if ((__flags_ & 0x1F0) == ECMAScript)
|
||||
return __match_at_start_ecma(__first, __last, __m, __flags);
|
||||
return __match_at_start_ecma(__first, __last, __m, __flags, __at_first);
|
||||
if (mark_count() == 0)
|
||||
return __match_at_start_posix_nosubs(__first, __last, __m, __flags);
|
||||
return __match_at_start_posix_subs(__first, __last, __m, __flags);
|
||||
return __match_at_start_posix_nosubs(__first, __last, __m, __flags, __at_first);
|
||||
return __match_at_start_posix_subs(__first, __last, __m, __flags, __at_first);
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
@@ -5684,11 +5727,9 @@ basic_regex<_CharT, _Traits>::__search(
|
||||
match_results<const _CharT*, _Allocator>& __m,
|
||||
regex_constants::match_flag_type __flags) const
|
||||
{
|
||||
if (__left_anchor_)
|
||||
__flags |= regex_constants::match_continuous;
|
||||
__m.__init(1 + mark_count(), __first, __last,
|
||||
__flags & regex_constants::__no_update_pos);
|
||||
if (__match_at_start(__first, __last, __m, __flags))
|
||||
if (__match_at_start(__first, __last, __m, __flags, true))
|
||||
{
|
||||
__m.__prefix_.second = __m[0].first;
|
||||
__m.__prefix_.matched = __m.__prefix_.first != __m.__prefix_.second;
|
||||
@@ -5702,7 +5743,7 @@ basic_regex<_CharT, _Traits>::__search(
|
||||
for (++__first; __first != __last; ++__first)
|
||||
{
|
||||
__m.__matches_.assign(__m.size(), __m.__unmatched_);
|
||||
if (__match_at_start(__first, __last, __m, __flags))
|
||||
if (__match_at_start(__first, __last, __m, __flags, false))
|
||||
{
|
||||
__m.__prefix_.second = __m[0].first;
|
||||
__m.__prefix_.matched = __m.__prefix_.first != __m.__prefix_.second;
|
||||
|
@@ -547,11 +547,11 @@ operator==(const scoped_allocator_adaptor<_OuterA1>& __a,
|
||||
return __a.outer_allocator() == __b.outer_allocator();
|
||||
}
|
||||
|
||||
template <class _OuterA1, class _OuterA2, class... _InnerAllocs>
|
||||
template <class _OuterA1, class _OuterA2, class _InnerA0, class... _InnerAllocs>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator==(const scoped_allocator_adaptor<_OuterA1, _InnerAllocs...>& __a,
|
||||
const scoped_allocator_adaptor<_OuterA2, _InnerAllocs...>& __b)
|
||||
operator==(const scoped_allocator_adaptor<_OuterA1, _InnerA0, _InnerAllocs...>& __a,
|
||||
const scoped_allocator_adaptor<_OuterA2, _InnerA0, _InnerAllocs...>& __b)
|
||||
{
|
||||
return __a.outer_allocator() == __b.outer_allocator() &&
|
||||
__a.inner_allocator() == __b.inner_allocator();
|
||||
|
@@ -451,7 +451,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::overflow(int_type __c)
|
||||
}
|
||||
#endif // _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
__hm_ = max(this->pptr() + 1, __hm_);
|
||||
__hm_ = _STD::max(this->pptr() + 1, __hm_);
|
||||
if (__mode_ & ios_base::in)
|
||||
{
|
||||
char_type* __p = const_cast<char_type*>(__str_.data());
|
||||
|
@@ -95,6 +95,9 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
|
||||
#include <system_error>
|
||||
#include <chrono>
|
||||
#include <__mutex_base>
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
#include <tuple>
|
||||
#endif
|
||||
#include <pthread.h>
|
||||
|
||||
#pragma GCC system_header
|
||||
@@ -315,6 +318,44 @@ public:
|
||||
|
||||
__thread_specific_ptr<__thread_struct>& __thread_local_data();
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _F, class ..._Args, size_t ..._Indices>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
void
|
||||
__threaad_execute(tuple<_F, _Args...>& __t, __tuple_indices<_Indices...>)
|
||||
{
|
||||
__invoke(_STD::move(_STD::get<0>(__t)), _STD::move(_STD::get<_Indices>(__t))...);
|
||||
}
|
||||
|
||||
template <class _F>
|
||||
void*
|
||||
__thread_proxy(void* __vp)
|
||||
{
|
||||
__thread_local_data().reset(new __thread_struct);
|
||||
std::unique_ptr<_F> __p(static_cast<_F*>(__vp));
|
||||
typedef typename __make_tuple_indices<tuple_size<_F>::value, 1>::type _Index;
|
||||
__threaad_execute(*__p, _Index());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <class _F, class ..._Args,
|
||||
class
|
||||
>
|
||||
thread::thread(_F&& __f, _Args&&... __args)
|
||||
{
|
||||
typedef tuple<typename decay<_F>::type, typename decay<_Args>::type...> _G;
|
||||
_STD::unique_ptr<_G> __p(new _G(__decay_copy(_STD::forward<_F>(__f)),
|
||||
__decay_copy(_STD::forward<_Args>(__args))...));
|
||||
int __ec = pthread_create(&__t_, 0, &__thread_proxy<_G>, __p.get());
|
||||
if (__ec == 0)
|
||||
__p.release();
|
||||
else
|
||||
__throw_system_error(__ec, "thread constructor failed");
|
||||
}
|
||||
|
||||
#else // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _F>
|
||||
void*
|
||||
__thread_proxy(void* __vp)
|
||||
@@ -325,25 +366,6 @@ __thread_proxy(void* __vp)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _F, class ..._Args,
|
||||
class
|
||||
>
|
||||
thread::thread(_F&& __f, _Args&&... __args)
|
||||
{
|
||||
typedef decltype(bind(std::forward<_F>(__f), std::forward<_Args>(__args)...)) _G;
|
||||
std::unique_ptr<_G> __p(new _G(bind(std::forward<_F>(__f),
|
||||
std::forward<_Args>(__args)...)));
|
||||
int __ec = pthread_create(&__t_, 0, &__thread_proxy<_G>, __p.get());
|
||||
if (__ec == 0)
|
||||
__p.release();
|
||||
else
|
||||
__throw_system_error(__ec, "thread constructor failed");
|
||||
}
|
||||
|
||||
#else // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template <class _F>
|
||||
thread::thread(_F __f)
|
||||
{
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -211,6 +211,13 @@ struct _LIBCPP_VISIBLE pair
|
||||
_LIBCPP_INLINE_VISIBILITY pair(const _T1& __x, const _T2& __y)
|
||||
: first(__x), second(__y) {}
|
||||
|
||||
template<class _U1, class _U2>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair(const pair<_U1, _U2>& __p,
|
||||
typename enable_if<is_convertible<_U1, _T1>::value &&
|
||||
is_convertible<_U2, _T2>::value>::type* = 0)
|
||||
: first(__p.first), second(__p.second) {}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
template <class _U1, class _U2,
|
||||
@@ -222,6 +229,14 @@ struct _LIBCPP_VISIBLE pair
|
||||
second(_STD::forward<_U2>(__u2))
|
||||
{}
|
||||
|
||||
template<class _U1, class _U2>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
pair(pair<_U1, _U2>&& __p,
|
||||
typename enable_if<is_convertible<_U1, _T1>::value &&
|
||||
is_convertible<_U2, _T2>::value>::type* = 0)
|
||||
: first(_STD::forward<_U1>(__p.first)),
|
||||
second(_STD::forward<_U2>(__p.second)) {}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
template<class _Tuple,
|
||||
@@ -261,10 +276,6 @@ struct _LIBCPP_VISIBLE pair
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
template<class _U1, class _U2>
|
||||
_LIBCPP_INLINE_VISIBILITY pair(const pair<_U1, _U2>& __p)
|
||||
: first(__p.first), second(__p.second) {}
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
void _LIBCPP_INLINE_VISIBILITY swap(pair& __p) {_STD::swap(*this, __p);}
|
||||
private:
|
||||
|
@@ -1101,7 +1101,7 @@ vector<_Tp, _Allocator>::assign(size_type __n, const_reference __u)
|
||||
if (__n <= capacity())
|
||||
{
|
||||
size_type __s = size();
|
||||
_STD::fill_n(this->__begin_, min(__n, __s), __u);
|
||||
_STD::fill_n(this->__begin_, _STD::min(__n, __s), __u);
|
||||
if (__n > __s)
|
||||
__construct_at_end(__n - __s, __u);
|
||||
else
|
||||
|
@@ -27,6 +27,7 @@ endif()
|
||||
append_if(libraries LIBCXX_HAS_PTHREAD_LIB pthread)
|
||||
append_if(libraries LIBCXX_HAS_C_LIB c)
|
||||
append_if(libraries LIBCXX_HAS_M_LIB m)
|
||||
append_if(libraries LIBCXX_HAS_RT_LIB rt)
|
||||
append_if(libraries LIBCXX_HAS_GCC_S_LIB gcc_s)
|
||||
|
||||
target_link_libraries(cxx ${libraries})
|
||||
@@ -53,4 +54,5 @@ install(DIRECTORY ../include/
|
||||
DESTINATION include/c++/v1
|
||||
FILES_MATCHING
|
||||
PATTERN "*"
|
||||
PATTERN ".svn" EXCLUDE
|
||||
)
|
||||
|
44
lib/buildit
44
lib/buildit
@@ -17,9 +17,17 @@ then
|
||||
CXX=clang++
|
||||
fi
|
||||
|
||||
if [ -z "$CC" ]
|
||||
then
|
||||
CC=clang
|
||||
fi
|
||||
|
||||
if [ -z $MACOSX_DEPLOYMENT_TARGET ]
|
||||
then
|
||||
MACOSX_DEPLOYMENT_TARGET=10.6
|
||||
if [ -z $IPHONEOS_DEPLOYMENT_TARGET ]
|
||||
then
|
||||
MACOSX_DEPLOYMENT_TARGET=10.6
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z $RC_ProjectSourceVersion ]
|
||||
@@ -29,7 +37,7 @@ fi
|
||||
|
||||
case $TRIPLE in
|
||||
*-apple-*)
|
||||
if [ -z $RC_BUILDIT ]
|
||||
if [ -z $RC_XBS ]
|
||||
then
|
||||
RC_CFLAGS="-arch i386 -arch x86_64"
|
||||
fi
|
||||
@@ -40,21 +48,33 @@ case $TRIPLE in
|
||||
LDSHARED_FLAGS="-o libc++.1.dylib \
|
||||
-dynamiclib -nodefaultlibs -current_version 1 \
|
||||
-compatibility_version 1 \
|
||||
-install_name /usr/lib/libc++.dylib \
|
||||
-install_name /usr/lib/libc++.1.dylib \
|
||||
-Wl,-reexport_library,/usr/lib/libc++abi.dylib \
|
||||
-Wl,-unexported_symbols_list,libc++unexp.exp \
|
||||
/usr/lib/libSystem.B.dylib"
|
||||
else
|
||||
EXTRA_FLAGS="-std=c++0x"
|
||||
LDSHARED_FLAGS="-o libc++.1.dylib \
|
||||
EXTRA_FLAGS="-std=c++0x "
|
||||
RE_EXPORT_LINE="/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,libc++abi.exp"
|
||||
if [ -n "$SDKROOT" ]
|
||||
then
|
||||
EXTRA_FLAGS+="-isysroot ${SDKROOT}"
|
||||
if echo "${RC_ARCHS}" | grep -q "armv7"
|
||||
then
|
||||
RE_EXPORT_LINE="${SDKROOT}/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,libc++sjlj-abi.exp"
|
||||
else
|
||||
RE_EXPORT_LINE="-Wl,-reexport_library,${SDKROOT}/usr/lib/libc++abi.dylib"
|
||||
fi
|
||||
CXX=`xcrun -sdk "${SDKROOT}" -find clang++`
|
||||
CC=`xcrun -sdk "${SDKROOT}" -find clang`
|
||||
fi
|
||||
LDSHARED_FLAGS="-o libc++.1.dylib \
|
||||
-dynamiclib -nodefaultlibs \
|
||||
-current_version ${RC_ProjectSourceVersion} -compatibility_version 1 \
|
||||
-install_name /usr/lib/libc++.dylib \
|
||||
${SDKROOT}/usr/lib/libc++abi.dylib \
|
||||
-install_name /usr/lib/libc++.1.dylib \
|
||||
-lSystem \
|
||||
-Wl,-unexported_symbols_list,libc++unexp.exp \
|
||||
-Wl,-reexported_symbols_list,libc++abi.exp \
|
||||
-Wl,-force_symbols_not_weak_list,notweak.exp"
|
||||
${RE_EXPORT_LINE} \
|
||||
-Wl,-force_symbols_not_weak_list,notweak.exp "
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
@@ -66,7 +86,7 @@ case $TRIPLE in
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z $RC_BUILDIT ]
|
||||
if [ -z $RC_XBS ]
|
||||
then
|
||||
rm -f libc++.1.$SOEXT*
|
||||
fi
|
||||
@@ -78,11 +98,11 @@ for FILE in ../src/*.cpp; do
|
||||
done
|
||||
|
||||
|
||||
cc *.o $RC_CFLAGS $LDSHARED_FLAGS
|
||||
$CC *.o $RC_CFLAGS $LDSHARED_FLAGS $EXTRA_FLAGS
|
||||
|
||||
#libtool -static -o libc++.a *.o
|
||||
|
||||
if [ -z $RC_BUILDIT ]
|
||||
if [ -z $RC_XBS ]
|
||||
then
|
||||
rm *.o
|
||||
fi
|
||||
|
159
lib/libc++sjlj-abi.exp
Normal file
159
lib/libc++sjlj-abi.exp
Normal file
@@ -0,0 +1,159 @@
|
||||
___cxa_allocate_exception
|
||||
___cxa_end_catch
|
||||
___cxa_demangle
|
||||
___cxa_current_exception_type
|
||||
___cxa_call_unexpected
|
||||
___cxa_free_exception
|
||||
___cxa_get_exception_ptr
|
||||
___cxa_get_globals
|
||||
___cxa_get_globals_fast
|
||||
___cxa_guard_abort
|
||||
___cxa_guard_acquire
|
||||
___cxa_guard_release
|
||||
___cxa_rethrow
|
||||
___cxa_pure_virtual
|
||||
___cxa_begin_catch
|
||||
___cxa_throw
|
||||
___cxa_vec_cctor
|
||||
___cxa_vec_cleanup
|
||||
___cxa_vec_ctor
|
||||
___cxa_vec_delete
|
||||
___cxa_vec_delete2
|
||||
___cxa_vec_delete3
|
||||
___cxa_vec_dtor
|
||||
___cxa_vec_new
|
||||
___cxa_vec_new2
|
||||
___cxa_vec_new3
|
||||
___dynamic_cast
|
||||
___gxx_personality_sj0
|
||||
__ZTIDi
|
||||
__ZTIDn
|
||||
__ZTIDs
|
||||
__ZTIPDi
|
||||
__ZTIPDn
|
||||
__ZTIPDs
|
||||
__ZTIPKDi
|
||||
__ZTIPKDn
|
||||
__ZTIPKDs
|
||||
__ZTSPm
|
||||
__ZTSPl
|
||||
__ZTSPj
|
||||
__ZTSPi
|
||||
__ZTSPh
|
||||
__ZTSPf
|
||||
__ZTSPe
|
||||
__ZTSPd
|
||||
__ZTSPc
|
||||
__ZTSPb
|
||||
__ZTSPa
|
||||
__ZTSPKc
|
||||
__ZTSPKy
|
||||
__ZTSPKx
|
||||
__ZTSPKw
|
||||
__ZTSPKv
|
||||
__ZTSPKt
|
||||
__ZTSPKs
|
||||
__ZTSPKm
|
||||
__ZTSPKl
|
||||
__ZTSPKi
|
||||
__ZTSPKh
|
||||
__ZTSPs
|
||||
__ZTSPt
|
||||
__ZTSPv
|
||||
__ZTSPw
|
||||
__ZTSPKa
|
||||
__ZTSPx
|
||||
__ZTSPy
|
||||
__ZTSPKd
|
||||
__ZTSPKe
|
||||
__ZTSPKj
|
||||
__ZTSPKb
|
||||
__ZTSPKf
|
||||
__ZTSv
|
||||
__ZTSt
|
||||
__ZTSs
|
||||
__ZTSm
|
||||
__ZTSl
|
||||
__ZTSj
|
||||
__ZTSi
|
||||
__ZTSh
|
||||
__ZTSf
|
||||
__ZTSe
|
||||
__ZTSd
|
||||
__ZTSc
|
||||
__ZTSw
|
||||
__ZTSx
|
||||
__ZTSy
|
||||
__ZTSb
|
||||
__ZTSa
|
||||
__ZTIPKh
|
||||
__ZTIPKf
|
||||
__ZTIPKe
|
||||
__ZTIPKd
|
||||
__ZTIPKc
|
||||
__ZTIPKb
|
||||
__ZTIPKa
|
||||
__ZTIPy
|
||||
__ZTIPx
|
||||
__ZTIPw
|
||||
__ZTIPv
|
||||
__ZTIPt
|
||||
__ZTIPs
|
||||
__ZTIPm
|
||||
__ZTIPl
|
||||
__ZTIPj
|
||||
__ZTIPi
|
||||
__ZTIPKi
|
||||
__ZTIPKj
|
||||
__ZTIPKl
|
||||
__ZTIPKm
|
||||
__ZTIPKs
|
||||
__ZTIPKt
|
||||
__ZTIPKv
|
||||
__ZTIPKw
|
||||
__ZTIPKx
|
||||
__ZTIPKy
|
||||
__ZTIPa
|
||||
__ZTIPb
|
||||
__ZTIPc
|
||||
__ZTIPd
|
||||
__ZTIPe
|
||||
__ZTIPf
|
||||
__ZTIPh
|
||||
__ZTVN10__cxxabiv129__pointer_to_member_type_infoE
|
||||
__ZTVN10__cxxabiv116__enum_type_infoE
|
||||
__ZTVN10__cxxabiv117__array_type_infoE
|
||||
__ZTVN10__cxxabiv117__class_type_infoE
|
||||
__ZTVN10__cxxabiv117__pbase_type_infoE
|
||||
__ZTVN10__cxxabiv119__pointer_type_infoE
|
||||
__ZTVN10__cxxabiv120__function_type_infoE
|
||||
__ZTVN10__cxxabiv120__si_class_type_infoE
|
||||
__ZTVN10__cxxabiv121__vmi_class_type_infoE
|
||||
__ZTVN10__cxxabiv123__fundamental_type_infoE
|
||||
__ZTIa
|
||||
__ZTIb
|
||||
__ZTIc
|
||||
__ZTId
|
||||
__ZTIe
|
||||
__ZTIf
|
||||
__ZTIh
|
||||
__ZTIi
|
||||
__ZTIj
|
||||
__ZTIl
|
||||
__ZTIm
|
||||
__ZTIs
|
||||
__ZTIt
|
||||
__ZTSN10__cxxabiv129__pointer_to_member_type_infoE
|
||||
__ZTSN10__cxxabiv123__fundamental_type_infoE
|
||||
__ZTSN10__cxxabiv121__vmi_class_type_infoE
|
||||
__ZTSN10__cxxabiv120__si_class_type_infoE
|
||||
__ZTSN10__cxxabiv120__function_type_infoE
|
||||
__ZTSN10__cxxabiv119__pointer_type_infoE
|
||||
__ZTSN10__cxxabiv117__pbase_type_infoE
|
||||
__ZTSN10__cxxabiv117__class_type_infoE
|
||||
__ZTSN10__cxxabiv117__array_type_infoE
|
||||
__ZTSN10__cxxabiv116__enum_type_infoE
|
||||
__ZTIy
|
||||
__ZTIx
|
||||
__ZTIw
|
||||
__ZTIv
|
@@ -165,7 +165,7 @@ ios_base::iword(int index)
|
||||
size_t newcap;
|
||||
const size_t mx = std::numeric_limits<size_t>::max();
|
||||
if (req_size < mx/2)
|
||||
newcap = max(2 * __iarray_cap_, req_size);
|
||||
newcap = _STD::max(2 * __iarray_cap_, req_size);
|
||||
else
|
||||
newcap = mx;
|
||||
long* iarray = (long*)realloc(__iarray_, newcap * sizeof(long));
|
||||
@@ -193,7 +193,7 @@ ios_base::pword(int index)
|
||||
size_t newcap;
|
||||
const size_t mx = std::numeric_limits<size_t>::max();
|
||||
if (req_size < mx/2)
|
||||
newcap = max(2 * __parray_cap_, req_size);
|
||||
newcap = _STD::max(2 * __parray_cap_, req_size);
|
||||
else
|
||||
newcap = mx;
|
||||
void** parray = (void**)realloc(__parray_, newcap * sizeof(void*));
|
||||
@@ -223,7 +223,7 @@ ios_base::register_callback(event_callback fn, int index)
|
||||
size_t newcap;
|
||||
const size_t mx = std::numeric_limits<size_t>::max();
|
||||
if (req_size < mx/2)
|
||||
newcap = max(2 * __event_cap_, req_size);
|
||||
newcap = _STD::max(2 * __event_cap_, req_size);
|
||||
else
|
||||
newcap = mx;
|
||||
event_callback* fns = (event_callback*)realloc(__fn_, newcap * sizeof(event_callback));
|
||||
|
@@ -229,7 +229,7 @@ string
|
||||
__get_collation_name(const char* s)
|
||||
{
|
||||
const collationnames* i =
|
||||
lower_bound(begin(collatenames), end(collatenames), s, use_strcmp());
|
||||
_STD::lower_bound(begin(collatenames), end(collatenames), s, use_strcmp());
|
||||
string r;
|
||||
if (i != end(collatenames) && strcmp(s, i->elem_) == 0)
|
||||
r = char(i->char_);
|
||||
@@ -240,7 +240,7 @@ ctype_base::mask
|
||||
__get_classname(const char* s, bool __icase)
|
||||
{
|
||||
const classnames* i =
|
||||
lower_bound(begin(ClassNames), end(ClassNames), s, use_strcmp());
|
||||
_STD::lower_bound(begin(ClassNames), end(ClassNames), s, use_strcmp());
|
||||
ctype_base::mask r = 0;
|
||||
if (i != end(ClassNames) && strcmp(s, i->elem_) == 0)
|
||||
{
|
||||
|
@@ -302,7 +302,7 @@ strstreambuf::seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmod
|
||||
{
|
||||
char* newpos = eback() + newoff;
|
||||
if (pos_in)
|
||||
setg(eback(), newpos, max(newpos, egptr()));
|
||||
setg(eback(), newpos, _STD::max(newpos, egptr()));
|
||||
if (pos_out)
|
||||
{
|
||||
// min(pbase, newpos), newpos, epptr()
|
||||
@@ -332,7 +332,7 @@ strstreambuf::seekpos(pos_type __sp, ios_base::openmode __which)
|
||||
{
|
||||
char* newpos = eback() + newoff;
|
||||
if (pos_in)
|
||||
setg(eback(), newpos, max(newpos, egptr()));
|
||||
setg(eback(), newpos, _STD::max(newpos, egptr()));
|
||||
if (pos_out)
|
||||
{
|
||||
// min(pbase, newpos), newpos, epptr()
|
||||
|
@@ -24,7 +24,7 @@ public:
|
||||
bool operator==(const Emplaceable& x) const
|
||||
{return int_ == x.int_ && double_ == x.double_;}
|
||||
bool operator<(const Emplaceable& x) const
|
||||
{return int_ < x.int_ || int_ == x.int_ && double_ < x.double_;}
|
||||
{return int_ < x.int_ || (int_ == x.int_ && double_ < x.double_);}
|
||||
|
||||
int get() const {return int_;}
|
||||
};
|
||||
|
@@ -7,13 +7,19 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// type_traits
|
||||
// <map>
|
||||
|
||||
// aligned_union
|
||||
// class map
|
||||
|
||||
#include <type_traits>
|
||||
// map();
|
||||
|
||||
#include <map>
|
||||
|
||||
struct X
|
||||
{
|
||||
std::multimap<int, X> m;
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
#error aligned_union is not implemented
|
||||
}
|
@@ -13,6 +13,8 @@
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
#include "../../hexfloat.h"
|
||||
|
||||
void test_acos()
|
||||
{
|
||||
static_assert((std::is_same<decltype(acos((double)0)), double>::value), "");
|
||||
@@ -194,9 +196,9 @@ void test_tanh()
|
||||
|
||||
void test_signbit()
|
||||
{
|
||||
static_assert((std::is_same<decltype(signbit((float)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(signbit((double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(signbit((long double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(signbit((float)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(signbit((double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(signbit((long double)0)), bool>::value), "");
|
||||
assert(signbit(-1.0) == true);
|
||||
}
|
||||
|
||||
@@ -210,117 +212,117 @@ void test_fpclassify()
|
||||
|
||||
void test_isfinite()
|
||||
{
|
||||
static_assert((std::is_same<decltype(isfinite((float)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isfinite((double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isfinite((long double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isfinite((float)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isfinite((double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isfinite((long double)0)), bool>::value), "");
|
||||
assert(isfinite(-1.0) == true);
|
||||
}
|
||||
|
||||
void test_isinf()
|
||||
{
|
||||
static_assert((std::is_same<decltype(isinf((float)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isinf((double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isinf((long double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isinf((float)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isinf((double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isinf((long double)0)), bool>::value), "");
|
||||
assert(isinf(-1.0) == false);
|
||||
}
|
||||
|
||||
void test_isnan()
|
||||
{
|
||||
static_assert((std::is_same<decltype(isnan((float)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isnan((double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isnan((long double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isnan((float)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isnan((double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isnan((long double)0)), bool>::value), "");
|
||||
assert(isnan(-1.0) == false);
|
||||
}
|
||||
|
||||
void test_isnormal()
|
||||
{
|
||||
static_assert((std::is_same<decltype(isnormal((float)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isnormal((double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isnormal((long double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isnormal((float)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isnormal((double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isnormal((long double)0)), bool>::value), "");
|
||||
assert(isnormal(-1.0) == true);
|
||||
}
|
||||
|
||||
void test_isgreater()
|
||||
{
|
||||
static_assert((std::is_same<decltype(isgreater((float)0, (float)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreater((float)0, (double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreater((float)0, (long double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreater((double)0, (float)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreater((double)0, (double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreater((double)0, (long double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreater((long double)0, (float)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreater((long double)0, (double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreater((long double)0, (long double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreater((float)0, (float)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreater((float)0, (double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreater((float)0, (long double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreater((double)0, (float)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreater((double)0, (double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreater((double)0, (long double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreater((long double)0, (float)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreater((long double)0, (double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreater((long double)0, (long double)0)), bool>::value), "");
|
||||
assert(isgreater(-1.0, 0.F) == false);
|
||||
}
|
||||
|
||||
void test_isgreaterequal()
|
||||
{
|
||||
static_assert((std::is_same<decltype(isgreaterequal((float)0, (float)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreaterequal((float)0, (double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreaterequal((float)0, (long double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreaterequal((double)0, (float)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreaterequal((double)0, (double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreaterequal((double)0, (long double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreaterequal((long double)0, (float)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreaterequal((long double)0, (double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreaterequal((long double)0, (long double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreaterequal((float)0, (float)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreaterequal((float)0, (double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreaterequal((float)0, (long double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreaterequal((double)0, (float)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreaterequal((double)0, (double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreaterequal((double)0, (long double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreaterequal((long double)0, (float)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreaterequal((long double)0, (double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isgreaterequal((long double)0, (long double)0)), bool>::value), "");
|
||||
assert(isgreaterequal(-1.0, 0.F) == false);
|
||||
}
|
||||
|
||||
void test_isless()
|
||||
{
|
||||
static_assert((std::is_same<decltype(isless((float)0, (float)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isless((float)0, (double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isless((float)0, (long double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isless((double)0, (float)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isless((double)0, (double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isless((double)0, (long double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isless((long double)0, (float)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isless((long double)0, (double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isless((long double)0, (long double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isless((float)0, (float)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isless((float)0, (double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isless((float)0, (long double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isless((double)0, (float)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isless((double)0, (double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isless((double)0, (long double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isless((long double)0, (float)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isless((long double)0, (double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isless((long double)0, (long double)0)), bool>::value), "");
|
||||
assert(isless(-1.0, 0.F) == true);
|
||||
}
|
||||
|
||||
void test_islessequal()
|
||||
{
|
||||
static_assert((std::is_same<decltype(islessequal((float)0, (float)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(islessequal((float)0, (double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(islessequal((float)0, (long double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(islessequal((double)0, (float)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(islessequal((double)0, (double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(islessequal((double)0, (long double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(islessequal((long double)0, (float)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(islessequal((long double)0, (double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(islessequal((long double)0, (long double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(islessequal((float)0, (float)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(islessequal((float)0, (double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(islessequal((float)0, (long double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(islessequal((double)0, (float)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(islessequal((double)0, (double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(islessequal((double)0, (long double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(islessequal((long double)0, (float)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(islessequal((long double)0, (double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(islessequal((long double)0, (long double)0)), bool>::value), "");
|
||||
assert(islessequal(-1.0, 0.F) == true);
|
||||
}
|
||||
|
||||
void test_islessgreater()
|
||||
{
|
||||
static_assert((std::is_same<decltype(islessgreater((float)0, (float)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(islessgreater((float)0, (double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(islessgreater((float)0, (long double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(islessgreater((double)0, (float)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(islessgreater((double)0, (double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(islessgreater((double)0, (long double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(islessgreater((long double)0, (float)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(islessgreater((long double)0, (double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(islessgreater((long double)0, (long double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(islessgreater((float)0, (float)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(islessgreater((float)0, (double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(islessgreater((float)0, (long double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(islessgreater((double)0, (float)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(islessgreater((double)0, (double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(islessgreater((double)0, (long double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(islessgreater((long double)0, (float)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(islessgreater((long double)0, (double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(islessgreater((long double)0, (long double)0)), bool>::value), "");
|
||||
assert(islessgreater(-1.0, 0.F) == true);
|
||||
}
|
||||
|
||||
void test_isunordered()
|
||||
{
|
||||
static_assert((std::is_same<decltype(isunordered((float)0, (float)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isunordered((float)0, (double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isunordered((float)0, (long double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isunordered((double)0, (float)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isunordered((double)0, (double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isunordered((double)0, (long double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isunordered((long double)0, (float)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isunordered((long double)0, (double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isunordered((long double)0, (long double)0)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(isunordered((float)0, (float)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isunordered((float)0, (double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isunordered((float)0, (long double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isunordered((double)0, (float)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isunordered((double)0, (double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isunordered((double)0, (long double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isunordered((long double)0, (float)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isunordered((long double)0, (double)0)), bool>::value), "");
|
||||
static_assert((std::is_same<decltype(isunordered((long double)0, (long double)0)), bool>::value), "");
|
||||
assert(isunordered(-1.0, 0.F) == false);
|
||||
}
|
||||
|
||||
@@ -528,7 +530,7 @@ void test_nextafter()
|
||||
static_assert((std::is_same<decltype(nextafter((double)0, (double)0)), double>::value), "");
|
||||
static_assert((std::is_same<decltype(nextafterf(0,0)), float>::value), "");
|
||||
static_assert((std::is_same<decltype(nextafterl(0,0)), long double>::value), "");
|
||||
assert(nextafter(0,1) == 0x1p-1074);
|
||||
assert(nextafter(0,1) == hexfloat<double>(0x1, 0, -1074));
|
||||
}
|
||||
|
||||
void test_nexttoward()
|
||||
@@ -536,7 +538,7 @@ void test_nexttoward()
|
||||
static_assert((std::is_same<decltype(nexttoward((double)0, (long double)0)), double>::value), "");
|
||||
static_assert((std::is_same<decltype(nexttowardf(0, (long double)0)), float>::value), "");
|
||||
static_assert((std::is_same<decltype(nexttowardl(0, (long double)0)), long double>::value), "");
|
||||
assert(nexttoward(0, 1) == 0x1p-1074);
|
||||
assert(nexttoward(0, 1) == hexfloat<double>(0x1, 0, -1074));
|
||||
}
|
||||
|
||||
void test_remainder()
|
||||
|
@@ -95,19 +95,19 @@ int main()
|
||||
static_assert((std::is_same<decltype(freopen("", "", fp)), FILE*>::value), "");
|
||||
static_assert((std::is_same<decltype(setbuf(fp,cp)), void>::value), "");
|
||||
static_assert((std::is_same<decltype(vfprintf(fp,"",va)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(fprintf(fp,"")), int>::value), "");
|
||||
static_assert((std::is_same<decltype(fprintf(fp," ")), int>::value), "");
|
||||
static_assert((std::is_same<decltype(fscanf(fp,"")), int>::value), "");
|
||||
static_assert((std::is_same<decltype(printf("")), int>::value), "");
|
||||
static_assert((std::is_same<decltype(scanf("")), int>::value), "");
|
||||
static_assert((std::is_same<decltype(snprintf(cp,0,"")), int>::value), "");
|
||||
static_assert((std::is_same<decltype(sprintf(cp,"")), int>::value), "");
|
||||
static_assert((std::is_same<decltype(printf("\n")), int>::value), "");
|
||||
static_assert((std::is_same<decltype(scanf("\n")), int>::value), "");
|
||||
static_assert((std::is_same<decltype(snprintf(cp,0,"p")), int>::value), "");
|
||||
static_assert((std::is_same<decltype(sprintf(cp," ")), int>::value), "");
|
||||
static_assert((std::is_same<decltype(sscanf("","")), int>::value), "");
|
||||
static_assert((std::is_same<decltype(vfprintf(fp,"",va)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(vfscanf(fp,"",va)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(vprintf("",va)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(vprintf(" ",va)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(vscanf("",va)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(vsnprintf(cp,0,"",va)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(vsprintf(cp,"",va)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(vsnprintf(cp,0," ",va)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(vsprintf(cp," ",va)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(vsscanf("","",va)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(fgetc(fp)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(fgets(cp,0,fp)), char*>::value), "");
|
||||
|
38
test/hexfloat.h
Normal file
38
test/hexfloat.h
Normal file
@@ -0,0 +1,38 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// Define a hexfloat literal emulator since we can't depend on being able to
|
||||
// for hexfloat literals
|
||||
|
||||
// 0x10.F5p-10 == hexfloat<double>(0x10, 0xF5, -10)
|
||||
|
||||
#ifndef HEXFLOAT_H
|
||||
#define HEXFLOAT_H
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <climits>
|
||||
|
||||
template <class T>
|
||||
class hexfloat
|
||||
{
|
||||
T value_;
|
||||
public:
|
||||
hexfloat(long long m1, unsigned long long m0, int exp)
|
||||
{
|
||||
const std::size_t n = sizeof(unsigned long long) * CHAR_BIT;
|
||||
int s = m1 < 0 ? -1 : 1;
|
||||
value_ = std::ldexp(m1 + s * std::ldexp(T(m0), -static_cast<int>(n -
|
||||
std::__clz(m0)/4*4)), exp);
|
||||
}
|
||||
|
||||
operator T() const {return value_;}
|
||||
};
|
||||
|
||||
#endif
|
@@ -95,19 +95,19 @@ int main()
|
||||
static_assert((std::is_same<decltype(std::freopen("", "", fp)), std::FILE*>::value), "");
|
||||
static_assert((std::is_same<decltype(std::setbuf(fp,cp)), void>::value), "");
|
||||
static_assert((std::is_same<decltype(std::vfprintf(fp,"",va)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(std::fprintf(fp,"")), int>::value), "");
|
||||
static_assert((std::is_same<decltype(std::fprintf(fp," ")), int>::value), "");
|
||||
static_assert((std::is_same<decltype(std::fscanf(fp,"")), int>::value), "");
|
||||
static_assert((std::is_same<decltype(std::printf("")), int>::value), "");
|
||||
static_assert((std::is_same<decltype(std::scanf("")), int>::value), "");
|
||||
static_assert((std::is_same<decltype(std::snprintf(cp,0,"")), int>::value), "");
|
||||
static_assert((std::is_same<decltype(std::sprintf(cp,"")), int>::value), "");
|
||||
static_assert((std::is_same<decltype(std::printf(" ")), int>::value), "");
|
||||
static_assert((std::is_same<decltype(std::scanf(" ")), int>::value), "");
|
||||
static_assert((std::is_same<decltype(std::snprintf(cp,0," ")), int>::value), "");
|
||||
static_assert((std::is_same<decltype(std::sprintf(cp," ")), int>::value), "");
|
||||
static_assert((std::is_same<decltype(std::sscanf("","")), int>::value), "");
|
||||
static_assert((std::is_same<decltype(std::vfprintf(fp,"",va)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(std::vfscanf(fp,"",va)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(std::vprintf("",va)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(std::vprintf(" ",va)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(std::vscanf("",va)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(std::vsnprintf(cp,0,"",va)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(std::vsprintf(cp,"",va)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(std::vsnprintf(cp,0," ",va)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(std::vsprintf(cp," ",va)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(std::vsscanf("","",va)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(std::fgetc(fp)), int>::value), "");
|
||||
static_assert((std::is_same<decltype(std::fgets(cp,0,fp)), char*>::value), "");
|
||||
|
@@ -80,7 +80,7 @@ int main()
|
||||
assert(!is.fail());
|
||||
assert(c == L'b');
|
||||
is >> c;
|
||||
assert( is.eof());
|
||||
assert(!is.eof());
|
||||
assert(!is.fail());
|
||||
assert(c == L'c');
|
||||
}
|
||||
|
@@ -20,13 +20,22 @@ struct A
|
||||
}
|
||||
};
|
||||
|
||||
struct B
|
||||
{
|
||||
B()
|
||||
{
|
||||
// http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#475
|
||||
assert(!std::uncaught_exception());
|
||||
}
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
try
|
||||
{
|
||||
A a;
|
||||
assert(!std::uncaught_exception());
|
||||
throw 1;
|
||||
throw B();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
|
@@ -41,4 +41,19 @@ int main()
|
||||
assert(!(nullptr != nullptr));
|
||||
assert(!(nullptr < nullptr));
|
||||
assert(!(nullptr > nullptr));
|
||||
A* a = nullptr;
|
||||
assert(a == nullptr);
|
||||
assert(a <= nullptr);
|
||||
assert(a >= nullptr);
|
||||
assert(!(a != nullptr));
|
||||
assert(!(a < nullptr));
|
||||
assert(!(a > nullptr));
|
||||
assert(nullptr == a);
|
||||
assert(nullptr <= a);
|
||||
assert(nullptr >= a);
|
||||
assert(!(nullptr != a));
|
||||
assert(!(nullptr < a));
|
||||
assert(!(nullptr > a));
|
||||
std::ptrdiff_t i = reinterpret_cast<std::ptrdiff_t>(nullptr);
|
||||
assert(i == 0);
|
||||
}
|
||||
|
@@ -44,7 +44,7 @@ int main()
|
||||
F32_8::extern_type c8[4];
|
||||
for (F32_8::intern_type c32x = 0; c32x < 0x110003; ++c32x)
|
||||
{
|
||||
if (0xD800 <= c32x && c32x < 0xE000 || c32x >= 0x110000)
|
||||
if ((0xD800 <= c32x && c32x < 0xE000) || c32x >= 0x110000)
|
||||
{
|
||||
assert(f32_16.out(mbs, &c32x, &c32x+1, c_c32p, c16c+0, c16c+4, c16cp) == F32_8::error);
|
||||
assert(f32_8.out(mbs, &c32x, &c32x+1, c_c32p, c8, c8+4, c8p) == F32_8::error);
|
||||
|
@@ -20,6 +20,7 @@
|
||||
#include <streambuf>
|
||||
#include <cmath>
|
||||
#include "iterators.h"
|
||||
#include "../../../../../hexfloat.h"
|
||||
|
||||
typedef std::num_get<char, input_iterator<const char*> > F;
|
||||
|
||||
@@ -105,7 +106,7 @@ int main()
|
||||
ios, err, v);
|
||||
assert(iter.base() == str+sizeof(str)-1);
|
||||
assert(err == ios.goodbit);
|
||||
assert(v == 0x125p-1);
|
||||
assert(v == hexfloat<double>(0x125, 0, -1));
|
||||
}
|
||||
{
|
||||
const char str[] = "inf";
|
||||
|
@@ -20,6 +20,7 @@
|
||||
#include <streambuf>
|
||||
#include <cmath>
|
||||
#include "iterators.h"
|
||||
#include "../../../../../hexfloat.h"
|
||||
|
||||
typedef std::num_get<char, input_iterator<const char*> > F;
|
||||
|
||||
@@ -93,7 +94,7 @@ int main()
|
||||
ios, err, v);
|
||||
assert(iter.base() == str+sizeof(str)-1);
|
||||
assert(err == ios.goodbit);
|
||||
assert(v == 0x125p-1);
|
||||
assert(v == hexfloat<float>(0x125, 0, -1));
|
||||
}
|
||||
{
|
||||
const char str[] = "inf";
|
||||
|
@@ -20,6 +20,7 @@
|
||||
#include <streambuf>
|
||||
#include <cmath>
|
||||
#include "iterators.h"
|
||||
#include "../../../../../hexfloat.h"
|
||||
|
||||
typedef std::num_get<char, input_iterator<const char*> > F;
|
||||
|
||||
@@ -93,7 +94,7 @@ int main()
|
||||
ios, err, v);
|
||||
assert(iter.base() == str+sizeof(str)-1);
|
||||
assert(err == ios.goodbit);
|
||||
assert(v == 0x125p-1);
|
||||
assert(v == hexfloat<long double>(0x125, 0, -1));
|
||||
}
|
||||
{
|
||||
const char str[] = "inf";
|
||||
|
@@ -0,0 +1,53 @@
|
||||
#include <limits>
|
||||
#include <sstream>
|
||||
#include <iostream>
|
||||
#include <cassert>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
template<typename T>
|
||||
void check_limits()
|
||||
{
|
||||
T minv = numeric_limits<T>::min();
|
||||
T maxv = numeric_limits<T>::max();
|
||||
|
||||
ostringstream miniss, maxiss;
|
||||
assert(miniss << minv);
|
||||
assert(maxiss << maxv);
|
||||
std::string mins = miniss.str();
|
||||
std::string maxs = maxiss.str();
|
||||
|
||||
istringstream maxoss(maxs), minoss(mins);
|
||||
|
||||
T new_minv, new_maxv;
|
||||
assert(maxoss >> new_maxv);
|
||||
assert(minoss >> new_minv);
|
||||
|
||||
assert(new_minv == minv);
|
||||
assert(new_maxv == maxv);
|
||||
|
||||
if(mins == "0")
|
||||
mins = "-1";
|
||||
else
|
||||
mins[mins.size() - 1]++;
|
||||
|
||||
maxs[maxs.size() - 1]++;
|
||||
|
||||
istringstream maxoss2(maxs), minoss2(mins);
|
||||
|
||||
assert(! (maxoss2 >> new_maxv));
|
||||
assert(! (minoss2 >> new_minv));
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
check_limits<short>();
|
||||
check_limits<unsigned short>();
|
||||
check_limits<int>();
|
||||
check_limits<unsigned int>();
|
||||
check_limits<long>();
|
||||
check_limits<unsigned long>();
|
||||
check_limits<long long>();
|
||||
check_limits<unsigned long long>();
|
||||
}
|
@@ -13,6 +13,8 @@
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
#include "../../hexfloat.h"
|
||||
|
||||
void test_abs()
|
||||
{
|
||||
static_assert((std::is_same<decltype(std::abs((float)0)), float>::value), "");
|
||||
@@ -1089,7 +1091,7 @@ void test_nextafter()
|
||||
static_assert((std::is_same<decltype(std::nextafterf(0,0)), float>::value), "");
|
||||
static_assert((std::is_same<decltype(std::nextafterl(0,0)), long double>::value), "");
|
||||
static_assert((std::is_same<decltype(std::nextafter((int)0, (int)0)), double>::value), "");
|
||||
assert(std::nextafter(0,1) == 0x1p-1074);
|
||||
assert(std::nextafter(0,1) == hexfloat<double>(0x1, 0, -1074));
|
||||
}
|
||||
|
||||
void test_nexttoward()
|
||||
@@ -1107,7 +1109,7 @@ void test_nexttoward()
|
||||
static_assert((std::is_same<decltype(std::nexttoward((long double)0, (long double)0)), long double>::value), "");
|
||||
static_assert((std::is_same<decltype(std::nexttowardf(0, (long double)0)), float>::value), "");
|
||||
static_assert((std::is_same<decltype(std::nexttowardl(0, (long double)0)), long double>::value), "");
|
||||
assert(std::nexttoward(0, 1) == 0x1p-1074);
|
||||
assert(std::nexttoward(0, 1) == hexfloat<double>(0x1, 0, -1074));
|
||||
}
|
||||
|
||||
void test_remainder()
|
||||
|
@@ -39,8 +39,6 @@ public:
|
||||
|
||||
explicit rand1(result_type sd = Min) : x_(sd)
|
||||
{
|
||||
if (x_ < Min)
|
||||
x_ = Min;
|
||||
if (x_ > Max)
|
||||
x_ = Max;
|
||||
}
|
||||
|
@@ -39,8 +39,6 @@ public:
|
||||
|
||||
explicit rand1(result_type sd = Min) : x_(sd)
|
||||
{
|
||||
if (x_ < Min)
|
||||
x_ = Min;
|
||||
if (x_ > Max)
|
||||
x_ = Max;
|
||||
}
|
||||
|
@@ -40,7 +40,7 @@ test2()
|
||||
typedef std::mt19937_64 E;
|
||||
E e1;
|
||||
e1();
|
||||
E e2 = e1;
|
||||
E e2(e1);
|
||||
assert(e1 == e2);
|
||||
assert(e1() == e2());
|
||||
E::result_type k = e1();
|
||||
|
@@ -38,7 +38,7 @@ test2()
|
||||
typedef std::ranlux48_base E;
|
||||
E e1;
|
||||
e1();
|
||||
E e2 = e1;
|
||||
E e2(e1);
|
||||
assert(e1 == e2);
|
||||
assert(e1() == e2());
|
||||
E::result_type k = e1();
|
||||
|
67
test/testit
67
test/testit
@@ -8,51 +8,14 @@
|
||||
# //
|
||||
# //===--------------------------------------------------------------------===//
|
||||
|
||||
BACKUP="../"
|
||||
|
||||
currentpath=`pwd`
|
||||
origpath=$currentpath
|
||||
currentdir=`basename $currentpath`
|
||||
while [ $currentdir != "test" ]; do
|
||||
if [ $currentdir == "/" ]
|
||||
then
|
||||
echo "current directory must be in or under \"test\"."
|
||||
exit 1
|
||||
fi
|
||||
cd ..
|
||||
currentpath=`pwd`
|
||||
currentdir=`basename $currentpath`
|
||||
BACKUP="../"$BACKUP
|
||||
done
|
||||
cd $origpath
|
||||
|
||||
if [ -z $CC ]
|
||||
then
|
||||
CC=g++
|
||||
fi
|
||||
|
||||
auto_header=0
|
||||
|
||||
if [ -z $HEADER_INCLUDE ]
|
||||
then
|
||||
HEADER_INCLUDE=$BACKUP"include"
|
||||
let "auto_header+=1"
|
||||
fi
|
||||
|
||||
auto_lib=0
|
||||
|
||||
SOURCE_LIB=/usr/lib/libc++.dylib
|
||||
#SOURCE_LIB=/Users/hinnant/Development/libcpp/lib/libc++.a
|
||||
|
||||
if [ -z $SOURCE_LIB ]
|
||||
then
|
||||
SOURCE_LIB=$BACKUP"lib/libc++.dylib"
|
||||
let "auto_lib+=1"
|
||||
CC=clang++
|
||||
fi
|
||||
|
||||
if [ -z "$OPTIONS" ]
|
||||
then
|
||||
OPTIONS="-nostdinc++ -nodefaultlibs /usr/lib/libSystem.B.dylib -arch `arch`"
|
||||
OPTIONS="-std=c++0x -stdlib=libc++"
|
||||
fi
|
||||
|
||||
FAIL=0
|
||||
@@ -68,7 +31,7 @@ function afunc
|
||||
if (ls *.fail.cpp &> /dev/null)
|
||||
then
|
||||
for FILE in $(ls *.fail.cpp); do
|
||||
if $CC $OPTIONS -I$HEADER_INCLUDE $SOURCE_LIB $FILE &> /dev/null
|
||||
if $CC $OPTIONS $HEADER_INCLUDE $SOURCE_LIB $FILE &> /dev/null
|
||||
then
|
||||
rm ./a.out
|
||||
echo "$FILE should not compile"
|
||||
@@ -82,7 +45,7 @@ function afunc
|
||||
if (ls *.pass.cpp &> /dev/null)
|
||||
then
|
||||
for FILE in $(ls *.pass.cpp); do
|
||||
if $CC $OPTIONS -I$HEADER_INCLUDE $SOURCE_LIB $FILE
|
||||
if $CC $OPTIONS $HEADER_INCLUDE $SOURCE_LIB $FILE
|
||||
then
|
||||
if ./a.out
|
||||
then
|
||||
@@ -127,27 +90,7 @@ function afunc
|
||||
if [ -d "$FILE" ];
|
||||
then
|
||||
cd $FILE
|
||||
if [ $auto_header -eq 1 ]
|
||||
then
|
||||
SAVE_HEADER_INCLUDE=$HEADER_INCLUDE
|
||||
HEADER_INCLUDE="../"$HEADER_INCLUDE
|
||||
fi
|
||||
if [ $auto_lib -eq 1 ]
|
||||
then
|
||||
SAVE_SOURCE_LIB=$SOURCE_LIB
|
||||
SOURCE_LIB="../"$SOURCE_LIB
|
||||
fi
|
||||
|
||||
afunc
|
||||
|
||||
if [ $auto_header -eq 1 ]
|
||||
then
|
||||
HEADER_INCLUDE=${HEADER_INCLUDE:3}
|
||||
fi
|
||||
if [ $auto_lib -eq 1 ]
|
||||
then
|
||||
SOURCE_LIB=${SOURCE_LIB:3}
|
||||
fi
|
||||
cd ..
|
||||
fi
|
||||
done
|
||||
@@ -158,7 +101,7 @@ afunc
|
||||
echo "****************************************************"
|
||||
echo "Results for `pwd`:"
|
||||
echo "using `$CC --version`"
|
||||
echo "with $OPTIONS -I$HEADER_INCLUDE $SOURCE_LIB"
|
||||
echo "with $OPTIONS $HEADER_INCLUDE $SOURCE_LIB"
|
||||
echo "----------------------------------------------------"
|
||||
echo "sections without tests : $UNIMPLEMENTED"
|
||||
echo "sections with failures : $IMPLEMENTED_FAIL"
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
static_assert(std::launch::any == std::launch::async | std::launch::deferred, "");
|
||||
static_assert(std::launch::any == (std::launch::async | std::launch::deferred), "");
|
||||
static_assert(std::launch::async == 1, "");
|
||||
static_assert(std::launch::deferred == 2, "");
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@
|
||||
#include <future>
|
||||
#include <cassert>
|
||||
|
||||
void func(std::promise<int>& p)
|
||||
void func(std::promise<int> p)
|
||||
{
|
||||
const int i = 5;
|
||||
p.set_exception_at_thread_exit(std::make_exception_ptr(3));
|
||||
|
@@ -19,7 +19,7 @@
|
||||
|
||||
int i = 0;
|
||||
|
||||
void func(std::promise<int&>& p)
|
||||
void func(std::promise<int&> p)
|
||||
{
|
||||
p.set_value_at_thread_exit(i);
|
||||
i = 4;
|
||||
|
@@ -19,7 +19,7 @@
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
|
||||
void func(std::promise<std::unique_ptr<int>>& p)
|
||||
void func(std::promise<std::unique_ptr<int>> p)
|
||||
{
|
||||
p.set_value_at_thread_exit(std::unique_ptr<int>(new int(5)));
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@
|
||||
#include <future>
|
||||
#include <cassert>
|
||||
|
||||
void func(std::promise<int>& p)
|
||||
void func(std::promise<int> p)
|
||||
{
|
||||
const int i = 5;
|
||||
p.set_value_at_thread_exit(i);
|
||||
|
@@ -19,7 +19,7 @@
|
||||
|
||||
int i = 0;
|
||||
|
||||
void func(std::promise<void>& p)
|
||||
void func(std::promise<void> p)
|
||||
{
|
||||
p.set_value_at_thread_exit();
|
||||
i = 1;
|
||||
|
@@ -18,13 +18,13 @@
|
||||
#include <future>
|
||||
#include <cassert>
|
||||
|
||||
void func1(std::promise<int>& p)
|
||||
void func1(std::promise<int> p)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
p.set_value(3);
|
||||
}
|
||||
|
||||
void func2(std::promise<int>& p)
|
||||
void func2(std::promise<int> p)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
p.set_exception(std::make_exception_ptr(3));
|
||||
@@ -32,26 +32,26 @@ void func2(std::promise<int>& p)
|
||||
|
||||
int j = 0;
|
||||
|
||||
void func3(std::promise<int&>& p)
|
||||
void func3(std::promise<int&> p)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
j = 5;
|
||||
p.set_value(j);
|
||||
}
|
||||
|
||||
void func4(std::promise<int&>& p)
|
||||
void func4(std::promise<int&> p)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
p.set_exception(std::make_exception_ptr(3.5));
|
||||
}
|
||||
|
||||
void func5(std::promise<void>& p)
|
||||
void func5(std::promise<void> p)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
p.set_value();
|
||||
}
|
||||
|
||||
void func6(std::promise<void>& p)
|
||||
void func6(std::promise<void> p)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
p.set_exception(std::make_exception_ptr('c'));
|
||||
|
@@ -16,7 +16,7 @@
|
||||
#include <future>
|
||||
#include <cassert>
|
||||
|
||||
void func1(std::promise<int>& p)
|
||||
void func1(std::promise<int> p)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
p.set_value(3);
|
||||
@@ -24,14 +24,14 @@ void func1(std::promise<int>& p)
|
||||
|
||||
int j = 0;
|
||||
|
||||
void func3(std::promise<int&>& p)
|
||||
void func3(std::promise<int&> p)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
j = 5;
|
||||
p.set_value(j);
|
||||
}
|
||||
|
||||
void func5(std::promise<void>& p)
|
||||
void func5(std::promise<void> p)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
p.set_value();
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
typedef std::chrono::milliseconds ms;
|
||||
|
||||
void func1(std::promise<int>& p)
|
||||
void func1(std::promise<int> p)
|
||||
{
|
||||
std::this_thread::sleep_for(ms(500));
|
||||
p.set_value(3);
|
||||
@@ -28,14 +28,14 @@ void func1(std::promise<int>& p)
|
||||
|
||||
int j = 0;
|
||||
|
||||
void func3(std::promise<int&>& p)
|
||||
void func3(std::promise<int&> p)
|
||||
{
|
||||
std::this_thread::sleep_for(ms(500));
|
||||
j = 5;
|
||||
p.set_value(j);
|
||||
}
|
||||
|
||||
void func5(std::promise<void>& p)
|
||||
void func5(std::promise<void> p)
|
||||
{
|
||||
std::this_thread::sleep_for(ms(500));
|
||||
p.set_value();
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
typedef std::chrono::milliseconds ms;
|
||||
|
||||
void func1(std::promise<int>& p)
|
||||
void func1(std::promise<int> p)
|
||||
{
|
||||
std::this_thread::sleep_for(ms(500));
|
||||
p.set_value(3);
|
||||
@@ -28,14 +28,14 @@ void func1(std::promise<int>& p)
|
||||
|
||||
int j = 0;
|
||||
|
||||
void func3(std::promise<int&>& p)
|
||||
void func3(std::promise<int&> p)
|
||||
{
|
||||
std::this_thread::sleep_for(ms(500));
|
||||
j = 5;
|
||||
p.set_value(j);
|
||||
}
|
||||
|
||||
void func5(std::promise<void>& p)
|
||||
void func5(std::promise<void> p)
|
||||
{
|
||||
std::this_thread::sleep_for(ms(500));
|
||||
p.set_value();
|
||||
|
@@ -46,7 +46,7 @@ int main()
|
||||
assert(A::n_copies == 0);
|
||||
assert(A::n_moves > 0);
|
||||
}
|
||||
A::n_copies == 0;
|
||||
A::n_copies = 0;
|
||||
A::n_copies = 0;
|
||||
{
|
||||
A a(5);
|
||||
|
@@ -51,7 +51,7 @@ int main()
|
||||
assert(A::n_moves > 0);
|
||||
}
|
||||
assert(test_alloc_base::count == 0);
|
||||
A::n_copies == 0;
|
||||
A::n_copies = 0;
|
||||
A::n_copies = 0;
|
||||
{
|
||||
A a(5);
|
||||
|
@@ -26,11 +26,11 @@ public:
|
||||
long operator()(long i, long j) const {return data_ + i + j;}
|
||||
};
|
||||
|
||||
void func(std::packaged_task<double(int, char)>& p)
|
||||
void func(std::packaged_task<double(int, char)> p)
|
||||
{
|
||||
}
|
||||
|
||||
void func2(std::packaged_task<double(int, char)>& p)
|
||||
void func2(std::packaged_task<double(int, char)> p)
|
||||
{
|
||||
p(3, 'a');
|
||||
}
|
||||
|
@@ -31,19 +31,19 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
void func0(std::packaged_task<double(int, char)>& p)
|
||||
void func0(std::packaged_task<double(int, char)> p)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
p.make_ready_at_thread_exit(3, 'a');
|
||||
}
|
||||
|
||||
void func1(std::packaged_task<double(int, char)>& p)
|
||||
void func1(std::packaged_task<double(int, char)> p)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
p.make_ready_at_thread_exit(3, 'z');
|
||||
}
|
||||
|
||||
void func2(std::packaged_task<double(int, char)>& p)
|
||||
void func2(std::packaged_task<double(int, char)> p)
|
||||
{
|
||||
p.make_ready_at_thread_exit(3, 'a');
|
||||
try
|
||||
@@ -56,7 +56,7 @@ void func2(std::packaged_task<double(int, char)>& p)
|
||||
}
|
||||
}
|
||||
|
||||
void func3(std::packaged_task<double(int, char)>& p)
|
||||
void func3(std::packaged_task<double(int, char)> p)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@@ -31,19 +31,19 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
void func0(std::packaged_task<double(int, char)>& p)
|
||||
void func0(std::packaged_task<double(int, char)> p)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
p(3, 'a');
|
||||
}
|
||||
|
||||
void func1(std::packaged_task<double(int, char)>& p)
|
||||
void func1(std::packaged_task<double(int, char)> p)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
p(3, 'z');
|
||||
}
|
||||
|
||||
void func2(std::packaged_task<double(int, char)>& p)
|
||||
void func2(std::packaged_task<double(int, char)> p)
|
||||
{
|
||||
p(3, 'a');
|
||||
try
|
||||
@@ -56,7 +56,7 @@ void func2(std::packaged_task<double(int, char)>& p)
|
||||
}
|
||||
}
|
||||
|
||||
void func3(std::packaged_task<double(int, char)>& p)
|
||||
void func3(std::packaged_task<double(int, char)> p)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@@ -18,13 +18,13 @@
|
||||
#include <future>
|
||||
#include <cassert>
|
||||
|
||||
void func1(std::promise<int>& p)
|
||||
void func1(std::promise<int> p)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
p.set_value(3);
|
||||
}
|
||||
|
||||
void func2(std::promise<int>& p)
|
||||
void func2(std::promise<int> p)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
p.set_exception(std::make_exception_ptr(3));
|
||||
@@ -32,26 +32,26 @@ void func2(std::promise<int>& p)
|
||||
|
||||
int j = 0;
|
||||
|
||||
void func3(std::promise<int&>& p)
|
||||
void func3(std::promise<int&> p)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
j = 5;
|
||||
p.set_value(j);
|
||||
}
|
||||
|
||||
void func4(std::promise<int&>& p)
|
||||
void func4(std::promise<int&> p)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
p.set_exception(std::make_exception_ptr(3.5));
|
||||
}
|
||||
|
||||
void func5(std::promise<void>& p)
|
||||
void func5(std::promise<void> p)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
p.set_value();
|
||||
}
|
||||
|
||||
void func6(std::promise<void>& p)
|
||||
void func6(std::promise<void> p)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
p.set_exception(std::make_exception_ptr('c'));
|
||||
|
@@ -16,7 +16,7 @@
|
||||
#include <future>
|
||||
#include <cassert>
|
||||
|
||||
void func1(std::promise<int>& p)
|
||||
void func1(std::promise<int> p)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
p.set_value(3);
|
||||
@@ -24,14 +24,14 @@ void func1(std::promise<int>& p)
|
||||
|
||||
int j = 0;
|
||||
|
||||
void func3(std::promise<int&>& p)
|
||||
void func3(std::promise<int&> p)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
j = 5;
|
||||
p.set_value(j);
|
||||
}
|
||||
|
||||
void func5(std::promise<void>& p)
|
||||
void func5(std::promise<void> p)
|
||||
{
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
p.set_value();
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
typedef std::chrono::milliseconds ms;
|
||||
|
||||
void func1(std::promise<int>& p)
|
||||
void func1(std::promise<int> p)
|
||||
{
|
||||
std::this_thread::sleep_for(ms(500));
|
||||
p.set_value(3);
|
||||
@@ -28,14 +28,14 @@ void func1(std::promise<int>& p)
|
||||
|
||||
int j = 0;
|
||||
|
||||
void func3(std::promise<int&>& p)
|
||||
void func3(std::promise<int&> p)
|
||||
{
|
||||
std::this_thread::sleep_for(ms(500));
|
||||
j = 5;
|
||||
p.set_value(j);
|
||||
}
|
||||
|
||||
void func5(std::promise<void>& p)
|
||||
void func5(std::promise<void> p)
|
||||
{
|
||||
std::this_thread::sleep_for(ms(500));
|
||||
p.set_value();
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
typedef std::chrono::milliseconds ms;
|
||||
|
||||
void func1(std::promise<int>& p)
|
||||
void func1(std::promise<int> p)
|
||||
{
|
||||
std::this_thread::sleep_for(ms(500));
|
||||
p.set_value(3);
|
||||
@@ -28,14 +28,14 @@ void func1(std::promise<int>& p)
|
||||
|
||||
int j = 0;
|
||||
|
||||
void func3(std::promise<int&>& p)
|
||||
void func3(std::promise<int&> p)
|
||||
{
|
||||
std::this_thread::sleep_for(ms(500));
|
||||
j = 5;
|
||||
p.set_value(j);
|
||||
}
|
||||
|
||||
void func5(std::promise<void>& p)
|
||||
void func5(std::promise<void> p)
|
||||
{
|
||||
std::this_thread::sleep_for(ms(500));
|
||||
p.set_value();
|
||||
|
@@ -129,6 +129,22 @@ void f42()
|
||||
std::call_once(flg41, init41);
|
||||
}
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
class MoveOnly
|
||||
{
|
||||
MoveOnly(const MoveOnly&);
|
||||
public:
|
||||
MoveOnly() {}
|
||||
MoveOnly(MoveOnly&&) {}
|
||||
|
||||
void operator()(MoveOnly&&)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
// check basic functionality
|
||||
@@ -174,5 +190,9 @@ int main()
|
||||
t1.join();
|
||||
assert(init2::called == 5);
|
||||
}
|
||||
{
|
||||
std::once_flag f;
|
||||
std::call_once(f, MoveOnly(), MoveOnly());
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
}
|
||||
|
@@ -71,6 +71,22 @@ public:
|
||||
int G::n_alive = 0;
|
||||
bool G::op_run = false;
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
|
||||
class MoveOnly
|
||||
{
|
||||
MoveOnly(const MoveOnly&);
|
||||
public:
|
||||
MoveOnly() {}
|
||||
MoveOnly(MoveOnly&&) {}
|
||||
|
||||
void operator()(MoveOnly&&)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
@@ -126,5 +142,9 @@ int main()
|
||||
assert(G::n_alive == 0);
|
||||
assert(G::op_run);
|
||||
}
|
||||
{
|
||||
std::thread t = std::thread(MoveOnly(), MoveOnly());
|
||||
t.join();
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
}
|
||||
|
@@ -264,4 +264,5 @@ int main()
|
||||
{
|
||||
test_void_1();
|
||||
test_int_1();
|
||||
test_void_2();
|
||||
}
|
||||
|
@@ -241,8 +241,26 @@ test_void_2()
|
||||
}
|
||||
}
|
||||
|
||||
int f_nested(int i)
|
||||
{
|
||||
return i+1;
|
||||
}
|
||||
|
||||
int g_nested(int i)
|
||||
{
|
||||
return i*10;
|
||||
}
|
||||
|
||||
void test_nested()
|
||||
{
|
||||
using namespace std::placeholders;
|
||||
assert(std::bind(f_nested, std::bind(g_nested, _1))(3) == 31);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
test_void_1();
|
||||
test_int_1();
|
||||
test_void_2();
|
||||
test_nested();
|
||||
}
|
||||
|
@@ -64,7 +64,7 @@ public:
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
move_only(move_only&&) {++move_only_constructed;}
|
||||
move_only& operator=(move_only&&) {}
|
||||
move_only& operator=(move_only&&) {return *this;}
|
||||
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
operator std::__rv<move_only> () {return std::__rv<move_only>(*this);}
|
||||
move_only(std::__rv<move_only>) {++move_only_constructed;}
|
||||
|
@@ -47,7 +47,7 @@ int main()
|
||||
A* ptrA = pA.get();
|
||||
{
|
||||
std::shared_ptr<B> pB(new B);
|
||||
pB = pA;
|
||||
pB = std::move(pA);
|
||||
assert(B::count == 1);
|
||||
assert(A::count == 1);
|
||||
assert(pB.use_count() == 1);
|
||||
@@ -64,7 +64,7 @@ int main()
|
||||
A* ptrA = pA.get();
|
||||
{
|
||||
std::shared_ptr<B> pB(new B);
|
||||
pB = pA;
|
||||
pB = std::move(pA);
|
||||
assert(B::count == 0);
|
||||
assert(A::count == 0);
|
||||
assert(pB.use_count() == 1);
|
||||
@@ -81,7 +81,7 @@ int main()
|
||||
A* ptrA = pA.get();
|
||||
{
|
||||
std::shared_ptr<B> pB;
|
||||
pB = pA;
|
||||
pB = std::move(pA);
|
||||
assert(B::count == 1);
|
||||
assert(A::count == 1);
|
||||
assert(pB.use_count() == 1);
|
||||
@@ -98,7 +98,7 @@ int main()
|
||||
A* ptrA = pA.get();
|
||||
{
|
||||
std::shared_ptr<B> pB;
|
||||
pB = pA;
|
||||
pB = std::move(pA);
|
||||
assert(B::count == 0);
|
||||
assert(A::count == 0);
|
||||
assert(pB.use_count() == 1);
|
||||
|
@@ -20,7 +20,11 @@ int main()
|
||||
static_assert(_5::value == 5, "");
|
||||
static_assert((std::is_same<_5::value_type, int>::value), "");
|
||||
static_assert((std::is_same<_5::type, _5>::value), "");
|
||||
#ifndef _LIBCPP_HAS_NO_CONSTEXPR
|
||||
static_assert((_5() == 5), "");
|
||||
#else
|
||||
assert(_5() == 5);
|
||||
#endif
|
||||
|
||||
static_assert(std::false_type::value == false, "");
|
||||
static_assert((std::is_same<std::false_type::value_type, bool>::value), "");
|
||||
|
@@ -34,6 +34,10 @@ int main()
|
||||
static_assert((std::is_same<std::result_of<S&(unsigned char, int&)>::type, double>::value), "Error!");
|
||||
static_assert((std::is_same<std::result_of<PF1()>::type, bool>::value), "Error!");
|
||||
static_assert((std::is_same<std::result_of<PMS(std::unique_ptr<S>, int)>::type, void>::value), "Error!");
|
||||
static_assert((std::is_same<std::result_of<PMS(S, int)>::type, void>::value), "Error!");
|
||||
static_assert((std::is_same<std::result_of<PMS(const S&, int)>::type, void>::value), "Error!");
|
||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
static_assert((std::is_same<std::result_of<PMD(S)>::type, char&&>::value), "Error!");
|
||||
#endif
|
||||
static_assert((std::is_same<std::result_of<PMD(const S*)>::type, const char&>::value), "Error!");
|
||||
}
|
||||
|
@@ -31,4 +31,8 @@ int main()
|
||||
static_assert(( std::is_assignable<int&, double>::value), "");
|
||||
static_assert(( std::is_assignable<B, A>::value), "");
|
||||
static_assert((!std::is_assignable<A, B>::value), "");
|
||||
static_assert((!std::is_assignable<void, const void>::value), "");
|
||||
static_assert((!std::is_assignable<const void, const void>::value), "");
|
||||
static_assert(( std::is_assignable<void*&, void*>::value), "");
|
||||
static_assert((!std::is_assignable<int(), int>::value), "");
|
||||
}
|
||||
|
@@ -18,6 +18,8 @@ struct A
|
||||
{
|
||||
explicit A(int);
|
||||
A(int, double);
|
||||
private:
|
||||
A(char);
|
||||
};
|
||||
|
||||
int main()
|
||||
@@ -27,4 +29,9 @@ int main()
|
||||
static_assert((std::is_constructible<A, int>::value), "");
|
||||
static_assert((std::is_constructible<A, int, double>::value), "");
|
||||
static_assert((!std::is_constructible<A>::value), "");
|
||||
static_assert((!std::is_constructible<A, char>::value), "");
|
||||
static_assert((!std::is_constructible<A, void>::value), "");
|
||||
static_assert((!std::is_constructible<void>::value), "");
|
||||
static_assert((!std::is_constructible<int&>::value), "");
|
||||
static_assert(( std::is_constructible<int&, int&>::value), "");
|
||||
}
|
||||
|
@@ -35,6 +35,11 @@ struct A
|
||||
A();
|
||||
};
|
||||
|
||||
class B
|
||||
{
|
||||
B& operator=(const B&);
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
static_assert(( std::is_copy_assignable<int>::value), "");
|
||||
@@ -47,4 +52,6 @@ int main()
|
||||
static_assert(( std::is_copy_assignable<Union>::value), "");
|
||||
static_assert(( std::is_copy_assignable<NotEmpty>::value), "");
|
||||
static_assert(( std::is_copy_assignable<Empty>::value), "");
|
||||
static_assert((!std::is_copy_assignable<B>::value), "");
|
||||
static_assert((!std::is_copy_assignable<void>::value), "");
|
||||
}
|
||||
|
@@ -47,6 +47,11 @@ struct A
|
||||
A(const A&);
|
||||
};
|
||||
|
||||
class B
|
||||
{
|
||||
B(const B&);
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
test_is_copy_constructible<char[3], false>();
|
||||
@@ -55,6 +60,7 @@ int main()
|
||||
test_is_copy_constructible<Abstract, false>();
|
||||
|
||||
test_is_copy_constructible<A, true>();
|
||||
test_is_copy_constructible<B, false>();
|
||||
test_is_copy_constructible<int&, true>();
|
||||
test_is_copy_constructible<Union, true>();
|
||||
test_is_copy_constructible<Empty, true>();
|
||||
|
@@ -50,6 +50,11 @@ struct A
|
||||
A();
|
||||
};
|
||||
|
||||
class B
|
||||
{
|
||||
B();
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
test_is_default_constructible<void, false>();
|
||||
@@ -58,6 +63,7 @@ int main()
|
||||
test_is_default_constructible<Abstract, false>();
|
||||
|
||||
test_is_default_constructible<A, true>();
|
||||
test_is_default_constructible<B, false>();
|
||||
test_is_default_constructible<Union, true>();
|
||||
test_is_default_constructible<Empty, true>();
|
||||
test_is_default_constructible<int, true>();
|
||||
|
@@ -13,10 +13,21 @@
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
struct A
|
||||
{
|
||||
};
|
||||
|
||||
struct B
|
||||
{
|
||||
B();
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
static_assert( std::is_literal_type<int>::value, "");
|
||||
static_assert( std::is_literal_type<const int>::value, "");
|
||||
static_assert(!std::is_literal_type<int&>::value, "");
|
||||
static_assert(!std::is_literal_type<volatile int&>::value, "");
|
||||
static_assert( std::is_literal_type<int&>::value, "");
|
||||
static_assert( std::is_literal_type<volatile int&>::value, "");
|
||||
static_assert( std::is_literal_type<A>::value, "");
|
||||
static_assert(!std::is_literal_type<B>::value, "");
|
||||
}
|
||||
|
@@ -41,7 +41,8 @@ int main()
|
||||
static_assert((!std::is_move_assignable<const int>::value), "");
|
||||
static_assert((!std::is_move_assignable<int[]>::value), "");
|
||||
static_assert((!std::is_move_assignable<int[3]>::value), "");
|
||||
static_assert(( std::is_move_assignable<int&>::value), "");
|
||||
static_assert((!std::is_move_assignable<int[3]>::value), "");
|
||||
static_assert((!std::is_move_assignable<void>::value), "");
|
||||
static_assert(( std::is_move_assignable<A>::value), "");
|
||||
static_assert(( std::is_move_assignable<bit_zero>::value), "");
|
||||
static_assert(( std::is_move_assignable<Union>::value), "");
|
||||
|
@@ -47,4 +47,6 @@ int main()
|
||||
static_assert((!std::is_nothrow_constructible<A, int>::value), "");
|
||||
static_assert((!std::is_nothrow_constructible<A, int, double>::value), "");
|
||||
static_assert((!std::is_nothrow_constructible<A>::value), "");
|
||||
static_assert(( std::is_nothrow_constructible<Empty>::value), "");
|
||||
static_assert(( std::is_nothrow_constructible<Empty, const Empty&>::value), "");
|
||||
}
|
||||
|
@@ -42,6 +42,7 @@ struct A
|
||||
|
||||
int main()
|
||||
{
|
||||
test_has_nothrow_assign<const int, false>();
|
||||
test_has_nothrow_assign<void, false>();
|
||||
test_has_nothrow_assign<A, false>();
|
||||
test_has_nothrow_assign<int&, true>();
|
||||
|
@@ -18,8 +18,6 @@ void test_is_nothrow_copy_constructible()
|
||||
{
|
||||
static_assert( std::is_nothrow_copy_constructible<T>::value, "");
|
||||
static_assert( std::is_nothrow_copy_constructible<const T>::value, "");
|
||||
static_assert( std::is_nothrow_copy_constructible<volatile T>::value, "");
|
||||
static_assert( std::is_nothrow_copy_constructible<const volatile T>::value, "");
|
||||
}
|
||||
|
||||
template <class T>
|
||||
@@ -35,12 +33,6 @@ class Empty
|
||||
{
|
||||
};
|
||||
|
||||
class NotEmpty
|
||||
{
|
||||
public:
|
||||
virtual ~NotEmpty();
|
||||
};
|
||||
|
||||
union Union {};
|
||||
|
||||
struct bit_zero
|
||||
@@ -65,6 +57,5 @@ int main()
|
||||
test_is_nothrow_copy_constructible<double>();
|
||||
test_is_nothrow_copy_constructible<int*>();
|
||||
test_is_nothrow_copy_constructible<const int*>();
|
||||
test_is_nothrow_copy_constructible<NotEmpty>();
|
||||
test_is_nothrow_copy_constructible<bit_zero>();
|
||||
}
|
||||
|
@@ -35,12 +35,6 @@ class Empty
|
||||
{
|
||||
};
|
||||
|
||||
class NotEmpty
|
||||
{
|
||||
public:
|
||||
virtual ~NotEmpty();
|
||||
};
|
||||
|
||||
union Union {};
|
||||
|
||||
struct bit_zero
|
||||
@@ -66,6 +60,5 @@ int main()
|
||||
test_is_nothrow_default_constructible<int*>();
|
||||
test_is_nothrow_default_constructible<const int*>();
|
||||
test_is_nothrow_default_constructible<char[3]>();
|
||||
test_is_nothrow_default_constructible<NotEmpty>();
|
||||
test_is_nothrow_default_constructible<bit_zero>();
|
||||
}
|
||||
|
@@ -18,8 +18,6 @@ void test_is_nothrow_move_constructible()
|
||||
{
|
||||
static_assert( std::is_nothrow_move_constructible<T>::value, "");
|
||||
static_assert( std::is_nothrow_move_constructible<const T>::value, "");
|
||||
static_assert( std::is_nothrow_move_constructible<volatile T>::value, "");
|
||||
static_assert( std::is_nothrow_move_constructible<const volatile T>::value, "");
|
||||
}
|
||||
|
||||
template <class T>
|
||||
@@ -35,12 +33,6 @@ class Empty
|
||||
{
|
||||
};
|
||||
|
||||
class NotEmpty
|
||||
{
|
||||
public:
|
||||
virtual ~NotEmpty();
|
||||
};
|
||||
|
||||
union Union {};
|
||||
|
||||
struct bit_zero
|
||||
@@ -58,13 +50,12 @@ int main()
|
||||
test_has_not_nothrow_move_constructor<void>();
|
||||
test_has_not_nothrow_move_constructor<A>();
|
||||
|
||||
test_has_not_nothrow_move_constructor<int&>();
|
||||
test_is_nothrow_move_constructible<int&>();
|
||||
test_is_nothrow_move_constructible<Union>();
|
||||
test_is_nothrow_move_constructible<Empty>();
|
||||
test_is_nothrow_move_constructible<int>();
|
||||
test_is_nothrow_move_constructible<double>();
|
||||
test_is_nothrow_move_constructible<int*>();
|
||||
test_is_nothrow_move_constructible<const int*>();
|
||||
test_is_nothrow_move_constructible<NotEmpty>();
|
||||
test_is_nothrow_move_constructible<bit_zero>();
|
||||
}
|
||||
|
@@ -13,9 +13,18 @@
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
template <class T1, class T2>
|
||||
struct pair
|
||||
{
|
||||
T1 first;
|
||||
T2 second;
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
static_assert( std::is_standard_layout<int>::value, "");
|
||||
static_assert( std::is_standard_layout<int[3]>::value, "");
|
||||
static_assert(!std::is_standard_layout<int&>::value, "");
|
||||
static_assert(!std::is_standard_layout<volatile int&>::value, "");
|
||||
static_assert(( std::is_standard_layout<pair<int, double> >::value), "");
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user