visibility-decoration sweep completed.

llvm-svn: 114685
This commit is contained in:
Howard Hinnant 2010-09-23 18:58:28 +00:00
parent e38495dbc0
commit 789847ddbb
9 changed files with 867 additions and 520 deletions

View File

@ -122,13 +122,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// tuple_size
template <class ..._Tp>
class tuple_size<tuple<_Tp...>>
class _LIBCPP_VISIBLE tuple_size<tuple<_Tp...>>
: public integral_constant<size_t, sizeof...(_Tp)>
{
};
template <class ..._Tp>
class tuple_size<const tuple<_Tp...>>
class _LIBCPP_VISIBLE tuple_size<const tuple<_Tp...>>
: public integral_constant<size_t, sizeof...(_Tp)>
{
};
@ -136,14 +136,14 @@ class tuple_size<const tuple<_Tp...>>
// tuple_element
template <size_t _Ip, class ..._Tp>
class tuple_element<_Ip, tuple<_Tp...>>
class _LIBCPP_VISIBLE tuple_element<_Ip, tuple<_Tp...>>
{
public:
typedef typename tuple_element<_Ip, __tuple_types<_Tp...>>::type type;
};
template <size_t _Ip, class ..._Tp>
class tuple_element<_Ip, const tuple<_Tp...>>
class _LIBCPP_VISIBLE tuple_element<_Ip, const tuple<_Tp...>>
{
public:
typedef const typename tuple_element<_Ip, __tuple_types<_Tp...>>::type type;
@ -155,7 +155,7 @@ template <size_t _Ip, class _Hp, bool=is_empty<_Hp>::value>
class __tuple_leaf;
template <size_t _Ip, class _Hp, bool _Ep>
inline
inline _LIBCPP_INLINE_VISIBILITY
void swap(__tuple_leaf<_Ip, _Hp, _Ep>& __x, __tuple_leaf<_Ip, _Hp, _Ep>& __y)
{
swap(__x.get(), __y.get());
@ -341,7 +341,9 @@ public:
_LIBCPP_INLINE_VISIBILITY const _Hp& get() const {return static_cast<const _Hp&>(*this);}
};
template <class ..._Tp> void __swallow(_Tp&&...) {}
template <class ..._Tp>
_LIBCPP_INLINE_VISIBILITY
void __swallow(_Tp&&...) {}
// __tuple_impl
@ -353,6 +355,7 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
{
template <size_t ..._Uf, class ..._Tf,
size_t ..._Ul, class ..._Tl, class ..._Up>
_LIBCPP_INLINE_VISIBILITY
explicit
__tuple_impl(__tuple_indices<_Uf...>, __tuple_types<_Tf...>,
__tuple_indices<_Ul...>, __tuple_types<_Tl...>,
@ -363,6 +366,7 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
template <class _Alloc, size_t ..._Uf, class ..._Tf,
size_t ..._Ul, class ..._Tl, class ..._Up>
_LIBCPP_INLINE_VISIBILITY
explicit
__tuple_impl(allocator_arg_t, const _Alloc& __a,
__tuple_indices<_Uf...>, __tuple_types<_Tf...>,
@ -379,6 +383,7 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
__tuple_convertible<_Tuple, tuple<_Tp...>>::value
>::type
>
_LIBCPP_INLINE_VISIBILITY
__tuple_impl(_Tuple&& __t)
: __tuple_leaf<_Indx, _Tp>(_STD::forward<typename tuple_element<_Indx,
typename __make_tuple_types<_Tuple>::type>::type>(_STD::get<_Indx>(__t)))...
@ -390,6 +395,7 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
__tuple_convertible<_Tuple, tuple<_Tp...>>::value
>::type
>
_LIBCPP_INLINE_VISIBILITY
__tuple_impl(allocator_arg_t, const _Alloc& __a, _Tuple&& __t)
: __tuple_leaf<_Indx, _Tp>(__uses_alloc_ctor<_Tp, _Alloc, typename tuple_element<_Indx,
typename __make_tuple_types<_Tuple>::type>::type>(), __a,
@ -398,6 +404,7 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
{}
template <class _Tuple>
_LIBCPP_INLINE_VISIBILITY
typename enable_if
<
__tuple_assignable<_Tuple, tuple<_Tp...>>::value,
@ -410,6 +417,7 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
return *this;
}
_LIBCPP_INLINE_VISIBILITY
void swap(__tuple_impl& __t)
{
__swallow(__tuple_leaf<_Indx, _Tp>::swap(static_cast<__tuple_leaf<_Indx, _Tp>&>(__t))...);
@ -417,7 +425,7 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
};
template <class ..._Tp>
class tuple
class _LIBCPP_VISIBLE tuple
{
typedef __tuple_impl<typename __make_tuple_indices<sizeof...(_Tp)>::type, _Tp...> base;
@ -429,6 +437,7 @@ class tuple
const typename tuple_element<_Jp, tuple<_Up...>>::type& get(const tuple<_Up...>&);
public:
_LIBCPP_INLINE_VISIBILITY
explicit tuple(const _Tp& ... __t)
: base_(typename __make_tuple_indices<sizeof...(_Tp)>::type(),
typename __make_tuple_types<tuple, sizeof...(_Tp)>::type(),
@ -438,6 +447,7 @@ public:
) {}
template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
tuple(allocator_arg_t, const _Alloc& __a, const _Tp& ... __t)
: base_(allocator_arg_t(), __a,
typename __make_tuple_indices<sizeof...(_Tp)>::type(),
@ -461,6 +471,7 @@ public:
>::value
>::type
>
_LIBCPP_INLINE_VISIBILITY
explicit
tuple(_Up&&... __u)
: base_(typename __make_tuple_indices<sizeof...(_Up)>::type(),
@ -483,6 +494,7 @@ public:
>::value
>::type
>
_LIBCPP_INLINE_VISIBILITY
tuple(allocator_arg_t, const _Alloc& __a, _Up&&... __u)
: base_(allocator_arg_t(), __a,
typename __make_tuple_indices<sizeof...(_Up)>::type(),
@ -497,6 +509,7 @@ public:
__tuple_convertible<_Tuple, tuple>::value
>::type
>
_LIBCPP_INLINE_VISIBILITY
tuple(_Tuple&& __t)
: base_(_STD::forward<_Tuple>(__t)) {}
@ -506,6 +519,7 @@ public:
__tuple_convertible<_Tuple, tuple>::value
>::type
>
_LIBCPP_INLINE_VISIBILITY
tuple(allocator_arg_t, const _Alloc& __a, _Tuple&& __t)
: base_(allocator_arg_t(), __a, _STD::forward<_Tuple>(__t)) {}
@ -515,6 +529,7 @@ public:
__tuple_assignable<_Tuple, tuple>::value
>::type
>
_LIBCPP_INLINE_VISIBILITY
tuple&
operator=(_Tuple&& __t)
{
@ -522,22 +537,29 @@ public:
return *this;
}
_LIBCPP_INLINE_VISIBILITY
void swap(tuple& __t) {base_.swap(__t.base_);}
};
template <>
class tuple<>
class _LIBCPP_VISIBLE tuple<>
{
public:
_LIBCPP_INLINE_VISIBILITY
tuple() {}
template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
tuple(allocator_arg_t, const _Alloc&) {}
template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY
tuple(allocator_arg_t, const _Alloc&, const tuple&) {}
template <class _U>
_LIBCPP_INLINE_VISIBILITY
tuple(array<_U, 0>) {}
template <class _Alloc, class _U>
_LIBCPP_INLINE_VISIBILITY
tuple(allocator_arg_t, const _Alloc&, array<_U, 0>) {}
_LIBCPP_INLINE_VISIBILITY
void swap(tuple&) {}
};
@ -549,7 +571,7 @@ swap(tuple<_Tp...>& __t, tuple<_Tp...>& __u) {__t.swap(__u);}
// get
template <size_t _Ip, class ..._Tp>
inline
inline _LIBCPP_INLINE_VISIBILITY
typename tuple_element<_Ip, tuple<_Tp...>>::type&
get(tuple<_Tp...>& __t)
{
@ -558,7 +580,7 @@ get(tuple<_Tp...>& __t)
}
template <size_t _Ip, class ..._Tp>
inline
inline _LIBCPP_INLINE_VISIBILITY
const typename tuple_element<_Ip, tuple<_Tp...>>::type&
get(const tuple<_Tp...>& __t)
{
@ -569,7 +591,7 @@ get(const tuple<_Tp...>& __t)
// tie
template <class ..._Tp>
inline
inline _LIBCPP_INLINE_VISIBILITY
tuple<_Tp&...>
tie(_Tp&... __t)
{
@ -579,10 +601,13 @@ tie(_Tp&... __t)
template <class _Up>
struct __ignore_t
{
_LIBCPP_INLINE_VISIBILITY
__ignore_t() {}
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
__ignore_t(_Tp&&) {}
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
const __ignore_t& operator=(_Tp&&) const {return *this;}
};
@ -609,7 +634,7 @@ struct __make_tuple_return
};
template <class... _Tp>
inline
inline _LIBCPP_INLINE_VISIBILITY
tuple<typename __make_tuple_return<_Tp>::type...>
make_tuple(_Tp&&... __t)
{
@ -617,7 +642,7 @@ make_tuple(_Tp&&... __t)
}
template <class... _Tp>
inline
inline _LIBCPP_INLINE_VISIBILITY
tuple<_Tp&&...>
forward_as_tuple(_Tp&&... __t)
{
@ -628,6 +653,7 @@ template <size_t _I>
struct __tuple_equal
{
template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY
bool operator()(const _Tp& __x, const _Up& __y)
{
return __tuple_equal<_I - 1>()(__x, __y) && get<_I-1>(__x) == get<_I-1>(__y);
@ -638,6 +664,7 @@ template <>
struct __tuple_equal<0>
{
template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY
bool operator()(const _Tp&, const _Up&)
{
return true;
@ -645,7 +672,7 @@ struct __tuple_equal<0>
};
template <class ..._Tp, class ..._Up>
inline
inline _LIBCPP_INLINE_VISIBILITY
bool
operator==(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
{
@ -653,7 +680,7 @@ operator==(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
}
template <class ..._Tp, class ..._Up>
inline
inline _LIBCPP_INLINE_VISIBILITY
bool
operator!=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
{
@ -664,6 +691,7 @@ template <size_t _I>
struct __tuple_less
{
template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY
bool operator()(const _Tp& __x, const _Up& __y)
{
return __tuple_less<_I-1>()(__x, __y) ||
@ -675,6 +703,7 @@ template <>
struct __tuple_less<0>
{
template <class _Tp, class _Up>
_LIBCPP_INLINE_VISIBILITY
bool operator()(const _Tp&, const _Up&)
{
return false;
@ -682,7 +711,7 @@ struct __tuple_less<0>
};
template <class ..._Tp, class ..._Up>
inline
inline _LIBCPP_INLINE_VISIBILITY
bool
operator<(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
{
@ -690,7 +719,7 @@ operator<(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
}
template <class ..._Tp, class ..._Up>
inline
inline _LIBCPP_INLINE_VISIBILITY
bool
operator>(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
{
@ -698,7 +727,7 @@ operator>(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
}
template <class ..._Tp, class ..._Up>
inline
inline _LIBCPP_INLINE_VISIBILITY
bool
operator>=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
{
@ -706,7 +735,7 @@ operator>=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
}
template <class ..._Tp, class ..._Up>
inline
inline _LIBCPP_INLINE_VISIBILITY
bool
operator<=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
{
@ -716,7 +745,7 @@ operator<=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
// tuple_cat
template <class... _Tp, size_t ..._I1, class... _Up, size_t ..._I2>
inline
inline _LIBCPP_INLINE_VISIBILITY
tuple<_Tp..., _Up...>
__tuple_cat(const tuple<_Tp...>& __x, __tuple_indices<_I1...>, const tuple<_Up...>& __y, __tuple_indices<_I2...>)
{
@ -724,7 +753,7 @@ __tuple_cat(const tuple<_Tp...>& __x, __tuple_indices<_I1...>, const tuple<_Up..
}
template <class... _Tp, class... _Up>
inline
inline _LIBCPP_INLINE_VISIBILITY
tuple<_Tp..., _Up...>
tuple_cat(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
{
@ -733,7 +762,7 @@ tuple_cat(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
}
template <class... _Tp, size_t ..._I1, class... _Up, size_t ..._I2>
inline
inline _LIBCPP_INLINE_VISIBILITY
tuple<_Tp..., _Up...>
__tuple_cat(tuple<_Tp...>&& __x, __tuple_indices<_I1...>, const tuple<_Up...>& __y, __tuple_indices<_I2...>)
{
@ -741,7 +770,7 @@ __tuple_cat(tuple<_Tp...>&& __x, __tuple_indices<_I1...>, const tuple<_Up...>& _
}
template <class... _Tp, class... _Up>
inline
inline _LIBCPP_INLINE_VISIBILITY
tuple<_Tp..., _Up...>
tuple_cat(tuple<_Tp...>&& __x, const tuple<_Up...>& __y)
{
@ -750,7 +779,7 @@ tuple_cat(tuple<_Tp...>&& __x, const tuple<_Up...>& __y)
}
template <class... _Tp, size_t ..._I1, class... _Up, size_t ..._I2>
inline
inline _LIBCPP_INLINE_VISIBILITY
tuple<_Tp..., _Up...>
__tuple_cat(const tuple<_Tp...>& __x, __tuple_indices<_I1...>, tuple<_Up...>&& __y, __tuple_indices<_I2...>)
{
@ -758,7 +787,7 @@ __tuple_cat(const tuple<_Tp...>& __x, __tuple_indices<_I1...>, tuple<_Up...>&& _
}
template <class... _Tp, class... _Up>
inline
inline _LIBCPP_INLINE_VISIBILITY
tuple<_Tp..., _Up...>
tuple_cat(const tuple<_Tp...>& __x, tuple<_Up...>&& __y)
{
@ -767,7 +796,7 @@ tuple_cat(const tuple<_Tp...>& __x, tuple<_Up...>&& __y)
}
template <class... _Tp, size_t ..._I1, class... _Up, size_t ..._I2>
inline
inline _LIBCPP_INLINE_VISIBILITY
tuple<_Tp..., _Up...>
__tuple_cat(tuple<_Tp...>&& __x, __tuple_indices<_I1...>, tuple<_Up...>&& __y, __tuple_indices<_I2...>)
{
@ -775,7 +804,7 @@ __tuple_cat(tuple<_Tp...>&& __x, __tuple_indices<_I1...>, tuple<_Up...>&& __y, _
}
template <class... _Tp, class... _Up>
inline
inline _LIBCPP_INLINE_VISIBILITY
tuple<_Tp..., _Up...>
tuple_cat(tuple<_Tp...>&& __x, tuple<_Up...>&& __y)
{
@ -784,7 +813,7 @@ tuple_cat(tuple<_Tp...>&& __x, tuple<_Up...>&& __y)
}
template <class ..._Tp, class _Alloc>
struct uses_allocator<tuple<_Tp...>, _Alloc>
struct _LIBCPP_VISIBLE uses_allocator<tuple<_Tp...>, _Alloc>
: true_type {};
template <class _T1, class _T2>

View File

@ -144,23 +144,26 @@ namespace std
_LIBCPP_BEGIN_NAMESPACE_STD
template <bool _B, class _If, class _Then> struct conditional {typedef _If type;};
template <class _If, class _Then> struct conditional<false, _If, _Then> {typedef _Then type;};
template <bool _B, class _If, class _Then>
struct _LIBCPP_VISIBLE conditional {typedef _If type;};
template <class _If, class _Then>
struct _LIBCPP_VISIBLE conditional<false, _If, _Then> {typedef _Then type;};
template <bool, class _Tp = void> struct enable_if {};
template <class _Tp> struct enable_if<true, _Tp> {typedef _Tp type;};
template <bool, class _Tp = void> struct _LIBCPP_VISIBLE enable_if {};
template <class _Tp> struct _LIBCPP_VISIBLE enable_if<true, _Tp> {typedef _Tp type;};
struct __two {char _[2];};
// helper class:
template <class _Tp, _Tp __v>
struct integral_constant
struct _LIBCPP_VISIBLE integral_constant
{
static constexpr _Tp value = __v;
typedef _Tp value_type;
typedef integral_constant type;
#ifndef _LIBCPP_HAS_NO_CONSTEXPR
_LIBCPP_INLINE_VISIBILITY
constexpr operator value_type() {return value;}
#endif
};
@ -173,27 +176,27 @@ typedef integral_constant<bool, false> false_type;
// is_const
template <class _Tp> struct is_const : public false_type {};
template <class _Tp> struct is_const<_Tp const> : public true_type {};
template <class _Tp> struct _LIBCPP_VISIBLE is_const : public false_type {};
template <class _Tp> struct _LIBCPP_VISIBLE is_const<_Tp const> : public true_type {};
// is_volatile
template <class _Tp> struct is_volatile : public false_type {};
template <class _Tp> struct is_volatile<_Tp volatile> : public true_type {};
template <class _Tp> struct _LIBCPP_VISIBLE is_volatile : public false_type {};
template <class _Tp> struct _LIBCPP_VISIBLE is_volatile<_Tp volatile> : public true_type {};
// remove_const
template <class _Tp> struct remove_const {typedef _Tp type;};
template <class _Tp> struct remove_const<const _Tp> {typedef _Tp type;};
template <class _Tp> struct _LIBCPP_VISIBLE remove_const {typedef _Tp type;};
template <class _Tp> struct _LIBCPP_VISIBLE remove_const<const _Tp> {typedef _Tp type;};
// remove_volatile
template <class _Tp> struct remove_volatile {typedef _Tp type;};
template <class _Tp> struct remove_volatile<volatile _Tp> {typedef _Tp type;};
template <class _Tp> struct _LIBCPP_VISIBLE remove_volatile {typedef _Tp type;};
template <class _Tp> struct _LIBCPP_VISIBLE remove_volatile<volatile _Tp> {typedef _Tp type;};
// remove_cv
template <class _Tp> struct remove_cv
template <class _Tp> struct _LIBCPP_VISIBLE remove_cv
{typedef typename remove_volatile<typename remove_const<_Tp>::type>::type type;};
// is_void
@ -201,7 +204,8 @@ template <class _Tp> struct remove_cv
template <class _Tp> struct __is_void : public false_type {};
template <> struct __is_void<void> : public true_type {};
template <class _Tp> struct is_void : public __is_void<typename remove_cv<_Tp>::type> {};
template <class _Tp> struct _LIBCPP_VISIBLE is_void
: public __is_void<typename remove_cv<_Tp>::type> {};
// is_integral
@ -224,7 +228,8 @@ template <> struct __is_integral<unsigned long> : public true_type
template <> struct __is_integral<long long> : public true_type {};
template <> struct __is_integral<unsigned long long> : public true_type {};
template <class _Tp> struct is_integral : public __is_integral<typename remove_cv<_Tp>::type> {};
template <class _Tp> struct _LIBCPP_VISIBLE is_integral
: public __is_integral<typename remove_cv<_Tp>::type> {};
// is_floating_point
@ -233,35 +238,40 @@ template <> struct __is_floating_point<float> : public true_type
template <> struct __is_floating_point<double> : public true_type {};
template <> struct __is_floating_point<long double> : public true_type {};
template <class _Tp> struct is_floating_point : public __is_floating_point<typename remove_cv<_Tp>::type> {};
template <class _Tp> struct _LIBCPP_VISIBLE is_floating_point
: public __is_floating_point<typename remove_cv<_Tp>::type> {};
// is_array
template <class _Tp> struct is_array : public false_type {};
template <class _Tp> struct is_array<_Tp[]> : public true_type {};
template <class _Tp, size_t _Np> struct is_array<_Tp[_Np]> : public true_type {};
template <class _Tp> struct _LIBCPP_VISIBLE is_array
: public false_type {};
template <class _Tp> struct _LIBCPP_VISIBLE is_array<_Tp[]>
: public true_type {};
template <class _Tp, size_t _Np> struct _LIBCPP_VISIBLE is_array<_Tp[_Np]>
: public true_type {};
// is_pointer
template <class _Tp> struct __is_pointer : public false_type {};
template <class _Tp> struct __is_pointer<_Tp*> : public true_type {};
template <class _Tp> struct is_pointer : public __is_pointer<typename remove_cv<_Tp>::type> {};
template <class _Tp> struct _LIBCPP_VISIBLE is_pointer
: public __is_pointer<typename remove_cv<_Tp>::type> {};
// is_reference
template <class _Tp> struct is_lvalue_reference : public false_type {};
template <class _Tp> struct is_lvalue_reference<_Tp&> : public true_type {};
template <class _Tp> struct _LIBCPP_VISIBLE is_lvalue_reference : public false_type {};
template <class _Tp> struct _LIBCPP_VISIBLE is_lvalue_reference<_Tp&> : public true_type {};
template <class _Tp> struct is_rvalue_reference : public false_type {};
template <class _Tp> struct _LIBCPP_VISIBLE is_rvalue_reference : public false_type {};
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp> struct is_rvalue_reference<_Tp&&> : public true_type {};
template <class _Tp> struct _LIBCPP_VISIBLE is_rvalue_reference<_Tp&&> : public true_type {};
#endif
template <class _Tp> struct is_reference : public false_type {};
template <class _Tp> struct is_reference<_Tp&> : public true_type {};
template <class _Tp> struct _LIBCPP_VISIBLE is_reference : public false_type {};
template <class _Tp> struct _LIBCPP_VISIBLE is_reference<_Tp&> : public true_type {};
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp> struct is_reference<_Tp&&> : public true_type {};
template <class _Tp> struct _LIBCPP_VISIBLE is_reference<_Tp&&> : public true_type {};
#endif
#if defined(__clang__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
@ -272,13 +282,14 @@ template <class _Tp> struct is_reference<_Tp&&> : public true_type {};
#ifdef _LIBCPP_HAS_TYPE_TRAITS
template <class _Tp> struct is_union
template <class _Tp> struct _LIBCPP_VISIBLE is_union
: public integral_constant<bool, __is_union(_Tp)> {};
#else // _LIBCPP_HAS_TYPE_TRAITS
template <class _Tp> struct __libcpp_union : public false_type {};
template <class _Tp> struct is_union : public __libcpp_union<typename remove_cv<_Tp>::type> {};
template <class _Tp> struct _LIBCPP_VISIBLE is_union
: public __libcpp_union<typename remove_cv<_Tp>::type> {};
#endif // _LIBCPP_HAS_TYPE_TRAITS
@ -286,7 +297,7 @@ template <class _Tp> struct is_union : public __libcpp_union<typename remove_cv<
#ifdef _LIBCPP_HAS_TYPE_TRAITS
template <class _Tp> struct is_class
template <class _Tp> struct _LIBCPP_VISIBLE is_class
: public integral_constant<bool, __is_class(_Tp)> {};
#else // _LIBCPP_HAS_TYPE_TRAITS
@ -297,7 +308,7 @@ template <class _Tp> char __test(int _Tp::*);
template <class _Tp> __two __test(...);
}
template <class _Tp> struct is_class
template <class _Tp> struct _LIBCPP_VISIBLE is_class
: public integral_constant<bool, sizeof(__is_class_imp::__test<_Tp>(0)) == 1 && !is_union<_Tp>::value> {};
#endif // _LIBCPP_HAS_TYPE_TRAITS
@ -320,14 +331,15 @@ struct __is_function
{};
template <class _Tp> struct __is_function<_Tp, true> : public false_type {};
template <class _Tp> struct is_function : public __is_function<_Tp> {};
template <class _Tp> struct _LIBCPP_VISIBLE is_function
: public __is_function<_Tp> {};
// is_member_function_pointer
template <class _Tp> struct __is_member_function_pointer : public false_type {};
template <class _Tp, class _Up> struct __is_member_function_pointer<_Tp _Up::*> : public is_function<_Tp> {};
template <class _Tp> struct is_member_function_pointer
template <class _Tp> struct _LIBCPP_VISIBLE is_member_function_pointer
: public __is_member_function_pointer<typename remove_cv<_Tp>::type> {};
// is_member_pointer
@ -335,12 +347,12 @@ template <class _Tp> struct is_member_function_pointer
template <class _Tp> struct __is_member_pointer : public false_type {};
template <class _Tp, class _Up> struct __is_member_pointer<_Tp _Up::*> : public true_type {};
template <class _Tp> struct is_member_pointer
template <class _Tp> struct _LIBCPP_VISIBLE is_member_pointer
: public __is_member_pointer<typename remove_cv<_Tp>::type> {};
// is_member_object_pointer
template <class _Tp> struct is_member_object_pointer
template <class _Tp> struct _LIBCPP_VISIBLE is_member_object_pointer
: public integral_constant<bool, is_member_pointer<_Tp>::value &&
!is_member_function_pointer<_Tp>::value> {};
@ -348,12 +360,12 @@ template <class _Tp> struct is_member_object_pointer
#ifdef _LIBCPP_HAS_TYPE_TRAITS
template <class _Tp> struct is_enum
template <class _Tp> struct _LIBCPP_VISIBLE is_enum
: public integral_constant<bool, __is_enum(_Tp)> {};
#else // _LIBCPP_HAS_TYPE_TRAITS
template <class _Tp> struct is_enum
template <class _Tp> struct _LIBCPP_VISIBLE is_enum
: public integral_constant<bool, !is_void<_Tp>::value &&
!is_integral<_Tp>::value &&
!is_floating_point<_Tp>::value &&
@ -369,19 +381,19 @@ template <class _Tp> struct is_enum
// is_arithmetic
template <class _Tp> struct is_arithmetic
template <class _Tp> struct _LIBCPP_VISIBLE is_arithmetic
: public integral_constant<bool, is_integral<_Tp>::value ||
is_floating_point<_Tp>::value> {};
// is_fundamental
template <class _Tp> struct is_fundamental
template <class _Tp> struct _LIBCPP_VISIBLE is_fundamental
: public integral_constant<bool, is_void<_Tp>::value ||
is_arithmetic<_Tp>::value> {};
// is_scalar
template <class _Tp> struct is_scalar
template <class _Tp> struct _LIBCPP_VISIBLE is_scalar
: public integral_constant<bool, is_arithmetic<_Tp>::value ||
is_member_pointer<_Tp>::value ||
is_pointer<_Tp>::value ||
@ -389,7 +401,7 @@ template <class _Tp> struct is_scalar
// is_object
template <class _Tp> struct is_object
template <class _Tp> struct _LIBCPP_VISIBLE is_object
: public integral_constant<bool, is_scalar<_Tp>::value ||
is_array<_Tp>::value ||
is_union<_Tp>::value ||
@ -397,7 +409,8 @@ template <class _Tp> struct is_object
// is_compound
template <class _Tp> struct is_compound : public integral_constant<bool, !is_fundamental<_Tp>::value> {};
template <class _Tp> struct _LIBCPP_VISIBLE is_compound
: public integral_constant<bool, !is_fundamental<_Tp>::value> {};
// add_const
@ -409,7 +422,8 @@ struct __add_const {typedef _Tp type;};
template <class _Tp>
struct __add_const<_Tp, false> {typedef const _Tp type;};
template <class _Tp> struct add_const {typedef typename __add_const<_Tp>::type type;};
template <class _Tp> struct _LIBCPP_VISIBLE add_const
{typedef typename __add_const<_Tp>::type type;};
// add_volatile
@ -421,36 +435,38 @@ struct __add_volatile {typedef _Tp type;};
template <class _Tp>
struct __add_volatile<_Tp, false> {typedef volatile _Tp type;};
template <class _Tp> struct add_volatile {typedef typename __add_volatile<_Tp>::type type;};
template <class _Tp> struct _LIBCPP_VISIBLE add_volatile
{typedef typename __add_volatile<_Tp>::type type;};
// add_cv
template <class _Tp> struct add_cv {typedef typename add_const<typename add_volatile<_Tp>::type>::type type;};
template <class _Tp> struct _LIBCPP_VISIBLE add_cv
{typedef typename add_const<typename add_volatile<_Tp>::type>::type type;};
// remove_reference
template <class _Tp> struct remove_reference {typedef _Tp type;};
template <class _Tp> struct remove_reference<_Tp&> {typedef _Tp type;};
template <class _Tp> struct _LIBCPP_VISIBLE remove_reference {typedef _Tp type;};
template <class _Tp> struct _LIBCPP_VISIBLE remove_reference<_Tp&> {typedef _Tp type;};
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp> struct remove_reference<_Tp&&> {typedef _Tp type;};
template <class _Tp> struct _LIBCPP_VISIBLE remove_reference<_Tp&&> {typedef _Tp type;};
#endif
// add_lvalue_reference
template <class _Tp> struct add_lvalue_reference {typedef _Tp& type;};
template <class _Tp> struct add_lvalue_reference<_Tp&> {typedef _Tp& type;}; // for older compiler
template <> struct add_lvalue_reference<void> {typedef void type;};
template <> struct add_lvalue_reference<const void> {typedef const void type;};
template <> struct add_lvalue_reference<volatile void> {typedef volatile void type;};
template <> struct add_lvalue_reference<const volatile void> {typedef const volatile void type;};
template <class _Tp> struct _LIBCPP_VISIBLE add_lvalue_reference {typedef _Tp& type;};
template <class _Tp> struct _LIBCPP_VISIBLE add_lvalue_reference<_Tp&> {typedef _Tp& type;}; // for older compiler
template <> struct _LIBCPP_VISIBLE add_lvalue_reference<void> {typedef void type;};
template <> struct _LIBCPP_VISIBLE add_lvalue_reference<const void> {typedef const void type;};
template <> struct _LIBCPP_VISIBLE add_lvalue_reference<volatile void> {typedef volatile void type;};
template <> struct _LIBCPP_VISIBLE add_lvalue_reference<const volatile void> {typedef const volatile void type;};
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp> struct add_rvalue_reference {typedef _Tp&& type;};
template <> struct add_rvalue_reference<void> {typedef void type;};
template <> struct add_rvalue_reference<const void> {typedef const void type;};
template <> struct add_rvalue_reference<volatile void> {typedef volatile void type;};
template <> struct add_rvalue_reference<const volatile void> {typedef const volatile void type;};
template <class _Tp> struct _LIBCPP_VISIBLE add_rvalue_reference {typedef _Tp&& type;};
template <> struct _LIBCPP_VISIBLE add_rvalue_reference<void> {typedef void type;};
template <> struct _LIBCPP_VISIBLE add_rvalue_reference<const void> {typedef const void type;};
template <> struct _LIBCPP_VISIBLE add_rvalue_reference<volatile void> {typedef volatile void type;};
template <> struct _LIBCPP_VISIBLE add_rvalue_reference<const volatile void> {typedef const volatile void type;};
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
@ -475,15 +491,16 @@ struct __any
// remove_pointer
template <class _Tp> struct remove_pointer {typedef _Tp type;};
template <class _Tp> struct remove_pointer<_Tp*> {typedef _Tp type;};
template <class _Tp> struct remove_pointer<_Tp* const> {typedef _Tp type;};
template <class _Tp> struct remove_pointer<_Tp* volatile> {typedef _Tp type;};
template <class _Tp> struct remove_pointer<_Tp* const volatile> {typedef _Tp type;};
template <class _Tp> struct _LIBCPP_VISIBLE remove_pointer {typedef _Tp type;};
template <class _Tp> struct _LIBCPP_VISIBLE remove_pointer<_Tp*> {typedef _Tp type;};
template <class _Tp> struct _LIBCPP_VISIBLE remove_pointer<_Tp* const> {typedef _Tp type;};
template <class _Tp> struct _LIBCPP_VISIBLE remove_pointer<_Tp* volatile> {typedef _Tp type;};
template <class _Tp> struct _LIBCPP_VISIBLE remove_pointer<_Tp* const volatile> {typedef _Tp type;};
// add_pointer
template <class _Tp> struct add_pointer {typedef typename remove_reference<_Tp>::type* type;};
template <class _Tp> struct _LIBCPP_VISIBLE add_pointer
{typedef typename remove_reference<_Tp>::type* type;};
// is_signed
@ -498,7 +515,7 @@ struct __is_signed : public ___is_signed<_Tp> {};
template <class _Tp> struct __is_signed<_Tp, false> : public false_type {};
template <class _Tp> struct is_signed : public __is_signed<_Tp> {};
template <class _Tp> struct _LIBCPP_VISIBLE is_signed : public __is_signed<_Tp> {};
// is_unsigned
@ -513,38 +530,52 @@ struct __is_unsigned : public ___is_unsigned<_Tp> {};
template <class _Tp> struct __is_unsigned<_Tp, false> : public false_type {};
template <class _Tp> struct is_unsigned : public __is_unsigned<_Tp> {};
template <class _Tp> struct _LIBCPP_VISIBLE is_unsigned : public __is_unsigned<_Tp> {};
// rank
template <class _Tp> struct rank : public integral_constant<size_t, 0> {};
template <class _Tp> struct rank<_Tp[]> : public integral_constant<size_t, rank<_Tp>::value + 1> {};
template <class _Tp, size_t _Np> struct rank<_Tp[_Np]> : public integral_constant<size_t, rank<_Tp>::value + 1> {};
template <class _Tp> struct _LIBCPP_VISIBLE rank
: public integral_constant<size_t, 0> {};
template <class _Tp> struct _LIBCPP_VISIBLE rank<_Tp[]>
: public integral_constant<size_t, rank<_Tp>::value + 1> {};
template <class _Tp, size_t _Np> struct _LIBCPP_VISIBLE rank<_Tp[_Np]>
: public integral_constant<size_t, rank<_Tp>::value + 1> {};
// extent
template <class _Tp, unsigned _Ip = 0> struct extent : public integral_constant<size_t, 0> {};
template <class _Tp> struct extent<_Tp[], 0> : public integral_constant<size_t, 0> {};
template <class _Tp, unsigned _Ip> struct extent<_Tp[], _Ip> : public integral_constant<size_t, extent<_Tp, _Ip-1>::value> {};
template <class _Tp, size_t _Np> struct extent<_Tp[_Np], 0> : public integral_constant<size_t, _Np> {};
template <class _Tp, size_t _Np, unsigned _Ip> struct extent<_Tp[_Np], _Ip> : public integral_constant<size_t, extent<_Tp, _Ip-1>::value> {};
template <class _Tp, unsigned _Ip = 0> struct _LIBCPP_VISIBLE extent
: public integral_constant<size_t, 0> {};
template <class _Tp> struct _LIBCPP_VISIBLE extent<_Tp[], 0>
: public integral_constant<size_t, 0> {};
template <class _Tp, unsigned _Ip> struct _LIBCPP_VISIBLE extent<_Tp[], _Ip>
: public integral_constant<size_t, extent<_Tp, _Ip-1>::value> {};
template <class _Tp, size_t _Np> struct _LIBCPP_VISIBLE extent<_Tp[_Np], 0>
: public integral_constant<size_t, _Np> {};
template <class _Tp, size_t _Np, unsigned _Ip> struct _LIBCPP_VISIBLE extent<_Tp[_Np], _Ip>
: public integral_constant<size_t, extent<_Tp, _Ip-1>::value> {};
// remove_extent
template <class _Tp> struct remove_extent {typedef _Tp type;};
template <class _Tp> struct remove_extent<_Tp[]> {typedef _Tp type;};
template <class _Tp, size_t _Np> struct remove_extent<_Tp[_Np]> {typedef _Tp type;};
template <class _Tp> struct _LIBCPP_VISIBLE remove_extent
{typedef _Tp type;};
template <class _Tp> struct _LIBCPP_VISIBLE remove_extent<_Tp[]>
{typedef _Tp type;};
template <class _Tp, size_t _Np> struct _LIBCPP_VISIBLE remove_extent<_Tp[_Np]>
{typedef _Tp type;};
// remove_all_extents
template <class _Tp> struct remove_all_extents {typedef _Tp type;};
template <class _Tp> struct remove_all_extents<_Tp[]> {typedef typename remove_all_extents<_Tp>::type type;};
template <class _Tp, size_t _Np> struct remove_all_extents<_Tp[_Np]> {typedef typename remove_all_extents<_Tp>::type type;};
template <class _Tp> struct _LIBCPP_VISIBLE remove_all_extents
{typedef _Tp type;};
template <class _Tp> struct _LIBCPP_VISIBLE remove_all_extents<_Tp[]>
{typedef typename remove_all_extents<_Tp>::type type;};
template <class _Tp, size_t _Np> struct _LIBCPP_VISIBLE remove_all_extents<_Tp[_Np]>
{typedef typename remove_all_extents<_Tp>::type type;};
// is_same
template <class _Tp, class _Up> struct is_same : public false_type {};
template <class _Tp> struct is_same<_Tp, _Tp> : public true_type {};
template <class _Tp, class _Up> struct _LIBCPP_VISIBLE is_same : public false_type {};
template <class _Tp> struct _LIBCPP_VISIBLE is_same<_Tp, _Tp> : public true_type {};
// is_abstract
@ -559,7 +590,7 @@ struct __libcpp_abstract : public integral_constant<bool, sizeof(__is_abstract_i
template <class _Tp> struct __libcpp_abstract<_Tp, false> : public false_type {};
template <class _Tp> struct is_abstract : public __libcpp_abstract<_Tp> {};
template <class _Tp> struct _LIBCPP_VISIBLE is_abstract : public __libcpp_abstract<_Tp> {};
// is_convertible
@ -656,7 +687,8 @@ template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 1, 3> : public
template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 2, 3> : public false_type {};
template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 3, 3> : public true_type {};
template <class _T1, class _T2> struct is_convertible : public __is_convertible<_T1, _T2>
template <class _T1, class _T2> struct _LIBCPP_VISIBLE is_convertible
: public __is_convertible<_T1, _T2>
{
static const size_t __complete_check1 = __is_convertible_check<_T1>::__v;
static const size_t __complete_check2 = __is_convertible_check<_T2>::__v;
@ -705,7 +737,7 @@ struct __libcpp_base_of<_Bp, _Dp, true, true, false>
: public integral_constant<bool, __is_base_of_imp<_Bp, _Dp>::value> {};
template <class _Bp, class _Dp>
struct is_base_of
struct _LIBCPP_VISIBLE is_base_of
: public __libcpp_base_of<typename remove_cv<_Bp>::type, typename remove_cv<_Dp>::type>
{
};
@ -729,7 +761,7 @@ struct __libcpp_empty : public integral_constant<bool, sizeof(__is_empty1<_Tp>)
template <class _Tp> struct __libcpp_empty<_Tp, false> : public false_type {};
template <class _Tp> struct is_empty : public __libcpp_empty<_Tp> {};
template <class _Tp> struct _LIBCPP_VISIBLE is_empty : public __libcpp_empty<_Tp> {};
// is_polymorphic
@ -742,13 +774,14 @@ struct __libcpp_polymorphic
template <class _Tp> struct __libcpp_polymorphic<_Tp, false> : public false_type {};
template <class _Tp> struct is_polymorphic : public __libcpp_polymorphic<_Tp> {};
template <class _Tp> struct _LIBCPP_VISIBLE is_polymorphic
: public __libcpp_polymorphic<_Tp> {};
// has_trivial_default_constructor
#ifdef _LIBCPP_HAS_TYPE_TRAITS
template <class _Tp> struct has_trivial_default_constructor
template <class _Tp> struct _LIBCPP_VISIBLE has_trivial_default_constructor
: public integral_constant<bool, __has_trivial_constructor(_Tp)> {};
#else // _LIBCPP_HAS_TYPE_TRAITS
@ -756,7 +789,7 @@ template <class _Tp> struct has_trivial_default_constructor
template <class _Tp> struct __has_trivial_default_constructor
: public integral_constant<bool, is_scalar<_Tp>::value> {};
template <class _Tp> struct has_trivial_default_constructor
template <class _Tp> struct _LIBCPP_VISIBLE has_trivial_default_constructor
: public __has_trivial_default_constructor<typename remove_all_extents<_Tp>::type> {};
#endif // _LIBCPP_HAS_TYPE_TRAITS
@ -765,12 +798,12 @@ template <class _Tp> struct has_trivial_default_constructor
#ifdef _LIBCPP_HAS_TYPE_TRAITS
template <class _Tp> struct has_nothrow_default_constructor
template <class _Tp> struct _LIBCPP_VISIBLE has_nothrow_default_constructor
: public integral_constant<bool, __has_nothrow_constructor(_Tp)> {};
#else // _LIBCPP_HAS_TYPE_TRAITS
template <class _Tp> struct has_nothrow_default_constructor
template <class _Tp> struct _LIBCPP_VISIBLE has_nothrow_default_constructor
: public has_trivial_default_constructor<_Tp> {};
#endif // _LIBCPP_HAS_TYPE_TRAITS
@ -779,12 +812,12 @@ template <class _Tp> struct has_nothrow_default_constructor
#ifdef _LIBCPP_HAS_TYPE_TRAITS
template <class _Tp> struct has_trivial_copy_constructor
template <class _Tp> struct _LIBCPP_VISIBLE has_trivial_copy_constructor
: public integral_constant<bool, __has_trivial_copy(_Tp)> {};
#else // _LIBCPP_HAS_TYPE_TRAITS
template <class _Tp> struct has_trivial_copy_constructor
template <class _Tp> struct _LIBCPP_VISIBLE has_trivial_copy_constructor
: public integral_constant<bool, is_scalar<_Tp>::value ||
is_reference<_Tp>::value> {};
@ -794,30 +827,31 @@ template <class _Tp> struct has_trivial_copy_constructor
#ifdef _LIBCPP_HAS_TYPE_TRAITS
template <class _Tp> struct has_nothrow_copy_constructor
template <class _Tp> struct _LIBCPP_VISIBLE has_nothrow_copy_constructor
: public integral_constant<bool, __has_nothrow_copy(_Tp)> {};
#else // _LIBCPP_HAS_TYPE_TRAITS
template <class _Tp> struct has_nothrow_copy_constructor
template <class _Tp> struct _LIBCPP_VISIBLE has_nothrow_copy_constructor
: public has_trivial_copy_constructor<_Tp> {};
#endif // _LIBCPP_HAS_TYPE_TRAITS
// has_nothrow_move_constructor
template <class _Tp> struct has_nothrow_move_constructor : public has_nothrow_copy_constructor<_Tp> {};
template <class _Tp> struct _LIBCPP_VISIBLE has_nothrow_move_constructor
: public has_nothrow_copy_constructor<_Tp> {};
// has_trivial_copy_assign
#ifdef _LIBCPP_HAS_TYPE_TRAITS
template <class _Tp> struct has_trivial_copy_assign
template <class _Tp> struct _LIBCPP_VISIBLE has_trivial_copy_assign
: public integral_constant<bool, __has_trivial_assign(_Tp)> {};
#else // _LIBCPP_HAS_TYPE_TRAITS
template <class _Tp> struct has_trivial_copy_assign
template <class _Tp> struct _LIBCPP_VISIBLE has_trivial_copy_assign
: public integral_constant<bool, is_scalar<_Tp>::value &&
!is_const<_Tp>::value> {};
@ -827,12 +861,12 @@ template <class _Tp> struct has_trivial_copy_assign
#ifdef _LIBCPP_HAS_TYPE_TRAITS
template <class _Tp> struct has_nothrow_copy_assign
template <class _Tp> struct _LIBCPP_VISIBLE has_nothrow_copy_assign
: public integral_constant<bool, __has_nothrow_assign(_Tp)> {};
#else // _LIBCPP_HAS_TYPE_TRAITS
template <class _Tp> struct has_nothrow_copy_assign
template <class _Tp> struct _LIBCPP_VISIBLE has_nothrow_copy_assign
: public has_trivial_copy_assign<_Tp> {};
#endif // _LIBCPP_HAS_TYPE_TRAITS
@ -841,7 +875,7 @@ template <class _Tp> struct has_nothrow_copy_assign
#ifdef _LIBCPP_HAS_TYPE_TRAITS
template <class _Tp> struct has_trivial_destructor
template <class _Tp> struct _LIBCPP_VISIBLE has_trivial_destructor
: public integral_constant<bool, __has_trivial_destructor(_Tp)> {};
#else // _LIBCPP_HAS_TYPE_TRAITS
@ -850,7 +884,7 @@ template <class _Tp> struct __libcpp_trivial_destructor
: public integral_constant<bool, is_scalar<_Tp>::value ||
is_reference<_Tp>::value> {};
template <class _Tp> struct has_trivial_destructor
template <class _Tp> struct _LIBCPP_VISIBLE has_trivial_destructor
: public __libcpp_trivial_destructor<typename remove_all_extents<_Tp>::type> {};
#endif // _LIBCPP_HAS_TYPE_TRAITS
@ -859,12 +893,13 @@ template <class _Tp> struct has_trivial_destructor
#ifdef _LIBCPP_HAS_TYPE_TRAITS
template <class _Tp> struct has_virtual_destructor
template <class _Tp> struct _LIBCPP_VISIBLE has_virtual_destructor
: public integral_constant<bool, __has_virtual_destructor(_Tp)> {};
#else // _LIBCPP_HAS_TYPE_TRAITS
template <class _Tp> struct has_virtual_destructor : public false_type {};
template <class _Tp> struct _LIBCPP_VISIBLE has_virtual_destructor
: public false_type {};
#endif // _LIBCPP_HAS_TYPE_TRAITS
@ -872,12 +907,13 @@ template <class _Tp> struct has_virtual_destructor : public false_type {};
#ifdef _LIBCPP_HAS_TYPE_TRAITS
template <class _Tp> struct is_pod
template <class _Tp> struct _LIBCPP_VISIBLE is_pod
: public integral_constant<bool, __is_pod(_Tp)> {};
#else // _LIBCPP_HAS_TYPE_TRAITS
template <class _Tp> struct is_pod : public integral_constant<bool, has_trivial_default_constructor<_Tp>::value &&
template <class _Tp> struct _LIBCPP_VISIBLE is_pod
: public integral_constant<bool, has_trivial_default_constructor<_Tp>::value &&
has_trivial_copy_constructor<_Tp>::value &&
has_trivial_copy_assign<_Tp>::value &&
has_trivial_destructor<_Tp>::value> {};
@ -888,7 +924,7 @@ template <class _Tp> struct is_pod : public integral_constant<bool, has_trivial_
template <class _Tp> struct __alignment_of {_Tp _;};
template <class _Tp> struct alignment_of
template <class _Tp> struct _LIBCPP_VISIBLE alignment_of
: public integral_constant<size_t, __alignof__(__alignment_of<typename remove_all_extents<_Tp>::type>)> {};
// aligned_storage
@ -968,7 +1004,7 @@ struct __find_max_align<__type_list<_Hp, _Tp>, _Len>
: public integral_constant<size_t, __select_align<_Len, _Hp::value, __find_max_align<_Tp, _Len>::value>::value> {};
template <size_t _Len, const size_t _Align = __find_max_align<__all_types, _Len>::value>
struct aligned_storage
struct _LIBCPP_VISIBLE aligned_storage
{
typedef typename __find_pod<__all_types, _Align>::type _Aligner;
static_assert(!is_void<_Aligner>::value, "");
@ -981,7 +1017,7 @@ struct aligned_storage
#define _CREATE_ALIGNED_STORAGE_SPECIALIZATION(n) \
template <size_t _Len>\
struct aligned_storage<_Len, n>\
struct __attribute__ ((__visibility__("default"))) aligned_storage<_Len, n>\
{\
struct type\
{\
@ -1161,7 +1197,7 @@ template <> struct __make_signed< signed long long, true> {typedef long long ty
template <> struct __make_signed<unsigned long long, true> {typedef long long type;};
template <class _Tp>
struct make_signed
struct _LIBCPP_VISIBLE make_signed
{
typedef typename __apply_cv<_Tp, typename __make_signed<typename remove_cv<_Tp>::type>::type>::type type;
};
@ -1186,7 +1222,7 @@ template <> struct __make_unsigned< signed long long, true> {typedef unsigned l
template <> struct __make_unsigned<unsigned long long, true> {typedef unsigned long long type;};
template <class _Tp>
struct make_unsigned
struct _LIBCPP_VISIBLE make_unsigned
{
typedef typename __apply_cv<_Tp, typename __make_unsigned<typename remove_cv<_Tp>::type>::type>::type type;
};
@ -1194,21 +1230,21 @@ struct make_unsigned
#ifdef _LIBCPP_HAS_NO_VARIADICS
template <class _Tp, class _Up = void, class V = void>
struct common_type
struct _LIBCPP_VISIBLE common_type
{
public:
typedef typename common_type<typename common_type<_Tp, _Up>::type, V>::type type;
};
template <class _Tp>
struct common_type<_Tp, void, void>
struct _LIBCPP_VISIBLE common_type<_Tp, void, void>
{
public:
typedef _Tp type;
};
template <class _Tp, class _Up>
struct common_type<_Tp, _Up, void>
struct _LIBCPP_VISIBLE common_type<_Tp, _Up, void>
{
private:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
@ -1228,13 +1264,13 @@ public:
template <class ..._Tp> struct common_type;
template <class _Tp>
struct common_type<_Tp>
struct _LIBCPP_VISIBLE common_type<_Tp>
{
typedef _Tp type;
};
template <class _Tp, class _Up>
struct common_type<_Tp, _Up>
struct _LIBCPP_VISIBLE common_type<_Tp, _Up>
{
private:
static _Tp&& __t();
@ -1245,7 +1281,7 @@ public:
};
template <class _Tp, class _Up, class ..._Vp>
struct common_type<_Tp, _Up, _Vp...>
struct _LIBCPP_VISIBLE common_type<_Tp, _Up, _Vp...>
{
typedef typename common_type<typename common_type<_Tp, _Up>::type, _Vp...>::type type;
};
@ -1281,13 +1317,13 @@ struct __is_assignable
// has_copy_assign
template <class _Tp> struct has_copy_assign
template <class _Tp> struct _LIBCPP_VISIBLE has_copy_assign
: public __is_assignable<_Tp&, const _Tp&> {};
template <class _Tp> struct has_copy_assign<_Tp[]>
template <class _Tp> struct _LIBCPP_VISIBLE has_copy_assign<_Tp[]>
: public false_type {};
template <class _Tp> struct has_copy_assign<_Tp&>
template <class _Tp> struct _LIBCPP_VISIBLE has_copy_assign<_Tp&>
: public false_type {};
// move
@ -1378,12 +1414,14 @@ class __rv
typedef typename remove_reference<_Tp>::type _Trr;
_Trr& t_;
public:
_LIBCPP_INLINE_VISIBILITY
_Trr* operator->() {return &t_;}
_LIBCPP_INLINE_VISIBILITY
explicit __rv(_Trr& __t) : t_(__t) {}
};
template <class _Tp>
inline
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
!is_convertible<_Tp, __rv<_Tp> >::value,
@ -1395,7 +1433,7 @@ move(_Tp& __t)
}
template <class _Tp>
inline
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
is_convertible<_Tp, __rv<_Tp> >::value,
@ -1407,7 +1445,7 @@ move(_Tp& __t)
}
template <class _Tp, class _Up>
inline
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
!is_convertible<_Tp, __rv<_Tp> >::value,
@ -1419,7 +1457,7 @@ forward(_Up& __t)
}
template <class _Tp, class _Up>
inline
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
!is_convertible<_Tp, __rv<_Tp> >::value,
@ -1431,7 +1469,7 @@ forward(const _Up& __t)
}
template <class _Tp, class _Up>
inline
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
is_convertible<_Tp, __rv<_Tp> >::value,
@ -1443,7 +1481,7 @@ forward(_Up& __t)
}
template <class _Tp, class _Up>
inline
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
is_convertible<_Tp, __rv<_Tp> >::value,
@ -1457,7 +1495,7 @@ forward(const _Up& __t)
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp>
struct decay
struct _LIBCPP_VISIBLE decay
{
private:
typedef typename remove_reference<_Tp>::type _Up;
@ -1559,7 +1597,7 @@ class __result_of<_Fn(_Tp, _ArgTypes...), false> // _Fn must be member pointer
// result_of
template <class _Fn, class ..._ArgTypes>
class result_of<_Fn(_ArgTypes...)>
class _LIBCPP_VISIBLE result_of<_Fn(_ArgTypes...)>
: public __result_of<_Fn(_ArgTypes...),
is_class<typename remove_reference<_Fn>::type>::value ||
is_function<typename remove_pointer<
@ -1601,7 +1639,7 @@ public:
};
template <class _Fn>
class result_of<_Fn()>
class _LIBCPP_VISIBLE result_of<_Fn()>
: public __result_of<_Fn(),
is_class<typename remove_reference<_Fn>::type>::value ||
is_function<typename remove_pointer<
@ -1613,7 +1651,7 @@ class result_of<_Fn()>
};
template <class _Fn, class _A0>
class result_of<_Fn(_A0)>
class _LIBCPP_VISIBLE result_of<_Fn(_A0)>
: public __result_of<_Fn(_A0),
is_class<typename remove_reference<_Fn>::type>::value ||
is_function<typename remove_pointer<
@ -1625,7 +1663,7 @@ class result_of<_Fn(_A0)>
};
template <class _Fn, class _A0, class _A1>
class result_of<_Fn(_A0, _A1)>
class _LIBCPP_VISIBLE result_of<_Fn(_A0, _A1)>
: public __result_of<_Fn(_A0, _A1),
is_class<typename remove_reference<_Fn>::type>::value ||
is_function<typename remove_pointer<
@ -1637,7 +1675,7 @@ class result_of<_Fn(_A0, _A1)>
};
template <class _Fn, class _A0, class _A1, class _A2>
class result_of<_Fn(_A0, _A1, _A2)>
class _LIBCPP_VISIBLE result_of<_Fn(_A0, _A1, _A2)>
: public __result_of<_Fn(_A0, _A1, _A2),
is_class<typename remove_reference<_Fn>::type>::value ||
is_function<typename remove_pointer<
@ -1742,7 +1780,7 @@ struct __contains_void<_A0, _Args...>
// is_constructible entry point
template <class _Tp, class... _Args>
struct is_constructible
struct _LIBCPP_VISIBLE is_constructible
: public __is_constructible_void_check<__contains_void<_Tp, _Args...>::value
|| is_abstract<_Tp>::value,
_Tp, _Args...>
@ -1771,7 +1809,7 @@ struct __is_constructible<false, _A[], _Args...>
{};
template <class _Tp>
struct has_default_constructor
struct _LIBCPP_VISIBLE has_default_constructor
: public is_constructible<_Tp>
{};
@ -1823,7 +1861,7 @@ struct __is_constructible0_void_check<true, _Tp>
// has_default_constructor entry point
template <class _Tp>
struct has_default_constructor
struct _LIBCPP_VISIBLE has_default_constructor
: public __is_constructible0_void_check<is_void<_Tp>::value
|| is_abstract<_Tp>::value,
_Tp>
@ -1851,14 +1889,14 @@ struct __is_constructible0_imp<false, _A[]>
#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
template <class _Tp>
struct has_copy_constructor
struct _LIBCPP_VISIBLE has_copy_constructor
: public is_constructible<_Tp, typename add_lvalue_reference<const _Tp>::type>
{};
#else // _LIBCPP_HAS_NO_ADVANCED_SFINAE
template <class _Tp>
struct has_copy_constructor
struct _LIBCPP_VISIBLE has_copy_constructor
: public has_nothrow_copy_constructor<_Tp>
{};

View File

@ -53,29 +53,39 @@ struct hash<type_index>
_LIBCPP_BEGIN_NAMESPACE_STD
class type_index
class _LIBCPP_VISIBLE type_index
{
const type_info* __t_;
public:
_LIBCPP_INLINE_VISIBILITY
type_index(const type_info& __y) : __t_(&__y) {}
_LIBCPP_INLINE_VISIBILITY
bool operator==(const type_index& __y) const {return *__t_ == *__y.__t_;}
_LIBCPP_INLINE_VISIBILITY
bool operator!=(const type_index& __y) const {return *__t_ != *__y.__t_;}
_LIBCPP_INLINE_VISIBILITY
bool operator< (const type_index& __y) const {return __t_->before(*__y.__t_);}
_LIBCPP_INLINE_VISIBILITY
bool operator<=(const type_index& __y) const {return !__y.__t_->before(*__t_);}
_LIBCPP_INLINE_VISIBILITY
bool operator> (const type_index& __y) const {return __y.__t_->before(*__t_);}
_LIBCPP_INLINE_VISIBILITY
bool operator>=(const type_index& __y) const {return !__t_->before(*__y.__t_);}
_LIBCPP_INLINE_VISIBILITY
size_t hash_code() const {return __t_->hash_code();}
_LIBCPP_INLINE_VISIBILITY
const char* name() const {return __t_->name();}
};
template <class _Tp> struct hash;
template <class _Tp> struct _LIBCPP_VISIBLE hash;
template <>
struct hash<type_index>
struct _LIBCPP_VISIBLE hash<type_index>
: public unary_function<type_index, size_t>
{
_LIBCPP_INLINE_VISIBILITY
size_t operator()(type_index __index) const {return __index.hash_code();}
};

View File

@ -73,21 +73,27 @@ class _LIBCPP_EXCEPTION_ABI type_info
protected:
const char* __type_name;
_LIBCPP_INLINE_VISIBILITY
explicit type_info(const char* __n)
: __type_name(__n) {}
public:
virtual ~type_info();
_LIBCPP_INLINE_VISIBILITY
const char* name() const {return __type_name;}
_LIBCPP_INLINE_VISIBILITY
bool before(const type_info& __arg) const
{return __type_name < __arg.__type_name;}
_LIBCPP_INLINE_VISIBILITY
size_t hash_code() const throw()
{return *reinterpret_cast<const size_t*>(&__type_name);}
_LIBCPP_INLINE_VISIBILITY
bool operator==(const type_info& __arg) const
{return __type_name == __arg.__type_name;}
_LIBCPP_INLINE_VISIBILITY
bool operator!=(const type_info& __arg) const
{return !operator==(__arg);}

View File

@ -288,11 +288,16 @@ class __unordered_map_hasher
: private _Hash
{
public:
_LIBCPP_INLINE_VISIBILITY
__unordered_map_hasher() : _Hash() {}
_LIBCPP_INLINE_VISIBILITY
__unordered_map_hasher(const _Hash& __h) : _Hash(__h) {}
_LIBCPP_INLINE_VISIBILITY
const _Hash& hash_function() const {return *this;}
_LIBCPP_INLINE_VISIBILITY
size_t operator()(const _Tp& __x) const
{return static_cast<const _Hash&>(*this)(__x.first);}
_LIBCPP_INLINE_VISIBILITY
size_t operator()(const typename _Tp::first_type& __x) const
{return static_cast<const _Hash&>(*this)(__x);}
};
@ -302,11 +307,16 @@ class __unordered_map_hasher<_Tp, _Hash, false>
{
_Hash __hash_;
public:
_LIBCPP_INLINE_VISIBILITY
__unordered_map_hasher() : __hash_() {}
_LIBCPP_INLINE_VISIBILITY
__unordered_map_hasher(const _Hash& __h) : __hash_(__h) {}
_LIBCPP_INLINE_VISIBILITY
const _Hash& hash_function() const {return __hash_;}
_LIBCPP_INLINE_VISIBILITY
size_t operator()(const _Tp& __x) const
{return __hash_(__x.first);}
_LIBCPP_INLINE_VISIBILITY
size_t operator()(const typename _Tp::first_type& __x) const
{return __hash_(__x);}
};
@ -316,15 +326,22 @@ class __unordered_map_equal
: private _Pred
{
public:
_LIBCPP_INLINE_VISIBILITY
__unordered_map_equal() : _Pred() {}
_LIBCPP_INLINE_VISIBILITY
__unordered_map_equal(const _Pred& __p) : _Pred(__p) {}
_LIBCPP_INLINE_VISIBILITY
const _Pred& key_eq() const {return *this;}
_LIBCPP_INLINE_VISIBILITY
bool operator()(const _Tp& __x, const _Tp& __y) const
{return static_cast<const _Pred&>(*this)(__x.first, __y.first);}
_LIBCPP_INLINE_VISIBILITY
bool operator()(const typename _Tp::first_type& __x, const _Tp& __y) const
{return static_cast<const _Pred&>(*this)(__x, __y.first);}
_LIBCPP_INLINE_VISIBILITY
bool operator()(const _Tp& __x, const typename _Tp::first_type& __y) const
{return static_cast<const _Pred&>(*this)(__x.first, __y);}
_LIBCPP_INLINE_VISIBILITY
bool operator()(const typename _Tp::first_type& __x,
const typename _Tp::first_type& __y) const
{return static_cast<const _Pred&>(*this)(__x, __y);}
@ -335,15 +352,22 @@ class __unordered_map_equal<_Tp, _Pred, false>
{
_Pred __pred_;
public:
_LIBCPP_INLINE_VISIBILITY
__unordered_map_equal() : __pred_() {}
_LIBCPP_INLINE_VISIBILITY
__unordered_map_equal(const _Pred& __p) : __pred_(__p) {}
_LIBCPP_INLINE_VISIBILITY
const _Pred& key_eq() const {return __pred_;}
_LIBCPP_INLINE_VISIBILITY
bool operator()(const _Tp& __x, const _Tp& __y) const
{return __pred_(__x.first, __y.first);}
_LIBCPP_INLINE_VISIBILITY
bool operator()(const typename _Tp::first_type& __x, const _Tp& __y) const
{return __pred_(__x, __y.first);}
_LIBCPP_INLINE_VISIBILITY
bool operator()(const _Tp& __x, const typename _Tp::first_type& __y) const
{return __pred_(__x.first, __y);}
_LIBCPP_INLINE_VISIBILITY
bool operator()(const typename _Tp::first_type& __x,
const typename _Tp::first_type& __y) const
{return __pred_(__x, __y);}
@ -369,6 +393,7 @@ public:
bool __first_constructed;
bool __second_constructed;
_LIBCPP_INLINE_VISIBILITY
explicit __hash_map_node_destructor(allocator_type& __na)
: __na_(__na),
__first_constructed(false),
@ -376,6 +401,7 @@ public:
{}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
__hash_map_node_destructor(__hash_node_destructor<allocator_type>&& __x)
: __na_(__x.__na_),
__first_constructed(__x.__value_constructed),
@ -384,6 +410,7 @@ public:
__x.__value_constructed = false;
}
#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
__hash_map_node_destructor(const __hash_node_destructor<allocator_type>& __x)
: __na_(__x.__na_),
__first_constructed(__x.__value_constructed),
@ -393,6 +420,7 @@ public:
}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
void operator()(pointer __p)
{
if (__second_constructed)
@ -405,7 +433,7 @@ public:
};
template <class _HashIterator>
class __hash_map_iterator
class _LIBCPP_VISIBLE __hash_map_iterator
{
_HashIterator __i_;
@ -425,14 +453,20 @@ public:
#endif
pointer;
_LIBCPP_INLINE_VISIBILITY
__hash_map_iterator() {}
_LIBCPP_INLINE_VISIBILITY
__hash_map_iterator(_HashIterator __i) : __i_(__i) {}
_LIBCPP_INLINE_VISIBILITY
reference operator*() const {return *operator->();}
_LIBCPP_INLINE_VISIBILITY
pointer operator->() const {return (pointer)__i_.operator->();}
_LIBCPP_INLINE_VISIBILITY
__hash_map_iterator& operator++() {++__i_; return *this;}
_LIBCPP_INLINE_VISIBILITY
__hash_map_iterator operator++(int)
{
__hash_map_iterator __t(*this);
@ -440,20 +474,22 @@ public:
return __t;
}
friend bool operator==(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
friend _LIBCPP_INLINE_VISIBILITY
bool operator==(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
{return __x.__i_ == __y.__i_;}
friend bool operator!=(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
friend _LIBCPP_INLINE_VISIBILITY
bool operator!=(const __hash_map_iterator& __x, const __hash_map_iterator& __y)
{return __x.__i_ != __y.__i_;}
template <class, class, class, class, class> friend class unordered_map;
template <class, class, class, class, class> friend class unordered_multimap;
template <class> friend class __hash_const_iterator;
template <class> friend class __hash_const_local_iterator;
template <class> friend class __hash_map_const_iterator;
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_map;
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_multimap;
template <class> friend class _LIBCPP_VISIBLE __hash_const_iterator;
template <class> friend class _LIBCPP_VISIBLE __hash_const_local_iterator;
template <class> friend class _LIBCPP_VISIBLE __hash_map_const_iterator;
};
template <class _HashIterator>
class __hash_map_const_iterator
class _LIBCPP_VISIBLE __hash_map_const_iterator
{
_HashIterator __i_;
@ -473,17 +509,24 @@ public:
#endif
pointer;
_LIBCPP_INLINE_VISIBILITY
__hash_map_const_iterator() {}
_LIBCPP_INLINE_VISIBILITY
__hash_map_const_iterator(_HashIterator __i) : __i_(__i) {}
_LIBCPP_INLINE_VISIBILITY
__hash_map_const_iterator(
__hash_map_iterator<typename _HashIterator::__non_const_iterator> __i)
: __i_(__i.__i_) {}
_LIBCPP_INLINE_VISIBILITY
reference operator*() const {return *operator->();}
_LIBCPP_INLINE_VISIBILITY
pointer operator->() const {return (pointer)__i_.operator->();}
_LIBCPP_INLINE_VISIBILITY
__hash_map_const_iterator& operator++() {++__i_; return *this;}
_LIBCPP_INLINE_VISIBILITY
__hash_map_const_iterator operator++(int)
{
__hash_map_const_iterator __t(*this);
@ -491,20 +534,22 @@ public:
return __t;
}
friend bool operator==(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
friend _LIBCPP_INLINE_VISIBILITY
bool operator==(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
{return __x.__i_ == __y.__i_;}
friend bool operator!=(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
friend _LIBCPP_INLINE_VISIBILITY
bool operator!=(const __hash_map_const_iterator& __x, const __hash_map_const_iterator& __y)
{return __x.__i_ != __y.__i_;}
template <class, class, class, class, class> friend class unordered_map;
template <class, class, class, class, class> friend class unordered_multimap;
template <class> friend class __hash_const_iterator;
template <class> friend class __hash_const_local_iterator;
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_map;
template <class, class, class, class, class> friend class _LIBCPP_VISIBLE unordered_multimap;
template <class> friend class _LIBCPP_VISIBLE __hash_const_iterator;
template <class> friend class _LIBCPP_VISIBLE __hash_const_local_iterator;
};
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
class _Alloc = allocator<pair<const _Key, _Tp> > >
class unordered_map
class _LIBCPP_VISIBLE unordered_map
{
public:
// types
@ -553,6 +598,7 @@ public:
typedef __hash_map_iterator<typename __table::local_iterator> local_iterator;
typedef __hash_map_const_iterator<typename __table::const_local_iterator> const_local_iterator;
_LIBCPP_INLINE_VISIBILITY
unordered_map() {} // = default;
explicit unordered_map(size_type __n, const hasher& __hf = hasher(),
const key_equal& __eql = key_equal());
@ -590,26 +636,38 @@ public:
#endif
unordered_map& operator=(initializer_list<value_type> __il);
_LIBCPP_INLINE_VISIBILITY
allocator_type get_allocator() const
{return allocator_type(__table_.__node_alloc());}
_LIBCPP_INLINE_VISIBILITY
bool empty() const {return __table_.size() == 0;}
_LIBCPP_INLINE_VISIBILITY
size_type size() const {return __table_.size();}
_LIBCPP_INLINE_VISIBILITY
size_type max_size() const {return __table_.max_size();}
_LIBCPP_INLINE_VISIBILITY
iterator begin() {return __table_.begin();}
_LIBCPP_INLINE_VISIBILITY
iterator end() {return __table_.end();}
_LIBCPP_INLINE_VISIBILITY
const_iterator begin() const {return __table_.begin();}
_LIBCPP_INLINE_VISIBILITY
const_iterator end() const {return __table_.end();}
_LIBCPP_INLINE_VISIBILITY
const_iterator cbegin() const {return __table_.begin();}
_LIBCPP_INLINE_VISIBILITY
const_iterator cend() const {return __table_.end();}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> emplace()
{return __table_.__emplace_unique();}
template <class _A0,
class = typename enable_if<is_convertible<_A0, value_type>::value>::type>
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> emplace(_A0&& __a0)
{return __table_.__emplace_unique(_STD::forward<_A0>(__a0));}
@ -621,11 +679,13 @@ public:
#endif // _LIBCPP_HAS_NO_VARIADICS
_LIBCPP_INLINE_VISIBILITY
iterator emplace_hint(const_iterator)
{return __table_.__emplace_unique().first;}
template <class _A0,
class = typename enable_if<is_convertible<_A0, value_type>::value>::type>
_LIBCPP_INLINE_VISIBILITY
iterator emplace_hint(const_iterator, _A0&& __a0)
{return __table_.__emplace_unique(_STD::forward<_A0>(__a0)).first;}
@ -633,50 +693,68 @@ public:
template <class _A0, class... _Args,
class = typename enable_if<is_convertible<_A0, key_type>::value>::type>
_LIBCPP_INLINE_VISIBILITY
iterator emplace_hint(const_iterator, _A0&& __a0, _Args&&... __args)
{return emplace(_STD::forward<_A0>(__a0),
_STD::forward<_Args>(__args)...).first;}
#endif // _LIBCPP_HAS_NO_VARIADICS
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> insert(const value_type& __x)
{return __table_.__insert_unique(__x);}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _P,
class = typename enable_if<is_convertible<_P, value_type>::value>::type>
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> insert(_P&& __x)
{return __table_.__insert_unique(_STD::forward<_P>(__x));}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator, const value_type& __x)
{return insert(__x).first;}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _P,
class = typename enable_if<is_convertible<_P, value_type>::value>::type>
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator, _P&& __x)
{return insert(_STD::forward<_P>(__x)).first;}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _InputIterator>
void insert(_InputIterator __first, _InputIterator __last);
_LIBCPP_INLINE_VISIBILITY
void insert(initializer_list<value_type> __il)
{insert(__il.begin(), __il.end());}
_LIBCPP_INLINE_VISIBILITY
iterator erase(const_iterator __p) {return __table_.erase(__p.__i_);}
_LIBCPP_INLINE_VISIBILITY
size_type erase(const key_type& __k) {return __table_.__erase_unique(__k);}
_LIBCPP_INLINE_VISIBILITY
iterator erase(const_iterator __first, const_iterator __last)
{return __table_.erase(__first.__i_, __last.__i_);}
_LIBCPP_INLINE_VISIBILITY
void clear() {__table_.clear();}
_LIBCPP_INLINE_VISIBILITY
void swap(unordered_map& __u) {__table_.swap(__u.__table_);}
_LIBCPP_INLINE_VISIBILITY
hasher hash_function() const
{return __table_.hash_function().hash_function();}
_LIBCPP_INLINE_VISIBILITY
key_equal key_eq() const
{return __table_.key_eq().key_eq();}
_LIBCPP_INLINE_VISIBILITY
iterator find(const key_type& __k) {return __table_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const key_type& __k) const {return __table_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
size_type count(const key_type& __k) const {return __table_.__count_unique(__k);}
_LIBCPP_INLINE_VISIBILITY
pair<iterator, iterator> equal_range(const key_type& __k)
{return __table_.__equal_range_unique(__k);}
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
{return __table_.__equal_range_unique(__k);}
@ -688,24 +766,39 @@ public:
mapped_type& at(const key_type& __k);
const mapped_type& at(const key_type& __k) const;
_LIBCPP_INLINE_VISIBILITY
size_type bucket_count() const {return __table_.bucket_count();}
_LIBCPP_INLINE_VISIBILITY
size_type max_bucket_count() const {return __table_.max_bucket_count();}
_LIBCPP_INLINE_VISIBILITY
size_type bucket_size(size_type __n) const
{return __table_.bucket_size(__n);}
_LIBCPP_INLINE_VISIBILITY
size_type bucket(const key_type& __k) const {return __table_.bucket(__k);}
_LIBCPP_INLINE_VISIBILITY
local_iterator begin(size_type __n) {return __table_.begin(__n);}
_LIBCPP_INLINE_VISIBILITY
local_iterator end(size_type __n) {return __table_.end(__n);}
_LIBCPP_INLINE_VISIBILITY
const_local_iterator begin(size_type __n) const {return __table_.cbegin(__n);}
_LIBCPP_INLINE_VISIBILITY
const_local_iterator end(size_type __n) const {return __table_.cend(__n);}
_LIBCPP_INLINE_VISIBILITY
const_local_iterator cbegin(size_type __n) const {return __table_.cbegin(__n);}
_LIBCPP_INLINE_VISIBILITY
const_local_iterator cend(size_type __n) const {return __table_.cend(__n);}
_LIBCPP_INLINE_VISIBILITY
float load_factor() const {return __table_.load_factor();}
_LIBCPP_INLINE_VISIBILITY
float max_load_factor() const {return __table_.max_load_factor();}
_LIBCPP_INLINE_VISIBILITY
void max_load_factor(float __mlf) {__table_.max_load_factor(__mlf);}
_LIBCPP_INLINE_VISIBILITY
void rehash(size_type __n) {__table_.rehash(__n);}
_LIBCPP_INLINE_VISIBILITY
void reserve(size_type __n) {__table_.reserve(__n);}
private:
@ -741,7 +834,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
}
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
inline
inline _LIBCPP_INLINE_VISIBILITY
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
const allocator_type& __a)
: __table_(__a)
@ -799,7 +892,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
inline
inline _LIBCPP_INLINE_VISIBILITY
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
unordered_map&& __u)
: __table_(_STD::move(__u.__table_))
@ -853,7 +946,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
inline
inline _LIBCPP_INLINE_VISIBILITY
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(unordered_map&& __u)
{
@ -864,7 +957,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(unordered_map&& __u)
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
inline
inline _LIBCPP_INLINE_VISIBILITY
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(
initializer_list<value_type> __il)
@ -950,7 +1043,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(const key_type&
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
template <class _InputIterator>
inline
inline _LIBCPP_INLINE_VISIBILITY
void
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
_InputIterator __last)
@ -1014,7 +1107,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::at(const key_type& __k) const
}
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
inline
inline _LIBCPP_INLINE_VISIBILITY
void
swap(unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
@ -1042,7 +1135,7 @@ operator==(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
}
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
inline
inline _LIBCPP_INLINE_VISIBILITY
bool
operator!=(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
@ -1052,7 +1145,7 @@ operator!=(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
class _Alloc = allocator<pair<const _Key, _Tp> > >
class unordered_multimap
class _LIBCPP_VISIBLE unordered_multimap
{
public:
// types
@ -1099,6 +1192,7 @@ public:
typedef __hash_map_iterator<typename __table::local_iterator> local_iterator;
typedef __hash_map_const_iterator<typename __table::const_local_iterator> const_local_iterator;
_LIBCPP_INLINE_VISIBILITY
unordered_multimap() {} // = default
explicit unordered_multimap(size_type __n, const hasher& __hf = hasher(),
const key_equal& __eql = key_equal());
@ -1137,26 +1231,38 @@ public:
#endif
unordered_multimap& operator=(initializer_list<value_type> __il);
_LIBCPP_INLINE_VISIBILITY
allocator_type get_allocator() const
{return allocator_type(__table_.__node_alloc());}
_LIBCPP_INLINE_VISIBILITY
bool empty() const {return __table_.size() == 0;}
_LIBCPP_INLINE_VISIBILITY
size_type size() const {return __table_.size();}
_LIBCPP_INLINE_VISIBILITY
size_type max_size() const {return __table_.max_size();}
_LIBCPP_INLINE_VISIBILITY
iterator begin() {return __table_.begin();}
_LIBCPP_INLINE_VISIBILITY
iterator end() {return __table_.end();}
_LIBCPP_INLINE_VISIBILITY
const_iterator begin() const {return __table_.begin();}
_LIBCPP_INLINE_VISIBILITY
const_iterator end() const {return __table_.end();}
_LIBCPP_INLINE_VISIBILITY
const_iterator cbegin() const {return __table_.begin();}
_LIBCPP_INLINE_VISIBILITY
const_iterator cend() const {return __table_.end();}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
iterator emplace()
{return __table_.__emplace_multi();}
template <class _A0,
class = typename enable_if<is_convertible<_A0, value_type>::value>::type>
_LIBCPP_INLINE_VISIBILITY
iterator emplace(_A0&& __a0)
{return __table_.__emplace_multi(_STD::forward<_A0>(__a0));}
@ -1168,11 +1274,13 @@ public:
#endif // _LIBCPP_HAS_NO_VARIADICS
_LIBCPP_INLINE_VISIBILITY
iterator emplace_hint(const_iterator __p)
{return __table_.__emplace_hint_multi(__p.__i_);}
template <class _A0,
class = typename enable_if<is_convertible<_A0, value_type>::value>::type>
_LIBCPP_INLINE_VISIBILITY
iterator emplace_hint(const_iterator __p, _A0&& __a0)
{return __table_.__emplace_hint_multi(__p.__i_, _STD::forward<_A0>(__a0));}
@ -1183,65 +1291,97 @@ public:
iterator emplace_hint(const_iterator __p, _A0&& __a0, _Args&&... __args);
#endif // _LIBCPP_HAS_NO_VARIADICS
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _P,
class = typename enable_if<is_convertible<_P, value_type>::value>::type>
_LIBCPP_INLINE_VISIBILITY
iterator insert(_P&& __x)
{return __table_.__insert_multi(_STD::forward<_P>(__x));}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __p, const value_type& __x)
{return __table_.__insert_multi(__p.__i_, __x);}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _P,
class = typename enable_if<is_convertible<_P, value_type>::value>::type>
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __p, _P&& __x)
{return __table_.__insert_multi(__p.__i_, _STD::forward<_P>(__x));}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _InputIterator>
void insert(_InputIterator __first, _InputIterator __last);
_LIBCPP_INLINE_VISIBILITY
void insert(initializer_list<value_type> __il)
{insert(__il.begin(), __il.end());}
_LIBCPP_INLINE_VISIBILITY
iterator erase(const_iterator __p) {return __table_.erase(__p.__i_);}
_LIBCPP_INLINE_VISIBILITY
size_type erase(const key_type& __k) {return __table_.__erase_multi(__k);}
_LIBCPP_INLINE_VISIBILITY
iterator erase(const_iterator __first, const_iterator __last)
{return __table_.erase(__first.__i_, __last.__i_);}
_LIBCPP_INLINE_VISIBILITY
void clear() {__table_.clear();}
_LIBCPP_INLINE_VISIBILITY
void swap(unordered_multimap& __u) {__table_.swap(__u.__table_);}
_LIBCPP_INLINE_VISIBILITY
hasher hash_function() const
{return __table_.hash_function().hash_function();}
_LIBCPP_INLINE_VISIBILITY
key_equal key_eq() const
{return __table_.key_eq().key_eq();}
_LIBCPP_INLINE_VISIBILITY
iterator find(const key_type& __k) {return __table_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const key_type& __k) const {return __table_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
size_type count(const key_type& __k) const {return __table_.__count_multi(__k);}
_LIBCPP_INLINE_VISIBILITY
pair<iterator, iterator> equal_range(const key_type& __k)
{return __table_.__equal_range_multi(__k);}
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
{return __table_.__equal_range_multi(__k);}
_LIBCPP_INLINE_VISIBILITY
size_type bucket_count() const {return __table_.bucket_count();}
_LIBCPP_INLINE_VISIBILITY
size_type max_bucket_count() const {return __table_.max_bucket_count();}
_LIBCPP_INLINE_VISIBILITY
size_type bucket_size(size_type __n) const
{return __table_.bucket_size(__n);}
_LIBCPP_INLINE_VISIBILITY
size_type bucket(const key_type& __k) const {return __table_.bucket(__k);}
_LIBCPP_INLINE_VISIBILITY
local_iterator begin(size_type __n) {return __table_.begin(__n);}
_LIBCPP_INLINE_VISIBILITY
local_iterator end(size_type __n) {return __table_.end(__n);}
_LIBCPP_INLINE_VISIBILITY
const_local_iterator begin(size_type __n) const {return __table_.cbegin(__n);}
_LIBCPP_INLINE_VISIBILITY
const_local_iterator end(size_type __n) const {return __table_.cend(__n);}
_LIBCPP_INLINE_VISIBILITY
const_local_iterator cbegin(size_type __n) const {return __table_.cbegin(__n);}
_LIBCPP_INLINE_VISIBILITY
const_local_iterator cend(size_type __n) const {return __table_.cend(__n);}
_LIBCPP_INLINE_VISIBILITY
float load_factor() const {return __table_.load_factor();}
_LIBCPP_INLINE_VISIBILITY
float max_load_factor() const {return __table_.max_load_factor();}
_LIBCPP_INLINE_VISIBILITY
void max_load_factor(float __mlf) {__table_.max_load_factor(__mlf);}
_LIBCPP_INLINE_VISIBILITY
void rehash(size_type __n) {__table_.rehash(__n);}
_LIBCPP_INLINE_VISIBILITY
void reserve(size_type __n) {__table_.reserve(__n);}
private:
@ -1303,7 +1443,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
}
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
inline
inline _LIBCPP_INLINE_VISIBILITY
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
const allocator_type& __a)
: __table_(__a)
@ -1331,7 +1471,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
inline
inline _LIBCPP_INLINE_VISIBILITY
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
unordered_multimap&& __u)
: __table_(_STD::move(__u.__table_))
@ -1387,7 +1527,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
inline
inline _LIBCPP_INLINE_VISIBILITY
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(unordered_multimap&& __u)
{
@ -1398,7 +1538,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(unordered_multima
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
inline
inline _LIBCPP_INLINE_VISIBILITY
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=(
initializer_list<value_type> __il)
@ -1483,7 +1623,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::emplace_hint(
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
template <class _InputIterator>
inline
inline _LIBCPP_INLINE_VISIBILITY
void
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
_InputIterator __last)
@ -1493,7 +1633,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::insert(_InputIterator __fir
}
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
inline
inline _LIBCPP_INLINE_VISIBILITY
void
swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
@ -1525,7 +1665,7 @@ operator==(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
}
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
inline
inline _LIBCPP_INLINE_VISIBILITY
bool
operator!=(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)

View File

@ -271,7 +271,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
class _Alloc = allocator<_Value> >
class unordered_set
class _LIBCPP_VISIBLE unordered_set
{
public:
// types
@ -299,6 +299,7 @@ public:
typedef typename __table::const_local_iterator local_iterator;
typedef typename __table::const_local_iterator const_local_iterator;
_LIBCPP_INLINE_VISIBILITY
unordered_set() {} // = default;
explicit unordered_set(size_type __n, const hasher& __hf = hasher(),
const key_equal& __eql = key_equal());
@ -335,81 +336,125 @@ public:
#endif
unordered_set& operator=(initializer_list<value_type> __il);
_LIBCPP_INLINE_VISIBILITY
allocator_type get_allocator() const
{return allocator_type(__table_.__node_alloc());}
_LIBCPP_INLINE_VISIBILITY
bool empty() const {return __table_.size() == 0;}
_LIBCPP_INLINE_VISIBILITY
size_type size() const {return __table_.size();}
_LIBCPP_INLINE_VISIBILITY
size_type max_size() const {return __table_.max_size();}
_LIBCPP_INLINE_VISIBILITY
iterator begin() {return __table_.begin();}
_LIBCPP_INLINE_VISIBILITY
iterator end() {return __table_.end();}
_LIBCPP_INLINE_VISIBILITY
const_iterator begin() const {return __table_.begin();}
_LIBCPP_INLINE_VISIBILITY
const_iterator end() const {return __table_.end();}
_LIBCPP_INLINE_VISIBILITY
const_iterator cbegin() const {return __table_.begin();}
_LIBCPP_INLINE_VISIBILITY
const_iterator cend() const {return __table_.end();}
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> emplace(_Args&&... __args)
{return __table_.__emplace_unique(_STD::forward<_Args>(__args)...);}
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
iterator emplace_hint(const_iterator, _Args&&... __args)
{return __table_.__emplace_unique(_STD::forward<_Args>(__args)...).first;}
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> insert(const value_type& __x)
{return __table_.__insert_unique(__x);}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
pair<iterator, bool> insert(value_type&& __x)
{return __table_.__insert_unique(_STD::move(__x));}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator, const value_type& __x)
{return insert(__x).first;}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator, value_type&& __x)
{return insert(_STD::move(__x)).first;}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _InputIterator>
void insert(_InputIterator __first, _InputIterator __last);
_LIBCPP_INLINE_VISIBILITY
void insert(initializer_list<value_type> __il)
{insert(__il.begin(), __il.end());}
_LIBCPP_INLINE_VISIBILITY
iterator erase(const_iterator __p) {return __table_.erase(__p);}
_LIBCPP_INLINE_VISIBILITY
size_type erase(const key_type& __k) {return __table_.__erase_unique(__k);}
_LIBCPP_INLINE_VISIBILITY
iterator erase(const_iterator __first, const_iterator __last)
{return __table_.erase(__first, __last);}
_LIBCPP_INLINE_VISIBILITY
void clear() {__table_.clear();}
_LIBCPP_INLINE_VISIBILITY
void swap(unordered_set& __u) {__table_.swap(__u.__table_);}
_LIBCPP_INLINE_VISIBILITY
hasher hash_function() const {return __table_.hash_function();}
_LIBCPP_INLINE_VISIBILITY
key_equal key_eq() const {return __table_.key_eq();}
_LIBCPP_INLINE_VISIBILITY
iterator find(const key_type& __k) {return __table_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const key_type& __k) const {return __table_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
size_type count(const key_type& __k) const {return __table_.__count_unique(__k);}
_LIBCPP_INLINE_VISIBILITY
pair<iterator, iterator> equal_range(const key_type& __k)
{return __table_.__equal_range_unique(__k);}
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
{return __table_.__equal_range_unique(__k);}
_LIBCPP_INLINE_VISIBILITY
size_type bucket_count() const {return __table_.bucket_count();}
_LIBCPP_INLINE_VISIBILITY
size_type max_bucket_count() const {return __table_.max_bucket_count();}
_LIBCPP_INLINE_VISIBILITY
size_type bucket_size(size_type __n) const {return __table_.bucket_size(__n);}
_LIBCPP_INLINE_VISIBILITY
size_type bucket(const key_type& __k) const {return __table_.bucket(__k);}
_LIBCPP_INLINE_VISIBILITY
local_iterator begin(size_type __n) {return __table_.begin(__n);}
_LIBCPP_INLINE_VISIBILITY
local_iterator end(size_type __n) {return __table_.end(__n);}
_LIBCPP_INLINE_VISIBILITY
const_local_iterator begin(size_type __n) const {return __table_.cbegin(__n);}
_LIBCPP_INLINE_VISIBILITY
const_local_iterator end(size_type __n) const {return __table_.cend(__n);}
_LIBCPP_INLINE_VISIBILITY
const_local_iterator cbegin(size_type __n) const {return __table_.cbegin(__n);}
_LIBCPP_INLINE_VISIBILITY
const_local_iterator cend(size_type __n) const {return __table_.cend(__n);}
_LIBCPP_INLINE_VISIBILITY
float load_factor() const {return __table_.load_factor();}
_LIBCPP_INLINE_VISIBILITY
float max_load_factor() const {return __table_.max_load_factor();}
_LIBCPP_INLINE_VISIBILITY
void max_load_factor(float __mlf) {__table_.max_load_factor(__mlf);}
_LIBCPP_INLINE_VISIBILITY
void rehash(size_type __n) {__table_.rehash(__n);}
_LIBCPP_INLINE_VISIBILITY
void reserve(size_type __n) {__table_.reserve(__n);}
};
@ -460,7 +505,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
}
template <class _Value, class _Hash, class _Pred, class _Alloc>
inline
inline _LIBCPP_INLINE_VISIBILITY
unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
const allocator_type& __a)
: __table_(__a)
@ -488,7 +533,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Value, class _Hash, class _Pred, class _Alloc>
inline
inline _LIBCPP_INLINE_VISIBILITY
unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
unordered_set&& __u)
: __table_(_STD::move(__u.__table_))
@ -540,7 +585,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Value, class _Hash, class _Pred, class _Alloc>
inline
inline _LIBCPP_INLINE_VISIBILITY
unordered_set<_Value, _Hash, _Pred, _Alloc>&
unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=(unordered_set&& __u)
{
@ -551,7 +596,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=(unordered_set&& __u)
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Value, class _Hash, class _Pred, class _Alloc>
inline
inline _LIBCPP_INLINE_VISIBILITY
unordered_set<_Value, _Hash, _Pred, _Alloc>&
unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=(
initializer_list<value_type> __il)
@ -562,7 +607,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=(
template <class _Value, class _Hash, class _Pred, class _Alloc>
template <class _InputIterator>
inline
inline _LIBCPP_INLINE_VISIBILITY
void
unordered_set<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
_InputIterator __last)
@ -572,7 +617,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
}
template <class _Value, class _Hash, class _Pred, class _Alloc>
inline
inline _LIBCPP_INLINE_VISIBILITY
void
swap(unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
@ -600,7 +645,7 @@ operator==(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
}
template <class _Value, class _Hash, class _Pred, class _Alloc>
inline
inline _LIBCPP_INLINE_VISIBILITY
bool
operator!=(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y)
@ -610,7 +655,7 @@ operator!=(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x,
template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
class _Alloc = allocator<_Value> >
class unordered_multiset
class _LIBCPP_VISIBLE unordered_multiset
{
public:
// types
@ -638,6 +683,7 @@ public:
typedef typename __table::const_local_iterator local_iterator;
typedef typename __table::const_local_iterator const_local_iterator;
_LIBCPP_INLINE_VISIBILITY
unordered_multiset() {} // = default
explicit unordered_multiset(size_type __n, const hasher& __hf = hasher(),
const key_equal& __eql = key_equal());
@ -674,79 +720,123 @@ public:
#endif
unordered_multiset& operator=(initializer_list<value_type> __il);
_LIBCPP_INLINE_VISIBILITY
allocator_type get_allocator() const
{return allocator_type(__table_.__node_alloc());}
_LIBCPP_INLINE_VISIBILITY
bool empty() const {return __table_.size() == 0;}
_LIBCPP_INLINE_VISIBILITY
size_type size() const {return __table_.size();}
_LIBCPP_INLINE_VISIBILITY
size_type max_size() const {return __table_.max_size();}
_LIBCPP_INLINE_VISIBILITY
iterator begin() {return __table_.begin();}
_LIBCPP_INLINE_VISIBILITY
iterator end() {return __table_.end();}
_LIBCPP_INLINE_VISIBILITY
const_iterator begin() const {return __table_.begin();}
_LIBCPP_INLINE_VISIBILITY
const_iterator end() const {return __table_.end();}
_LIBCPP_INLINE_VISIBILITY
const_iterator cbegin() const {return __table_.begin();}
_LIBCPP_INLINE_VISIBILITY
const_iterator cend() const {return __table_.end();}
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
iterator emplace(_Args&&... __args)
{return __table_.__emplace_multi(_STD::forward<_Args>(__args)...);}
template <class... _Args>
_LIBCPP_INLINE_VISIBILITY
iterator emplace_hint(const_iterator __p, _Args&&... __args)
{return __table_.__emplace_hint_multi(__p, _STD::forward<_Args>(__args)...);}
#endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
_LIBCPP_INLINE_VISIBILITY
iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
iterator insert(value_type&& __x) {return __table_.__insert_multi(_STD::move(__x));}
#endif
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __p, const value_type& __x)
{return __table_.__insert_multi(__p, __x);}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __p, value_type&& __x)
{return __table_.__insert_multi(__p, _STD::move(__x));}
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _InputIterator>
void insert(_InputIterator __first, _InputIterator __last);
_LIBCPP_INLINE_VISIBILITY
void insert(initializer_list<value_type> __il)
{insert(__il.begin(), __il.end());}
_LIBCPP_INLINE_VISIBILITY
iterator erase(const_iterator __p) {return __table_.erase(__p);}
_LIBCPP_INLINE_VISIBILITY
size_type erase(const key_type& __k) {return __table_.__erase_multi(__k);}
_LIBCPP_INLINE_VISIBILITY
iterator erase(const_iterator __first, const_iterator __last)
{return __table_.erase(__first, __last);}
_LIBCPP_INLINE_VISIBILITY
void clear() {__table_.clear();}
_LIBCPP_INLINE_VISIBILITY
void swap(unordered_multiset& __u) {__table_.swap(__u.__table_);}
_LIBCPP_INLINE_VISIBILITY
hasher hash_function() const {return __table_.hash_function();}
_LIBCPP_INLINE_VISIBILITY
key_equal key_eq() const {return __table_.key_eq();}
_LIBCPP_INLINE_VISIBILITY
iterator find(const key_type& __k) {return __table_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
const_iterator find(const key_type& __k) const {return __table_.find(__k);}
_LIBCPP_INLINE_VISIBILITY
size_type count(const key_type& __k) const {return __table_.__count_multi(__k);}
_LIBCPP_INLINE_VISIBILITY
pair<iterator, iterator> equal_range(const key_type& __k)
{return __table_.__equal_range_multi(__k);}
_LIBCPP_INLINE_VISIBILITY
pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
{return __table_.__equal_range_multi(__k);}
_LIBCPP_INLINE_VISIBILITY
size_type bucket_count() const {return __table_.bucket_count();}
_LIBCPP_INLINE_VISIBILITY
size_type max_bucket_count() const {return __table_.max_bucket_count();}
_LIBCPP_INLINE_VISIBILITY
size_type bucket_size(size_type __n) const {return __table_.bucket_size(__n);}
_LIBCPP_INLINE_VISIBILITY
size_type bucket(const key_type& __k) const {return __table_.bucket(__k);}
_LIBCPP_INLINE_VISIBILITY
local_iterator begin(size_type __n) {return __table_.begin(__n);}
_LIBCPP_INLINE_VISIBILITY
local_iterator end(size_type __n) {return __table_.end(__n);}
_LIBCPP_INLINE_VISIBILITY
const_local_iterator begin(size_type __n) const {return __table_.cbegin(__n);}
_LIBCPP_INLINE_VISIBILITY
const_local_iterator end(size_type __n) const {return __table_.cend(__n);}
_LIBCPP_INLINE_VISIBILITY
const_local_iterator cbegin(size_type __n) const {return __table_.cbegin(__n);}
_LIBCPP_INLINE_VISIBILITY
const_local_iterator cend(size_type __n) const {return __table_.cend(__n);}
_LIBCPP_INLINE_VISIBILITY
float load_factor() const {return __table_.load_factor();}
_LIBCPP_INLINE_VISIBILITY
float max_load_factor() const {return __table_.max_load_factor();}
_LIBCPP_INLINE_VISIBILITY
void max_load_factor(float __mlf) {__table_.max_load_factor(__mlf);}
_LIBCPP_INLINE_VISIBILITY
void rehash(size_type __n) {__table_.rehash(__n);}
_LIBCPP_INLINE_VISIBILITY
void reserve(size_type __n) {__table_.reserve(__n);}
};
@ -798,7 +888,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
}
template <class _Value, class _Hash, class _Pred, class _Alloc>
inline
inline _LIBCPP_INLINE_VISIBILITY
unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
const allocator_type& __a)
: __table_(__a)
@ -826,7 +916,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Value, class _Hash, class _Pred, class _Alloc>
inline
inline _LIBCPP_INLINE_VISIBILITY
unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
unordered_multiset&& __u)
: __table_(_STD::move(__u.__table_))
@ -878,7 +968,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Value, class _Hash, class _Pred, class _Alloc>
inline
inline _LIBCPP_INLINE_VISIBILITY
unordered_multiset<_Value, _Hash, _Pred, _Alloc>&
unordered_multiset<_Value, _Hash, _Pred, _Alloc>::operator=(
unordered_multiset&& __u)
@ -901,7 +991,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::operator=(
template <class _Value, class _Hash, class _Pred, class _Alloc>
template <class _InputIterator>
inline
inline _LIBCPP_INLINE_VISIBILITY
void
unordered_multiset<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
_InputIterator __last)
@ -911,7 +1001,7 @@ unordered_multiset<_Value, _Hash, _Pred, _Alloc>::insert(_InputIterator __first,
}
template <class _Value, class _Hash, class _Pred, class _Alloc>
inline
inline _LIBCPP_INLINE_VISIBILITY
void
swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
@ -943,7 +1033,7 @@ operator==(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
}
template <class _Value, class _Hash, class _Pred, class _Alloc>
inline
inline _LIBCPP_INLINE_VISIBILITY
bool
operator!=(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)

View File

@ -186,7 +186,7 @@ move_if_noexcept(_Tp& __x)
return _STD::move(__x);
}
struct piecewise_construct_t { };
struct _LIBCPP_VISIBLE piecewise_construct_t { };
//constexpr
extern const piecewise_construct_t piecewise_construct;// = piecewise_construct_t();
@ -194,7 +194,7 @@ template <class _T1, class _T2> struct pair;
template <class _T1, class _T2> void swap(pair<_T1, _T2>&, pair<_T1, _T2>&);
template <class _T1, class _T2>
struct pair
struct _LIBCPP_VISIBLE pair
{
typedef _T1 first_type;
typedef _T2 second_type;
@ -231,6 +231,7 @@ struct pair
{}
template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
_LIBCPP_INLINE_VISIBILITY
pair(piecewise_construct_t __pc, tuple<_Args1...> __first_args,
tuple<_Args2...> __second_args)
: pair(__pc, __first_args, __second_args,
@ -240,6 +241,7 @@ struct pair
template <class _Tuple,
class = typename enable_if<__tuple_assignable<_Tuple, pair>::value>::type>
_LIBCPP_INLINE_VISIBILITY
pair&
operator=(_Tuple&& __p)
{
@ -349,7 +351,7 @@ struct __make_pair_return
};
template <class _T1, class _T2>
inline
inline _LIBCPP_INLINE_VISIBILITY
pair<typename __make_pair_return<_T1>::type, typename __make_pair_return<_T2>::type>
make_pair(_T1&& __t1, _T2&& __t2)
{
@ -372,34 +374,36 @@ make_pair(_T1 __x, _T2 __y)
#ifndef _LIBCPP_HAS_NO_VARIADICS
template <class _T1, class _T2>
class tuple_size<pair<_T1, _T2> > : public integral_constant<size_t, 2> {};
class _LIBCPP_VISIBLE tuple_size<pair<_T1, _T2> >
: public integral_constant<size_t, 2> {};
template <class _T1, class _T2>
class tuple_size<const pair<_T1, _T2> > : public integral_constant<size_t, 2> {};
class _LIBCPP_VISIBLE tuple_size<const pair<_T1, _T2> >
: public integral_constant<size_t, 2> {};
template <class _T1, class _T2>
class tuple_element<0, pair<_T1, _T2> >
class _LIBCPP_VISIBLE tuple_element<0, pair<_T1, _T2> >
{
public:
typedef _T1 type;
};
template <class _T1, class _T2>
class tuple_element<1, pair<_T1, _T2> >
class _LIBCPP_VISIBLE tuple_element<1, pair<_T1, _T2> >
{
public:
typedef _T2 type;
};
template <class _T1, class _T2>
class tuple_element<0, const pair<_T1, _T2> >
class _LIBCPP_VISIBLE tuple_element<0, const pair<_T1, _T2> >
{
public:
typedef const _T1 type;
};
template <class _T1, class _T2>
class tuple_element<1, const pair<_T1, _T2> >
class _LIBCPP_VISIBLE tuple_element<1, const pair<_T1, _T2> >
{
public:
typedef const _T2 type;

File diff suppressed because it is too large Load Diff

View File

@ -330,18 +330,22 @@ protected:
void __destruct_at_end(const_pointer __new_last, false_type);
void __destruct_at_end(const_pointer __new_last, true_type);
_LIBCPP_INLINE_VISIBILITY
void __copy_assign_alloc(const __vector_base& __c)
{__copy_assign_alloc(__c, integral_constant<bool,
__alloc_traits::propagate_on_container_copy_assignment::value>());}
_LIBCPP_INLINE_VISIBILITY
void __move_assign_alloc(__vector_base& __c)
{__move_assign_alloc(__c, integral_constant<bool,
__alloc_traits::propagate_on_container_move_assignment::value>());}
_LIBCPP_INLINE_VISIBILITY
static void __swap_alloc(allocator_type& __x, allocator_type& __y)
{__swap_alloc(__x, __y, integral_constant<bool,
__alloc_traits::propagate_on_container_swap::value>());}
private:
_LIBCPP_INLINE_VISIBILITY
void __copy_assign_alloc(const __vector_base& __c, true_type)
{
if (__alloc() != __c.__alloc())
@ -353,22 +357,27 @@ private:
__alloc() = __c.__alloc();
}
_LIBCPP_INLINE_VISIBILITY
void __copy_assign_alloc(const __vector_base& __c, false_type)
{}
_LIBCPP_INLINE_VISIBILITY
void __move_assign_alloc(const __vector_base& __c, true_type)
{
__alloc() = _STD::move(__c.__alloc());
}
_LIBCPP_INLINE_VISIBILITY
void __move_assign_alloc(const __vector_base& __c, false_type)
{}
_LIBCPP_INLINE_VISIBILITY
static void __swap_alloc(allocator_type& __x, allocator_type& __y, true_type)
{
using _STD::swap;
swap(__x, __y);
}
_LIBCPP_INLINE_VISIBILITY
static void __swap_alloc(allocator_type& __x, allocator_type& __y, false_type)
{}
};
@ -478,6 +487,7 @@ public:
vector(initializer_list<value_type> __il);
vector(initializer_list<value_type> __il, const allocator_type& __a);
#ifdef _LIBCPP_DEBUG
_LIBCPP_INLINE_VISIBILITY
~vector() {__invalidate_all_iterators();}
#endif
@ -489,6 +499,7 @@ public:
vector(vector&& __x, const allocator_type& __a);
vector& operator=(vector&& __x);
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
vector& operator=(initializer_list<value_type> __il)
{assign(__il.begin(), __il.end()); return *this;}
@ -509,6 +520,7 @@ public:
assign(_ForwardIterator __first, _ForwardIterator __last);
void assign(size_type __n, const_reference __u);
_LIBCPP_INLINE_VISIBILITY
void assign(initializer_list<value_type> __il)
{assign(__il.begin(), __il.end());}
@ -585,6 +597,7 @@ public:
iterator
>::type
insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last);
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __position, initializer_list<value_type> __il)
{return insert(__position, __il.begin(), __il.end());}
@ -1776,6 +1789,7 @@ public:
vector(vector&& __v, const allocator_type& __a);
vector& operator=(vector&& __v);
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
_LIBCPP_INLINE_VISIBILITY
vector& operator=(initializer_list<value_type> __il)
{assign(__il.begin(), __il.end()); return *this;}
@ -1796,6 +1810,7 @@ public:
assign(_ForwardIterator __first, _ForwardIterator __last);
void assign(size_type __n, const value_type& __x);
_LIBCPP_INLINE_VISIBILITY
void assign(initializer_list<value_type> __il)
{assign(__il.begin(), __il.end());}
@ -1855,6 +1870,7 @@ public:
iterator
>::type
insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last);
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __position, initializer_list<value_type> __il)
{return insert(__position, __il.begin(), __il.end());}
@ -1906,9 +1922,11 @@ private:
{return iterator(const_cast<__storage_pointer>(__p.__seg_), __p.__ctz_);}
#endif // _LIBCPP_DEBUG
_LIBCPP_INLINE_VISIBILITY
void __copy_assign_alloc(const vector& __v)
{__copy_assign_alloc(__v, integral_constant<bool,
__storage_traits::propagate_on_container_copy_assignment::value>());}
_LIBCPP_INLINE_VISIBILITY
void __copy_assign_alloc(const vector& __c, true_type)
{
if (__alloc() != __c.__alloc())
@ -1916,31 +1934,38 @@ private:
__alloc() = __c.__alloc();
}
_LIBCPP_INLINE_VISIBILITY
void __copy_assign_alloc(const vector& __c, false_type)
{}
void __move_assign(vector& __c, false_type);
void __move_assign(vector& __c, true_type);
_LIBCPP_INLINE_VISIBILITY
void __move_assign_alloc(vector& __c)
{__move_assign_alloc(__c, integral_constant<bool,
__storage_traits::propagate_on_container_move_assignment::value>());}
_LIBCPP_INLINE_VISIBILITY
void __move_assign_alloc(const vector& __c, true_type)
{
__alloc() = _STD::move(__c.__alloc());
}
_LIBCPP_INLINE_VISIBILITY
void __move_assign_alloc(const vector& __c, false_type)
{}
_LIBCPP_INLINE_VISIBILITY
static void __swap_alloc(__storage_allocator& __x, __storage_allocator& __y)
{__swap_alloc(__x, __y, integral_constant<bool,
__storage_traits::propagate_on_container_swap::value>());}
_LIBCPP_INLINE_VISIBILITY
static void __swap_alloc(__storage_allocator& __x, __storage_allocator& __y, true_type)
{
using _STD::swap;
swap(__x, __y);
}
_LIBCPP_INLINE_VISIBILITY
static void __swap_alloc(__storage_allocator& __x, __storage_allocator& __y, false_type)
{}
@ -1951,7 +1976,7 @@ private:
friend class __bit_iterator<vector, false>;
friend class __bit_iterator<vector, true>;
friend class __bit_array<vector>;
friend struct hash<vector>;
friend struct _LIBCPP_VISIBLE hash<vector>;
};
template <class _Allocator>
@ -2722,9 +2747,10 @@ vector<bool, _Allocator>::__hash_code() const
}
template <class _Allocator>
struct hash<vector<bool, _Allocator> >
struct _LIBCPP_VISIBLE hash<vector<bool, _Allocator> >
: public unary_function<vector<bool, _Allocator>, size_t>
{
_LIBCPP_INLINE_VISIBILITY
size_t operator()(const vector<bool, _Allocator>& __vec) const
{return __vec.__hash_code();}
};