Compare commits
1 Commits
svn-tags/l
...
svn-tags/l
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3887a2b3a7 |
26
Makefile
26
Makefile
@@ -9,12 +9,6 @@ OBJROOT=.
|
||||
SYMROOT=.
|
||||
export TRIPLE=-apple-
|
||||
|
||||
ifeq (,$(RC_INDIGO))
|
||||
INSTALL_PREFIX=""
|
||||
else
|
||||
INSTALL_PREFIX="$(SDKROOT)"
|
||||
endif
|
||||
|
||||
installsrc:: $(SRCROOT)
|
||||
|
||||
ditto $(SRCDIRS)/include $(SRCROOT)/include
|
||||
@@ -26,19 +20,19 @@ clean::
|
||||
|
||||
installhdrs::
|
||||
|
||||
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/*
|
||||
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/*
|
||||
|
||||
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)/$(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
|
||||
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
|
||||
|
@@ -25,7 +25,6 @@ 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,11 +47,6 @@
|
||||
# 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
|
||||
@@ -91,9 +86,8 @@
|
||||
|
||||
#if defined(__clang__)
|
||||
|
||||
//#if !__has_feature(cxx_alias_templates)
|
||||
#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
|
||||
#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
|
||||
//#endif
|
||||
|
||||
#ifndef __GXX_EXPERIMENTAL_CXX0X__
|
||||
#ifdef __linux__
|
||||
@@ -144,7 +138,6 @@ 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))
|
||||
@@ -169,14 +162,6 @@ 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__)
|
||||
@@ -188,9 +173,6 @@ 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
|
||||
@@ -202,12 +184,10 @@ 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
|
||||
@@ -227,6 +207,7 @@ 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,55 +281,161 @@ struct __weak_result_type<_R (_C::*)(_A1, _A2, _A3...) const volatile>
|
||||
|
||||
// __invoke
|
||||
|
||||
// bullets 1 and 2
|
||||
// first bullet
|
||||
|
||||
template <class _F, class _A0, class ..._Args>
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
auto
|
||||
__invoke(_F&& __f, _A0&& __a0, _Args&& ...__args)
|
||||
-> decltype((_STD::forward<_A0>(__a0).*__f)(_STD::forward<_Args>(__args)...))
|
||||
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)
|
||||
{
|
||||
return (_STD::forward<_A0>(__a0).*__f)(_STD::forward<_Args>(__args)...);
|
||||
return (_STD::forward<_T>(__t1).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
}
|
||||
|
||||
template <class _F, class _A0, class ..._Args>
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
auto
|
||||
__invoke(_F&& __f, _A0&& __a0, _Args&& ...__args)
|
||||
-> decltype(((*_STD::forward<_A0>(__a0)).*__f)(_STD::forward<_Args>(__args)...))
|
||||
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<_A0>(__a0)).*__f)(_STD::forward<_Args>(__args)...);
|
||||
return (_STD::forward<const _T>(__t1).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
}
|
||||
|
||||
// bullets 3 and 4
|
||||
|
||||
template <class _F, class _A0>
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
auto
|
||||
__invoke(_F&& __f, _A0&& __a0)
|
||||
-> decltype(_STD::forward<_A0>(__a0).*__f)
|
||||
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<_A0>(__a0).*__f;
|
||||
return (_STD::forward<volatile _T>(__t1).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
}
|
||||
|
||||
template <class _F, class _A0>
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
auto
|
||||
__invoke(_F&& __f, _A0&& __a0)
|
||||
-> decltype((*_STD::forward<_A0>(__a0)).*__f)
|
||||
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<_A0>(__a0)).*__f;
|
||||
return (_STD::forward<const volatile _T>(__t1).*__f)(_STD::forward<_Arg>(__arg)...);
|
||||
}
|
||||
|
||||
// bullet 5
|
||||
// second bullet
|
||||
|
||||
template <class _F, class ..._Args>
|
||||
template <class _R, class _T, class _T1, class ..._Param, class ..._Arg>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
auto
|
||||
__invoke(_F&& __f, _Args&& ...__args)
|
||||
-> decltype(_STD::forward<_F>(__f)(_STD::forward<_Args>(__args)...))
|
||||
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)
|
||||
{
|
||||
return _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)...);
|
||||
}
|
||||
|
||||
template <class _Tp, class ..._Args>
|
||||
@@ -362,7 +468,7 @@ public:
|
||||
// invoke
|
||||
template <class... _ArgTypes>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename __invoke_of<type&, _ArgTypes...>::type
|
||||
typename __invoke_return<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;
|
||||
|
||||
_NodePtr __next_;
|
||||
pointer __next_;
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY __hash_node_base() : __next_(nullptr) {}
|
||||
};
|
||||
|
@@ -769,7 +769,6 @@ 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>
|
||||
@@ -780,10 +779,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>
|
||||
@@ -911,12 +910,13 @@ public:
|
||||
iterator __insert_multi(_V&& __v);
|
||||
template <class _V>
|
||||
iterator __insert_multi(const_iterator __p, _V&& __v);
|
||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
||||
#else // _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::pointer
|
||||
// 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::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&
|
||||
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 < *_STD::next(__hint)
|
||||
// *__hint < __v < *next(__hint)
|
||||
if (__hint.__ptr_->__right_ == nullptr)
|
||||
{
|
||||
__parent = const_cast<__node_pointer&>(__hint.__ptr_);
|
||||
@@ -1728,11 +1728,18 @@ template <class _V>
|
||||
pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
|
||||
__tree<_Tp, _Compare, _Allocator>::__insert_unique(_V&& __v)
|
||||
{
|
||||
__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;
|
||||
__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);
|
||||
}
|
||||
|
||||
template <class _Tp, class _Compare, class _Allocator>
|
||||
@@ -1740,11 +1747,16 @@ template <class _V>
|
||||
typename __tree<_Tp, _Compare, _Allocator>::iterator
|
||||
__tree<_Tp, _Compare, _Allocator>::__insert_unique(const_iterator __p, _V&& __v)
|
||||
{
|
||||
__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;
|
||||
__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);
|
||||
}
|
||||
|
||||
template <class _Tp, class _Compare, class _Allocator>
|
||||
@@ -1784,8 +1796,6 @@ __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)
|
||||
@@ -1842,6 +1852,8 @@ __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,11 +214,7 @@ 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,17 +1559,8 @@ typename enable_if
|
||||
>::type
|
||||
copy_n(_InputIterator __first, _Size __n, _OutputIterator __result)
|
||||
{
|
||||
if (__n > 0)
|
||||
{
|
||||
for (; __n > 0; --__n, ++__first, ++__result)
|
||||
*__result = *__first;
|
||||
++__result;
|
||||
for (--__n; __n > 0; --__n)
|
||||
{
|
||||
++__first;
|
||||
*__result = *__first;
|
||||
++__result;
|
||||
}
|
||||
}
|
||||
return __result;
|
||||
}
|
||||
|
||||
|
@@ -530,10 +530,6 @@ 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,
|
||||
@@ -1506,8 +1502,6 @@ 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,43 +30,25 @@ Macros:
|
||||
|
||||
#if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
|
||||
|
||||
#ifdef ELAST
|
||||
|
||||
const int __elast1 = ELAST+1;
|
||||
const int __elast2 = ELAST+2;
|
||||
|
||||
#else
|
||||
|
||||
const int __elast1 = 104;
|
||||
const int __elast2 = 105;
|
||||
|
||||
#endif
|
||||
#undef ELAST
|
||||
|
||||
#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,340 +303,8 @@ 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;
|
||||
|
||||
@@ -961,6 +629,348 @@ 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;
|
||||
|
@@ -1787,7 +1787,7 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, const value_type& __v)
|
||||
--__base::__start_;
|
||||
++__base::size();
|
||||
if (__pos > 1)
|
||||
__b = __move_and_check(_STD::next(__b), __b + __pos, __b, __vt);
|
||||
__b = __move_and_check(next(__b), __b + __pos, __b, __vt);
|
||||
*__b = *__vt;
|
||||
}
|
||||
}
|
||||
@@ -1847,7 +1847,7 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, value_type&& __v)
|
||||
--__base::__start_;
|
||||
++__base::size();
|
||||
if (__pos > 1)
|
||||
__b = _STD::move(_STD::next(__b), __b + __pos, __b);
|
||||
__b = _STD::move(next(__b), __b + __pos, __b);
|
||||
*__b = _STD::move(__v);
|
||||
}
|
||||
}
|
||||
@@ -1905,7 +1905,7 @@ deque<_Tp, _Allocator>::emplace(const_iterator __p, _Args&&... __args)
|
||||
--__base::__start_;
|
||||
++__base::size();
|
||||
if (__pos > 1)
|
||||
__b = _STD::move(_STD::next(__b), __b + __pos, __b);
|
||||
__b = _STD::move(next(__b), __b + __pos, __b);
|
||||
*__b = value_type(_STD::forward<_Args>(__args)...);
|
||||
}
|
||||
}
|
||||
@@ -2621,7 +2621,7 @@ deque<_Tp, _Allocator>::erase(const_iterator __f)
|
||||
}
|
||||
else
|
||||
{ // erase from back
|
||||
iterator __i = _STD::move(_STD::next(__p), __base::end(), __p);
|
||||
iterator __i = _STD::move(next(__p), __base::end(), __p);
|
||||
__alloc_traits::destroy(__a, _STD::addressof(*__i));
|
||||
--__base::size();
|
||||
if (__back_spare() >= 2 * __base::__block_size)
|
||||
|
@@ -1510,12 +1510,21 @@ __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 __invoke_of<_Ti&, _Uj...>::type
|
||||
__mu_expand(_Ti& __ti, tuple<_Uj...>& __uj, __tuple_indices<_Indx...>)
|
||||
typename __mu_return1<true, _Ti, _Uj...>::type
|
||||
__mu_expand(_Ti& __ti, tuple<_Uj...>&& __uj, __tuple_indices<_Indx...>)
|
||||
{
|
||||
return __ti(_STD::forward<_Uj>(get<_Indx>(__uj))...);
|
||||
return __ti(_STD::forward<typename tuple_element<_Indx, _Uj>::type>(get<_Indx>(__uj))...);
|
||||
}
|
||||
|
||||
template <class _Ti, class ..._Uj>
|
||||
@@ -1523,7 +1532,7 @@ inline _LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
is_bind_expression<_Ti>::value,
|
||||
typename __invoke_of<_Ti&, _Uj...>::type
|
||||
typename __mu_return1<is_bind_expression<_Ti>::value, _Ti, _Uj...>::type
|
||||
>::type
|
||||
__mu(_Ti& __ti, tuple<_Uj...>& __uj)
|
||||
{
|
||||
@@ -1567,31 +1576,24 @@ __mu(_Ti& __ti, _Uj& __uj)
|
||||
return __ti;
|
||||
}
|
||||
|
||||
template <class _Ti, bool IsReferenceWrapper, bool IsBindEx, bool IsPh,
|
||||
class _TupleUj>
|
||||
template <class _Ti, bool IsBindEx, bool IsPh, class _TupleUj>
|
||||
struct ____mu_return;
|
||||
|
||||
template <class _Ti, class ..._Uj>
|
||||
struct ____mu_return<_Ti, false, true, false, tuple<_Uj...> >
|
||||
struct ____mu_return<_Ti, true, false, tuple<_Uj...> >
|
||||
{
|
||||
typedef typename __invoke_of<_Ti&, _Uj...>::type type;
|
||||
typedef typename result_of<_Ti(_Uj...)>::type type;
|
||||
};
|
||||
|
||||
template <class _Ti, class _TupleUj>
|
||||
struct ____mu_return<_Ti, false, false, true, _TupleUj>
|
||||
struct ____mu_return<_Ti, false, true, _TupleUj>
|
||||
{
|
||||
typedef typename tuple_element<is_placeholder<_Ti>::value - 1,
|
||||
_TupleUj>::type&& type;
|
||||
};
|
||||
|
||||
template <class _Ti, class _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>
|
||||
struct ____mu_return<_Ti, false, false, _TupleUj>
|
||||
{
|
||||
typedef _Ti& type;
|
||||
};
|
||||
@@ -1599,20 +1601,25 @@ struct ____mu_return<_Ti, false, 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_of
|
||||
typedef typename __invoke_return
|
||||
<
|
||||
_F&,
|
||||
typename __mu_return
|
||||
@@ -1626,7 +1633,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_of
|
||||
typedef typename __invoke_return
|
||||
<
|
||||
_F&,
|
||||
typename __mu_return
|
||||
@@ -1648,12 +1655,10 @@ __apply_functor(_F& __f, _BoundArgs& __bound_args, __tuple_indices<_Indx...>,
|
||||
|
||||
template<class _F, class ..._BoundArgs>
|
||||
class __bind
|
||||
: public __weak_result_type<typename decay<_F>::type>
|
||||
: public __weak_result_type<_F>
|
||||
{
|
||||
typedef typename decay<_F>::type _Fd;
|
||||
typedef tuple<typename decay<_BoundArgs>::type...> _Td;
|
||||
_Fd __f_;
|
||||
_Td __bound_args_;
|
||||
_F __f_;
|
||||
tuple<_BoundArgs...> __bound_args_;
|
||||
|
||||
typedef typename __make_tuple_indices<sizeof...(_BoundArgs)>::type __indices;
|
||||
public:
|
||||
@@ -1670,16 +1675,17 @@ public:
|
||||
|
||||
template <class ..._Args>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type
|
||||
typename __bind_return<_F, tuple<_BoundArgs...>, 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<_Fd, _Td, tuple<_Args&&...> >::type
|
||||
typename __bind_return<_F, tuple<_BoundArgs...>, tuple<_Args&&...> >::type
|
||||
operator()(_Args&& ...__args) const
|
||||
{
|
||||
return __apply_functor(__f_, __bound_args_, __indices(),
|
||||
@@ -1698,10 +1704,6 @@ 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)
|
||||
@@ -1730,19 +1732,19 @@ struct __is_bind_expression<__bind_r<_R, _F, _BoundArgs...> > : public true_type
|
||||
|
||||
template<class _F, class ..._BoundArgs>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
__bind<_F, _BoundArgs...>
|
||||
__bind<typename decay<_F>::type, typename decay<_BoundArgs>::type...>
|
||||
bind(_F&& __f, _BoundArgs&&... __bound_args)
|
||||
{
|
||||
typedef __bind<_F, _BoundArgs...> type;
|
||||
typedef __bind<typename decay<_F>::type, typename decay<_BoundArgs>::type...> 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, _F, _BoundArgs...>
|
||||
__bind_r<_R, typename decay<_F>::type, typename decay<_BoundArgs>::type...>
|
||||
bind(_F&& __f, _BoundArgs&&... __bound_args)
|
||||
{
|
||||
typedef __bind_r<_R, _F, _BoundArgs...> type;
|
||||
typedef __bind_r<_R, typename decay<_F>::type, typename decay<_BoundArgs>::type...> type;
|
||||
return type(_STD::forward<_F>(__f), _STD::forward<_BoundArgs>(__bound_args)...);
|
||||
}
|
||||
|
||||
|
208
include/future
208
include/future
@@ -858,115 +858,6 @@ __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;
|
||||
@@ -983,14 +874,6 @@ __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
|
||||
{
|
||||
@@ -1002,16 +885,11 @@ 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:
|
||||
@@ -1105,16 +983,11 @@ 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:
|
||||
@@ -1203,16 +1076,11 @@ 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:
|
||||
@@ -2166,72 +2034,36 @@ __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>
|
||||
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>
|
||||
future<typename result_of<_F(_Args...)>::type>
|
||||
async(launch __policy, _F&& __f, _Args&&... __args)
|
||||
{
|
||||
typedef __async_func<typename decay<_F>::type, typename decay<_Args>::type...> _BF;
|
||||
typedef typename _BF::_R _R;
|
||||
typedef typename result_of<_F(_Args...)>::type _R;
|
||||
future<_R> __r;
|
||||
if (__policy & launch::async)
|
||||
__r = _STD::__make_async_assoc_state<_R>(_BF(__decay_copy(_STD::forward<_F>(__f)),
|
||||
__decay_copy(_STD::forward<_Args>(__args))...));
|
||||
{
|
||||
packaged_task<_R()> __pk(bind(_STD::forward<_F>(__f),
|
||||
_STD::forward<_Args>(__args)...));
|
||||
__r = __pk.get_future();
|
||||
thread(_STD::move(__pk)).detach();
|
||||
}
|
||||
else if (__policy & launch::deferred)
|
||||
__r = _STD::__make_deferred_assoc_state<_R>(_BF(__decay_copy(_STD::forward<_F>(__f)),
|
||||
__decay_copy(_STD::forward<_Args>(__args))...));
|
||||
__r = _STD::__make_deferred_assoc_state<_R>(bind(_STD::forward<_F>(__f),
|
||||
_STD::forward<_Args>(__args)...));
|
||||
return __r;
|
||||
}
|
||||
|
||||
template <class _F, class... _Args>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
future<typename __invoke_of<typename decay<_F>::type, typename decay<_Args>::type...>::type>
|
||||
typename enable_if
|
||||
<
|
||||
!is_same<typename decay<_F>::type, launch>::value,
|
||||
future<typename result_of<_F(_Args...)>::type>
|
||||
>::type
|
||||
async(_F&& __f, _Args&&... __args)
|
||||
{
|
||||
return _STD::async(launch::any, _STD::forward<_F>(__f),
|
||||
_STD::forward<_Args>(__args)...);
|
||||
return async(launch::any, _STD::forward<_F>(__f),
|
||||
_STD::forward<_Args>(__args)...);
|
||||
}
|
||||
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
|
@@ -20,7 +20,6 @@ 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,13 +801,6 @@ 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;
|
||||
@@ -819,7 +812,6 @@ operator>>(basic_istream<_CharT, _Traits>& __is, _CharT& __c)
|
||||
}
|
||||
else
|
||||
__is.setstate(ios_base::eofbit | ios_base::failbit);
|
||||
#endif
|
||||
}
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
}
|
||||
|
@@ -522,12 +522,6 @@ __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)
|
||||
@@ -538,28 +532,22 @@ __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 >= 24)
|
||||
if (__f >= 26)
|
||||
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 -1;
|
||||
break;
|
||||
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;
|
||||
}
|
||||
return -1;
|
||||
break;
|
||||
default:
|
||||
if (__f >= 22)
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
if (__a_end-__a < __num_get_buf_sz - 1)
|
||||
*__a_end++ = __src[__f];
|
||||
++__dc;
|
||||
return 0;
|
||||
}
|
||||
@@ -745,27 +733,22 @@ __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 (__current_errno == ERANGE ||
|
||||
__ll < numeric_limits<_Tp>::min() ||
|
||||
numeric_limits<_Tp>::max() < __ll)
|
||||
else if (__ll > numeric_limits<_Tp>::max())
|
||||
{
|
||||
__err = ios_base::failbit;
|
||||
if (__ll > 0)
|
||||
return numeric_limits<_Tp>::max();
|
||||
else
|
||||
return numeric_limits<_Tp>::min();
|
||||
return numeric_limits<_Tp>::max();
|
||||
}
|
||||
else if (__ll < numeric_limits<_Tp>::min())
|
||||
{
|
||||
__err = ios_base::failbit;
|
||||
return numeric_limits<_Tp>::min();
|
||||
}
|
||||
return static_cast<_Tp>(__ll);
|
||||
}
|
||||
@@ -780,25 +763,14 @@ __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 (__current_errno == ERANGE ||
|
||||
numeric_limits<_Tp>::max() < __ll)
|
||||
else if (__ll > numeric_limits<_Tp>::max())
|
||||
{
|
||||
__err = ios_base::failbit;
|
||||
return numeric_limits<_Tp>::max();
|
||||
@@ -2346,12 +2318,6 @@ 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;
|
||||
@@ -3508,7 +3474,7 @@ extern template class money_put<wchar_t>;
|
||||
class _LIBCPP_VISIBLE messages_base
|
||||
{
|
||||
public:
|
||||
typedef ptrdiff_t catalog;
|
||||
typedef nl_catd catalog;
|
||||
|
||||
_LIBCPP_ALWAYS_INLINE messages_base() {}
|
||||
};
|
||||
@@ -3565,10 +3531,7 @@ template <class _CharT>
|
||||
typename messages<_CharT>::catalog
|
||||
messages<_CharT>::do_open(const basic_string<char>& __nm, const locale&) const
|
||||
{
|
||||
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;
|
||||
return catopen(__nm.c_str(), NL_CAT_LOCALE);
|
||||
}
|
||||
|
||||
template <class _CharT>
|
||||
@@ -3580,10 +3543,7 @@ 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());
|
||||
if (__c != -1)
|
||||
__c <<= 1;
|
||||
nl_catd __cat = reinterpret_cast<nl_catd>(__c);
|
||||
char* __n = catgets(__cat, __set, __msgid, __ndflt.c_str());
|
||||
char* __n = catgets(__c, __set, __msgid, __ndflt.c_str());
|
||||
string_type __w;
|
||||
__widen_from_utf8<sizeof(char_type)*__CHAR_BIT__>()(back_inserter(__w),
|
||||
__n, __n + strlen(__n));
|
||||
@@ -3594,10 +3554,7 @@ template <class _CharT>
|
||||
void
|
||||
messages<_CharT>::do_close(catalog __c) const
|
||||
{
|
||||
if (__c != -1)
|
||||
__c <<= 1;
|
||||
nl_catd __cat = reinterpret_cast<nl_catd>(__c);
|
||||
catclose(__cat);
|
||||
catclose(__c);
|
||||
}
|
||||
|
||||
extern template class messages<char>;
|
||||
|
16
include/map
16
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<const value_type>
|
||||
rebind<value_type>
|
||||
#else
|
||||
rebind<const value_type>::other
|
||||
rebind<value_type>::other
|
||||
#endif
|
||||
pointer;
|
||||
|
||||
|
@@ -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 = typename __pointer_traits_rebind<pointer, _Up>::type;
|
||||
template <class _Up> using rebind = __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 =
|
||||
typename __allocator_traits_rebind<allocator_type, _Tp>::type;
|
||||
__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(_STD::move(__r)).swap(*this);
|
||||
shared_ptr(__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 = 0);
|
||||
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat>::type = __nat());
|
||||
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 = 0);
|
||||
typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat>::type = __nat());
|
||||
|
||||
~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,9 +175,6 @@ template<class Callable, class ...Args>
|
||||
#include <__config>
|
||||
#include <__mutex_base>
|
||||
#include <functional>
|
||||
#ifndef _LIBCPP_HAS_NO_VARIADICS
|
||||
#include <tuple>
|
||||
#endif
|
||||
|
||||
#pragma GCC system_header
|
||||
|
||||
@@ -458,39 +455,6 @@ 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
|
||||
{
|
||||
@@ -511,8 +475,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
template <class _F>
|
||||
void
|
||||
__call_once_proxy(void* __vp)
|
||||
@@ -532,9 +494,10 @@ call_once(once_flag& __flag, _Callable&& __func, _Args&&... __args)
|
||||
{
|
||||
if (__builtin_expect(__flag.__state_ , ~0ul) != ~0ul)
|
||||
{
|
||||
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))...));
|
||||
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)...));
|
||||
__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, const bitset<_Size>& __x)
|
||||
operator<<(basic_ostream<_CharT, _Traits>& __os, bitset<_Size>& __x)
|
||||
{
|
||||
return __os << __x.template to_string<_CharT, _Traits>
|
||||
(use_facet<ctype<_CharT> >(__os.getloc()).widen('0'),
|
||||
|
@@ -1650,16 +1650,6 @@ 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,
|
||||
@@ -1858,7 +1848,7 @@ public:
|
||||
{seed(__s);}
|
||||
template<class _Sseq> explicit linear_congruential_engine(_Sseq& __q,
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<__is_seed_sequence<_Sseq, linear_congruential_engine>::value>::type* = 0)
|
||||
typename enable_if<!is_convertible<_Sseq, result_type>::value>::type* = 0)
|
||||
{seed(__q);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void seed(result_type __s = default_seed)
|
||||
@@ -1868,7 +1858,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
__is_seed_sequence<_Sseq, linear_congruential_engine>::value,
|
||||
!is_convertible<_Sseq, result_type>::value,
|
||||
void
|
||||
>::type
|
||||
seed(_Sseq& __q)
|
||||
@@ -2114,14 +2104,14 @@ public:
|
||||
{seed(__sd);}
|
||||
template<class _Sseq> explicit mersenne_twister_engine(_Sseq& __q,
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<__is_seed_sequence<_Sseq, mersenne_twister_engine>::value>::type* = 0)
|
||||
typename enable_if<!is_convertible<_Sseq, result_type>::value>::type* = 0)
|
||||
{seed(__q);}
|
||||
void seed(result_type __sd = default_seed);
|
||||
template<class _Sseq>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
__is_seed_sequence<_Sseq, mersenne_twister_engine>::value,
|
||||
!is_convertible<_Sseq, result_type>::value,
|
||||
void
|
||||
>::type
|
||||
seed(_Sseq& __q)
|
||||
@@ -2483,7 +2473,7 @@ public:
|
||||
{seed(__sd);}
|
||||
template<class _Sseq> explicit subtract_with_carry_engine(_Sseq& __q,
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if<__is_seed_sequence<_Sseq, subtract_with_carry_engine>::value>::type* = 0)
|
||||
typename enable_if<!is_convertible<_Sseq, result_type>::value>::type* = 0)
|
||||
{seed(__q);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void seed(result_type __sd = default_seed)
|
||||
@@ -2492,7 +2482,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
__is_seed_sequence<_Sseq, subtract_with_carry_engine>::value,
|
||||
!is_convertible<_Sseq, result_type>::value,
|
||||
void
|
||||
>::type
|
||||
seed(_Sseq& __q)
|
||||
@@ -2751,7 +2741,7 @@ public:
|
||||
template<class _Sseq>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit discard_block_engine(_Sseq& __q,
|
||||
typename enable_if<__is_seed_sequence<_Sseq, discard_block_engine>::value &&
|
||||
typename enable_if<!is_convertible<_Sseq, result_type>::value &&
|
||||
!is_convertible<_Sseq, _Engine>::value>::type* = 0)
|
||||
: __e_(__q), __n_(0) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -2762,7 +2752,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
__is_seed_sequence<_Sseq, discard_block_engine>::value,
|
||||
!is_convertible<_Sseq, result_type>::value,
|
||||
void
|
||||
>::type
|
||||
seed(_Sseq& __q) {__e_.seed(__q); __n_ = 0;}
|
||||
@@ -2950,7 +2940,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_seed_sequence<_Sseq, independent_bits_engine>::value &&
|
||||
typename enable_if<!is_convertible<_Sseq, result_type>::value &&
|
||||
!is_convertible<_Sseq, _Engine>::value>::type* = 0)
|
||||
: __e_(__q) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -2961,7 +2951,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
__is_seed_sequence<_Sseq, independent_bits_engine>::value,
|
||||
!is_convertible<_Sseq, result_type>::value,
|
||||
void
|
||||
>::type
|
||||
seed(_Sseq& __q) {__e_.seed(__q);}
|
||||
@@ -3173,7 +3163,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_seed_sequence<_Sseq, shuffle_order_engine>::value &&
|
||||
typename enable_if<!is_convertible<_Sseq, result_type>::value &&
|
||||
!is_convertible<_Sseq, _Engine>::value>::type* = 0)
|
||||
: __e_(__q) {__init();}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
@@ -3184,7 +3174,7 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
typename enable_if
|
||||
<
|
||||
__is_seed_sequence<_Sseq, shuffle_order_engine>::value,
|
||||
!is_convertible<_Sseq, result_type>::value,
|
||||
void
|
||||
>::type
|
||||
seed(_Sseq& __q) {__e_.seed(__q); __init();}
|
||||
@@ -4477,7 +4467,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)
|
||||
|
@@ -1264,7 +1264,6 @@ 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()
|
||||
@@ -1891,40 +1890,6 @@ __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>
|
||||
@@ -2429,6 +2394,7 @@ 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;
|
||||
@@ -2450,17 +2416,17 @@ public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_regex()
|
||||
: __flags_(), __marked_count_(0), __loop_count_(0), __open_count_(0),
|
||||
__end_(0)
|
||||
__end_(0), __left_anchor_(false)
|
||||
{}
|
||||
_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)
|
||||
__end_(0), __left_anchor_(false)
|
||||
{__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)
|
||||
__end_(0), __left_anchor_(false)
|
||||
{__parse(__p, __p + __len);}
|
||||
// basic_regex(const basic_regex&) = default;
|
||||
// basic_regex(basic_regex&&) = default;
|
||||
@@ -2469,20 +2435,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)
|
||||
__end_(0), __left_anchor_(false)
|
||||
{__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)
|
||||
__end_(0), __left_anchor_(false)
|
||||
{__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)
|
||||
__end_(0), __left_anchor_(false)
|
||||
{__parse(__il.begin(), __il.end());}
|
||||
|
||||
// ~basic_regex() = default;
|
||||
@@ -2540,6 +2506,7 @@ private:
|
||||
__loop_count_ = 0;
|
||||
__open_count_ = 0;
|
||||
__end_ = nullptr;
|
||||
__left_anchor_ = false;
|
||||
}
|
||||
public:
|
||||
|
||||
@@ -2727,7 +2694,7 @@ private:
|
||||
basic_string<_CharT>* __str = nullptr);
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void __push_l_anchor();
|
||||
void __push_l_anchor() {__left_anchor_ = true;}
|
||||
void __push_r_anchor();
|
||||
void __push_match_any();
|
||||
void __push_match_any_but_newline();
|
||||
@@ -2765,22 +2732,22 @@ private:
|
||||
bool
|
||||
__match_at_start(const _CharT* __first, const _CharT* __last,
|
||||
match_results<const _CharT*, _Allocator>& __m,
|
||||
regex_constants::match_flag_type __flags, bool) const;
|
||||
regex_constants::match_flag_type __flags) 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, bool) const;
|
||||
regex_constants::match_flag_type __flags) 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, bool) const;
|
||||
regex_constants::match_flag_type __flags) 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, bool) const;
|
||||
regex_constants::match_flag_type __flags) const;
|
||||
|
||||
template <class _B, class _A, class _C, class _T>
|
||||
friend
|
||||
@@ -2842,6 +2809,7 @@ 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>
|
||||
@@ -2882,9 +2850,7 @@ __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_ | regex_constants::match_continuous,
|
||||
true);
|
||||
__m, __s.__flags_);
|
||||
if (__matched != __invert_)
|
||||
{
|
||||
__s.__do_ = __state::__accept_but_not_consume;
|
||||
@@ -4121,6 +4087,7 @@ 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 != ')')
|
||||
@@ -4134,6 +4101,7 @@ 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 != ')')
|
||||
@@ -4608,14 +4576,6 @@ 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()
|
||||
@@ -5481,7 +5441,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, bool __at_first) const
|
||||
regex_constants::match_flag_type __flags) const
|
||||
{
|
||||
vector<__state> __states;
|
||||
ptrdiff_t __j = 0;
|
||||
@@ -5498,7 +5458,6 @@ 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
|
||||
{
|
||||
@@ -5547,7 +5506,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, bool __at_first) const
|
||||
regex_constants::match_flag_type __flags) const
|
||||
{
|
||||
deque<__state> __states;
|
||||
ptrdiff_t __highest_j = 0;
|
||||
@@ -5563,7 +5522,6 @@ 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
|
||||
{
|
||||
@@ -5625,7 +5583,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, bool __at_first) const
|
||||
regex_constants::match_flag_type __flags) const
|
||||
{
|
||||
vector<__state> __states;
|
||||
__state __best_state;
|
||||
@@ -5644,7 +5602,6 @@ 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
|
||||
@@ -5710,13 +5667,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, bool __at_first) const
|
||||
regex_constants::match_flag_type __flags) const
|
||||
{
|
||||
if ((__flags_ & 0x1F0) == ECMAScript)
|
||||
return __match_at_start_ecma(__first, __last, __m, __flags, __at_first);
|
||||
return __match_at_start_ecma(__first, __last, __m, __flags);
|
||||
if (mark_count() == 0)
|
||||
return __match_at_start_posix_nosubs(__first, __last, __m, __flags, __at_first);
|
||||
return __match_at_start_posix_subs(__first, __last, __m, __flags, __at_first);
|
||||
return __match_at_start_posix_nosubs(__first, __last, __m, __flags);
|
||||
return __match_at_start_posix_subs(__first, __last, __m, __flags);
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits>
|
||||
@@ -5727,9 +5684,11 @@ 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, true))
|
||||
if (__match_at_start(__first, __last, __m, __flags))
|
||||
{
|
||||
__m.__prefix_.second = __m[0].first;
|
||||
__m.__prefix_.matched = __m.__prefix_.first != __m.__prefix_.second;
|
||||
@@ -5743,7 +5702,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, false))
|
||||
if (__match_at_start(__first, __last, __m, __flags))
|
||||
{
|
||||
__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 _InnerA0, class... _InnerAllocs>
|
||||
template <class _OuterA1, class _OuterA2, class... _InnerAllocs>
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool
|
||||
operator==(const scoped_allocator_adaptor<_OuterA1, _InnerA0, _InnerAllocs...>& __a,
|
||||
const scoped_allocator_adaptor<_OuterA2, _InnerA0, _InnerAllocs...>& __b)
|
||||
operator==(const scoped_allocator_adaptor<_OuterA1, _InnerAllocs...>& __a,
|
||||
const scoped_allocator_adaptor<_OuterA2, _InnerAllocs...>& __b)
|
||||
{
|
||||
return __a.outer_allocator() == __b.outer_allocator() &&
|
||||
__a.inner_allocator() == __b.inner_allocator();
|
||||
|
@@ -95,9 +95,6 @@ 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
|
||||
@@ -318,44 +315,6 @@ 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)
|
||||
@@ -366,6 +325,25 @@ __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,13 +211,6 @@ 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,
|
||||
@@ -229,14 +222,6 @@ 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,
|
||||
@@ -276,6 +261,10 @@ 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:
|
||||
|
@@ -27,7 +27,6 @@ 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})
|
||||
@@ -54,5 +53,4 @@ install(DIRECTORY ../include/
|
||||
DESTINATION include/c++/v1
|
||||
FILES_MATCHING
|
||||
PATTERN "*"
|
||||
PATTERN ".svn" EXCLUDE
|
||||
)
|
||||
|
37
lib/buildit
37
lib/buildit
@@ -17,17 +17,9 @@ then
|
||||
CXX=clang++
|
||||
fi
|
||||
|
||||
if [ -z "$CC" ]
|
||||
then
|
||||
CC=clang
|
||||
fi
|
||||
|
||||
if [ -z $MACOSX_DEPLOYMENT_TARGET ]
|
||||
then
|
||||
if [ -z $IPHONEOS_DEPLOYMENT_TARGET ]
|
||||
then
|
||||
MACOSX_DEPLOYMENT_TARGET=10.6
|
||||
fi
|
||||
MACOSX_DEPLOYMENT_TARGET=10.6
|
||||
fi
|
||||
|
||||
if [ -z $RC_ProjectSourceVersion ]
|
||||
@@ -37,7 +29,7 @@ fi
|
||||
|
||||
case $TRIPLE in
|
||||
*-apple-*)
|
||||
if [ -z $RC_XBS ]
|
||||
if [ -z $RC_BUILDIT ]
|
||||
then
|
||||
RC_CFLAGS="-arch i386 -arch x86_64"
|
||||
fi
|
||||
@@ -53,27 +45,16 @@ case $TRIPLE in
|
||||
-Wl,-unexported_symbols_list,libc++unexp.exp \
|
||||
/usr/lib/libSystem.B.dylib"
|
||||
else
|
||||
EXTRA_FLAGS="-std=c++0x "
|
||||
RE_EXPORT_FILE="libc++abi.exp"
|
||||
if [ -n "$SDKROOT" ]
|
||||
then
|
||||
EXTRA_FLAGS+="-isysroot ${SDKROOT}"
|
||||
if [ "${RC_armv7}" = "YES" ]
|
||||
then
|
||||
RE_EXPORT_FILE="libc++sjlj-abi.exp"
|
||||
fi
|
||||
CXX=`xcrun -sdk "${SDKROOT}" -find clang++`
|
||||
CC=`xcrun -sdk "${SDKROOT}" -find clang`
|
||||
fi
|
||||
LDSHARED_FLAGS="-o libc++.1.dylib \
|
||||
EXTRA_FLAGS="-std=c++0x"
|
||||
LDSHARED_FLAGS="-o libc++.1.dylib \
|
||||
-dynamiclib -nodefaultlibs \
|
||||
-current_version ${RC_ProjectSourceVersion} -compatibility_version 1 \
|
||||
-install_name /usr/lib/libc++.1.dylib \
|
||||
${SDKROOT}/usr/lib/libc++abi.dylib \
|
||||
-lSystem \
|
||||
-Wl,-unexported_symbols_list,libc++unexp.exp \
|
||||
-Wl,-reexported_symbols_list,${RE_EXPORT_FILE} \
|
||||
-Wl,-force_symbols_not_weak_list,notweak.exp "
|
||||
-Wl,-reexported_symbols_list,libc++abi.exp \
|
||||
-Wl,-force_symbols_not_weak_list,notweak.exp"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
@@ -85,7 +66,7 @@ case $TRIPLE in
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z $RC_XBS ]
|
||||
if [ -z $RC_BUILDIT ]
|
||||
then
|
||||
rm -f libc++.1.$SOEXT*
|
||||
fi
|
||||
@@ -97,11 +78,11 @@ for FILE in ../src/*.cpp; do
|
||||
done
|
||||
|
||||
|
||||
$CC *.o $RC_CFLAGS $LDSHARED_FLAGS $EXTRA_FLAGS
|
||||
cc *.o $RC_CFLAGS $LDSHARED_FLAGS
|
||||
|
||||
#libtool -static -o libc++.a *.o
|
||||
|
||||
if [ -z $RC_XBS ]
|
||||
if [ -z $RC_BUILDIT ]
|
||||
then
|
||||
rm *.o
|
||||
fi
|
||||
|
@@ -1,159 +0,0 @@
|
||||
___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
|
@@ -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_;}
|
||||
};
|
||||
|
@@ -13,8 +13,6 @@
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
#include "../../hexfloat.h"
|
||||
|
||||
void test_acos()
|
||||
{
|
||||
static_assert((std::is_same<decltype(acos((double)0)), double>::value), "");
|
||||
@@ -196,9 +194,9 @@ void test_tanh()
|
||||
|
||||
void test_signbit()
|
||||
{
|
||||
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), "");
|
||||
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), "");
|
||||
assert(signbit(-1.0) == true);
|
||||
}
|
||||
|
||||
@@ -212,117 +210,117 @@ void test_fpclassify()
|
||||
|
||||
void test_isfinite()
|
||||
{
|
||||
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), "");
|
||||
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), "");
|
||||
assert(isfinite(-1.0) == true);
|
||||
}
|
||||
|
||||
void test_isinf()
|
||||
{
|
||||
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), "");
|
||||
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), "");
|
||||
assert(isinf(-1.0) == false);
|
||||
}
|
||||
|
||||
void test_isnan()
|
||||
{
|
||||
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), "");
|
||||
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), "");
|
||||
assert(isnan(-1.0) == false);
|
||||
}
|
||||
|
||||
void test_isnormal()
|
||||
{
|
||||
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), "");
|
||||
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), "");
|
||||
assert(isnormal(-1.0) == true);
|
||||
}
|
||||
|
||||
void test_isgreater()
|
||||
{
|
||||
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), "");
|
||||
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), "");
|
||||
assert(isgreater(-1.0, 0.F) == false);
|
||||
}
|
||||
|
||||
void test_isgreaterequal()
|
||||
{
|
||||
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), "");
|
||||
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), "");
|
||||
assert(isgreaterequal(-1.0, 0.F) == false);
|
||||
}
|
||||
|
||||
void test_isless()
|
||||
{
|
||||
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), "");
|
||||
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), "");
|
||||
assert(isless(-1.0, 0.F) == true);
|
||||
}
|
||||
|
||||
void test_islessequal()
|
||||
{
|
||||
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), "");
|
||||
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), "");
|
||||
assert(islessequal(-1.0, 0.F) == true);
|
||||
}
|
||||
|
||||
void test_islessgreater()
|
||||
{
|
||||
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), "");
|
||||
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), "");
|
||||
assert(islessgreater(-1.0, 0.F) == true);
|
||||
}
|
||||
|
||||
void test_isunordered()
|
||||
{
|
||||
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), "");
|
||||
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), "");
|
||||
assert(isunordered(-1.0, 0.F) == false);
|
||||
}
|
||||
|
||||
@@ -530,7 +528,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) == hexfloat<double>(0x1, 0, -1074));
|
||||
assert(nextafter(0,1) == 0x1p-1074);
|
||||
}
|
||||
|
||||
void test_nexttoward()
|
||||
@@ -538,7 +536,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) == hexfloat<double>(0x1, 0, -1074));
|
||||
assert(nexttoward(0, 1) == 0x1p-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("\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(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(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), "");
|
||||
|
@@ -1,38 +0,0 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// 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,22 +20,13 @@ 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 B();
|
||||
throw 1;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
|
@@ -41,19 +41,4 @@ 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,7 +20,6 @@
|
||||
#include <streambuf>
|
||||
#include <cmath>
|
||||
#include "iterators.h"
|
||||
#include "../../../../../hexfloat.h"
|
||||
|
||||
typedef std::num_get<char, input_iterator<const char*> > F;
|
||||
|
||||
@@ -106,7 +105,7 @@ int main()
|
||||
ios, err, v);
|
||||
assert(iter.base() == str+sizeof(str)-1);
|
||||
assert(err == ios.goodbit);
|
||||
assert(v == hexfloat<double>(0x125, 0, -1));
|
||||
assert(v == 0x125p-1);
|
||||
}
|
||||
{
|
||||
const char str[] = "inf";
|
||||
|
@@ -20,7 +20,6 @@
|
||||
#include <streambuf>
|
||||
#include <cmath>
|
||||
#include "iterators.h"
|
||||
#include "../../../../../hexfloat.h"
|
||||
|
||||
typedef std::num_get<char, input_iterator<const char*> > F;
|
||||
|
||||
@@ -94,7 +93,7 @@ int main()
|
||||
ios, err, v);
|
||||
assert(iter.base() == str+sizeof(str)-1);
|
||||
assert(err == ios.goodbit);
|
||||
assert(v == hexfloat<float>(0x125, 0, -1));
|
||||
assert(v == 0x125p-1);
|
||||
}
|
||||
{
|
||||
const char str[] = "inf";
|
||||
|
@@ -20,7 +20,6 @@
|
||||
#include <streambuf>
|
||||
#include <cmath>
|
||||
#include "iterators.h"
|
||||
#include "../../../../../hexfloat.h"
|
||||
|
||||
typedef std::num_get<char, input_iterator<const char*> > F;
|
||||
|
||||
@@ -94,7 +93,7 @@ int main()
|
||||
ios, err, v);
|
||||
assert(iter.base() == str+sizeof(str)-1);
|
||||
assert(err == ios.goodbit);
|
||||
assert(v == hexfloat<long double>(0x125, 0, -1));
|
||||
assert(v == 0x125p-1);
|
||||
}
|
||||
{
|
||||
const char str[] = "inf";
|
||||
|
@@ -1,53 +0,0 @@
|
||||
#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,8 +13,6 @@
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
#include "../../hexfloat.h"
|
||||
|
||||
void test_abs()
|
||||
{
|
||||
static_assert((std::is_same<decltype(std::abs((float)0)), float>::value), "");
|
||||
@@ -1091,7 +1089,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) == hexfloat<double>(0x1, 0, -1074));
|
||||
assert(std::nextafter(0,1) == 0x1p-1074);
|
||||
}
|
||||
|
||||
void test_nexttoward()
|
||||
@@ -1109,7 +1107,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) == hexfloat<double>(0x1, 0, -1074));
|
||||
assert(std::nexttoward(0, 1) == 0x1p-1074);
|
||||
}
|
||||
|
||||
void test_remainder()
|
||||
|
@@ -39,6 +39,8 @@ public:
|
||||
|
||||
explicit rand1(result_type sd = Min) : x_(sd)
|
||||
{
|
||||
if (x_ < Min)
|
||||
x_ = Min;
|
||||
if (x_ > Max)
|
||||
x_ = Max;
|
||||
}
|
||||
|
@@ -39,6 +39,8 @@ 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();
|
||||
|
@@ -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,22 +129,6 @@ 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
|
||||
@@ -190,9 +174,5 @@ int main()
|
||||
t1.join();
|
||||
assert(init2::called == 5);
|
||||
}
|
||||
{
|
||||
std::once_flag f;
|
||||
std::call_once(f, MoveOnly(), MoveOnly());
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
}
|
||||
|
@@ -71,22 +71,6 @@ 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()
|
||||
{
|
||||
{
|
||||
@@ -142,9 +126,5 @@ 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,5 +264,4 @@ int main()
|
||||
{
|
||||
test_void_1();
|
||||
test_int_1();
|
||||
test_void_2();
|
||||
}
|
||||
|
@@ -241,26 +241,8 @@ 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&&) {return *this;}
|
||||
move_only& operator=(move_only&&) {}
|
||||
#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 = std::move(pA);
|
||||
pB = 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 = std::move(pA);
|
||||
pB = 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 = std::move(pA);
|
||||
pB = 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 = std::move(pA);
|
||||
pB = pA;
|
||||
assert(B::count == 0);
|
||||
assert(A::count == 0);
|
||||
assert(pB.use_count() == 1);
|
||||
|
@@ -20,11 +20,7 @@ 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), "");
|
||||
|
@@ -7,19 +7,13 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <map>
|
||||
// type_traits
|
||||
|
||||
// class map
|
||||
// aligned_union
|
||||
|
||||
// map();
|
||||
|
||||
#include <map>
|
||||
|
||||
struct X
|
||||
{
|
||||
std::multimap<int, X> m;
|
||||
};
|
||||
#include <type_traits>
|
||||
|
||||
int main()
|
||||
{
|
||||
#error aligned_union is not implemented
|
||||
}
|
@@ -34,10 +34,6 @@ 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,8 +31,4 @@ 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,8 +18,6 @@ struct A
|
||||
{
|
||||
explicit A(int);
|
||||
A(int, double);
|
||||
private:
|
||||
A(char);
|
||||
};
|
||||
|
||||
int main()
|
||||
@@ -29,9 +27,4 @@ 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,11 +35,6 @@ struct A
|
||||
A();
|
||||
};
|
||||
|
||||
class B
|
||||
{
|
||||
B& operator=(const B&);
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
static_assert(( std::is_copy_assignable<int>::value), "");
|
||||
@@ -52,6 +47,4 @@ 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,11 +47,6 @@ struct A
|
||||
A(const A&);
|
||||
};
|
||||
|
||||
class B
|
||||
{
|
||||
B(const B&);
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
test_is_copy_constructible<char[3], false>();
|
||||
@@ -60,7 +55,6 @@ 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,11 +50,6 @@ struct A
|
||||
A();
|
||||
};
|
||||
|
||||
class B
|
||||
{
|
||||
B();
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
test_is_default_constructible<void, false>();
|
||||
@@ -63,7 +58,6 @@ 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,21 +13,10 @@
|
||||
|
||||
#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<A>::value, "");
|
||||
static_assert(!std::is_literal_type<B>::value, "");
|
||||
static_assert(!std::is_literal_type<int&>::value, "");
|
||||
static_assert(!std::is_literal_type<volatile int&>::value, "");
|
||||
}
|
||||
|
@@ -41,8 +41,7 @@ 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[3]>::value), "");
|
||||
static_assert((!std::is_move_assignable<void>::value), "");
|
||||
static_assert(( std::is_move_assignable<int&>::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,6 +47,4 @@ 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,7 +42,6 @@ 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,6 +18,8 @@ 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>
|
||||
@@ -33,6 +35,12 @@ class Empty
|
||||
{
|
||||
};
|
||||
|
||||
class NotEmpty
|
||||
{
|
||||
public:
|
||||
virtual ~NotEmpty();
|
||||
};
|
||||
|
||||
union Union {};
|
||||
|
||||
struct bit_zero
|
||||
@@ -57,5 +65,6 @@ 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,6 +35,12 @@ class Empty
|
||||
{
|
||||
};
|
||||
|
||||
class NotEmpty
|
||||
{
|
||||
public:
|
||||
virtual ~NotEmpty();
|
||||
};
|
||||
|
||||
union Union {};
|
||||
|
||||
struct bit_zero
|
||||
@@ -60,5 +66,6 @@ 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,6 +18,8 @@ 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>
|
||||
@@ -33,6 +35,12 @@ class Empty
|
||||
{
|
||||
};
|
||||
|
||||
class NotEmpty
|
||||
{
|
||||
public:
|
||||
virtual ~NotEmpty();
|
||||
};
|
||||
|
||||
union Union {};
|
||||
|
||||
struct bit_zero
|
||||
@@ -50,12 +58,13 @@ int main()
|
||||
test_has_not_nothrow_move_constructor<void>();
|
||||
test_has_not_nothrow_move_constructor<A>();
|
||||
|
||||
test_is_nothrow_move_constructible<int&>();
|
||||
test_has_not_nothrow_move_constructor<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,18 +13,9 @@
|
||||
|
||||
#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), "");
|
||||
}
|
||||
|
@@ -13,19 +13,9 @@
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
struct A {};
|
||||
|
||||
class B
|
||||
{
|
||||
public:
|
||||
B();
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
static_assert( std::is_trivial<int>::value, "");
|
||||
static_assert(!std::is_trivial<int&>::value, "");
|
||||
static_assert(!std::is_trivial<volatile int&>::value, "");
|
||||
static_assert( std::is_trivial<A>::value, "");
|
||||
static_assert(!std::is_trivial<B>::value, "");
|
||||
}
|
||||
|
@@ -25,12 +25,6 @@ struct B
|
||||
~B() {assert(i_ == 0);}
|
||||
};
|
||||
|
||||
class C
|
||||
{
|
||||
public:
|
||||
C();
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
static_assert( std::is_trivially_copyable<int>::value, "");
|
||||
@@ -40,5 +34,4 @@ int main()
|
||||
static_assert( std::is_trivially_copyable<const A>::value, "");
|
||||
static_assert(!std::is_trivially_copyable<const A&>::value, "");
|
||||
static_assert(!std::is_trivially_copyable<B>::value, "");
|
||||
static_assert( std::is_trivially_copyable<C>::value, "");
|
||||
}
|
||||
|
@@ -15,8 +15,6 @@
|
||||
#include <bitset>
|
||||
#include <cassert>
|
||||
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
|
||||
template <std::size_t N>
|
||||
void test_char_pointer_ctor()
|
||||
{
|
||||
|
@@ -12,8 +12,6 @@
|
||||
#include <bitset>
|
||||
#include <cassert>
|
||||
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
|
||||
template <std::size_t N>
|
||||
void test_default_ctor()
|
||||
{
|
||||
|
@@ -12,8 +12,6 @@
|
||||
#include <bitset>
|
||||
#include <cassert>
|
||||
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
|
||||
template <std::size_t N>
|
||||
void test_string_ctor()
|
||||
{
|
||||
|
@@ -12,8 +12,6 @@
|
||||
#include <bitset>
|
||||
#include <cassert>
|
||||
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
|
||||
template <std::size_t N>
|
||||
void test_val_ctor()
|
||||
{
|
||||
|
@@ -13,8 +13,6 @@
|
||||
#include <cstdlib>
|
||||
#include <cassert>
|
||||
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
|
||||
template <std::size_t N>
|
||||
std::bitset<N>
|
||||
make_bitset()
|
||||
|
@@ -13,8 +13,6 @@
|
||||
#include <cstdlib>
|
||||
#include <cassert>
|
||||
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
|
||||
template <std::size_t N>
|
||||
std::bitset<N>
|
||||
make_bitset()
|
||||
|
@@ -13,8 +13,6 @@
|
||||
#include <cstdlib>
|
||||
#include <cassert>
|
||||
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
|
||||
template <std::size_t N>
|
||||
std::bitset<N>
|
||||
make_bitset()
|
||||
|
@@ -13,8 +13,6 @@
|
||||
#include <cstdlib>
|
||||
#include <cassert>
|
||||
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
|
||||
template <std::size_t N>
|
||||
std::bitset<N>
|
||||
make_bitset()
|
||||
|
@@ -13,8 +13,6 @@
|
||||
#include <cstdlib>
|
||||
#include <cassert>
|
||||
|
||||
#pragma clang diagnostic ignored "-Wtautological-compare"
|
||||
|
||||
template <std::size_t N>
|
||||
std::bitset<N>
|
||||
make_bitset()
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user