diff --git a/libcxx/include/tuple b/libcxx/include/tuple index 492b2542589d..5ec0f819c15d 100644 --- a/libcxx/include/tuple +++ b/libcxx/include/tuple @@ -122,13 +122,13 @@ _LIBCPP_BEGIN_NAMESPACE_STD // tuple_size template -class tuple_size> +class _LIBCPP_VISIBLE tuple_size> : public integral_constant { }; template -class tuple_size> +class _LIBCPP_VISIBLE tuple_size> : public integral_constant { }; @@ -136,14 +136,14 @@ class tuple_size> // tuple_element template -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 -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 ::value> class __tuple_leaf; template -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(*this);} }; -template void __swallow(_Tp&&...) {} +template +_LIBCPP_INLINE_VISIBILITY +void __swallow(_Tp&&...) {} // __tuple_impl @@ -353,6 +355,7 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...> { template + _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 + _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::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 + _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 tuple +class _LIBCPP_VISIBLE tuple { typedef __tuple_impl::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::type(), typename __make_tuple_types::type(), @@ -438,6 +447,7 @@ public: ) {} template + _LIBCPP_INLINE_VISIBILITY tuple(allocator_arg_t, const _Alloc& __a, const _Tp& ... __t) : base_(allocator_arg_t(), __a, typename __make_tuple_indices::type(), @@ -461,6 +471,7 @@ public: >::value >::type > + _LIBCPP_INLINE_VISIBILITY explicit tuple(_Up&&... __u) : base_(typename __make_tuple_indices::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::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 + _LIBCPP_INLINE_VISIBILITY tuple(allocator_arg_t, const _Alloc&) {} template + _LIBCPP_INLINE_VISIBILITY tuple(allocator_arg_t, const _Alloc&, const tuple&) {} template + _LIBCPP_INLINE_VISIBILITY tuple(array<_U, 0>) {} template + _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 -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 -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 -inline +inline _LIBCPP_INLINE_VISIBILITY tuple<_Tp&...> tie(_Tp&... __t) { @@ -579,10 +601,13 @@ tie(_Tp&... __t) template struct __ignore_t { + _LIBCPP_INLINE_VISIBILITY __ignore_t() {} template + _LIBCPP_INLINE_VISIBILITY __ignore_t(_Tp&&) {} template + _LIBCPP_INLINE_VISIBILITY const __ignore_t& operator=(_Tp&&) const {return *this;} }; @@ -609,7 +634,7 @@ struct __make_tuple_return }; template -inline +inline _LIBCPP_INLINE_VISIBILITY tuple::type...> make_tuple(_Tp&&... __t) { @@ -617,7 +642,7 @@ make_tuple(_Tp&&... __t) } template -inline +inline _LIBCPP_INLINE_VISIBILITY tuple<_Tp&&...> forward_as_tuple(_Tp&&... __t) { @@ -628,6 +653,7 @@ template struct __tuple_equal { template + _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 + _LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp&, const _Up&) { return true; @@ -645,7 +672,7 @@ struct __tuple_equal<0> }; template -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 -inline +inline _LIBCPP_INLINE_VISIBILITY bool operator!=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y) { @@ -664,6 +691,7 @@ template struct __tuple_less { template + _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 + _LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp&, const _Up&) { return false; @@ -682,7 +711,7 @@ struct __tuple_less<0> }; template -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -struct uses_allocator, _Alloc> +struct _LIBCPP_VISIBLE uses_allocator, _Alloc> : true_type {}; template diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits index e754a00d7909..82d1f91b12e5 100644 --- a/libcxx/include/type_traits +++ b/libcxx/include/type_traits @@ -144,23 +144,26 @@ namespace std _LIBCPP_BEGIN_NAMESPACE_STD -template struct conditional {typedef _If type;}; -template struct conditional {typedef _Then type;}; +template + struct _LIBCPP_VISIBLE conditional {typedef _If type;}; +template + struct _LIBCPP_VISIBLE conditional {typedef _Then type;}; -template struct enable_if {}; -template struct enable_if {typedef _Tp type;}; +template struct _LIBCPP_VISIBLE enable_if {}; +template struct _LIBCPP_VISIBLE enable_if {typedef _Tp type;}; struct __two {char _[2];}; // helper class: template -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 false_type; // is_const -template struct is_const : public false_type {}; -template struct is_const<_Tp const> : public true_type {}; +template struct _LIBCPP_VISIBLE is_const : public false_type {}; +template struct _LIBCPP_VISIBLE is_const<_Tp const> : public true_type {}; // is_volatile -template struct is_volatile : public false_type {}; -template struct is_volatile<_Tp volatile> : public true_type {}; +template struct _LIBCPP_VISIBLE is_volatile : public false_type {}; +template struct _LIBCPP_VISIBLE is_volatile<_Tp volatile> : public true_type {}; // remove_const -template struct remove_const {typedef _Tp type;}; -template struct remove_const {typedef _Tp type;}; +template struct _LIBCPP_VISIBLE remove_const {typedef _Tp type;}; +template struct _LIBCPP_VISIBLE remove_const {typedef _Tp type;}; // remove_volatile -template struct remove_volatile {typedef _Tp type;}; -template struct remove_volatile {typedef _Tp type;}; +template struct _LIBCPP_VISIBLE remove_volatile {typedef _Tp type;}; +template struct _LIBCPP_VISIBLE remove_volatile {typedef _Tp type;}; // remove_cv -template struct remove_cv +template struct _LIBCPP_VISIBLE remove_cv {typedef typename remove_volatile::type>::type type;}; // is_void @@ -201,7 +204,8 @@ template struct remove_cv template struct __is_void : public false_type {}; template <> struct __is_void : public true_type {}; -template struct is_void : public __is_void::type> {}; +template struct _LIBCPP_VISIBLE is_void + : public __is_void::type> {}; // is_integral @@ -224,7 +228,8 @@ template <> struct __is_integral : public true_type template <> struct __is_integral : public true_type {}; template <> struct __is_integral : public true_type {}; -template struct is_integral : public __is_integral::type> {}; +template struct _LIBCPP_VISIBLE is_integral + : public __is_integral::type> {}; // is_floating_point @@ -233,35 +238,40 @@ template <> struct __is_floating_point : public true_type template <> struct __is_floating_point : public true_type {}; template <> struct __is_floating_point : public true_type {}; -template struct is_floating_point : public __is_floating_point::type> {}; +template struct _LIBCPP_VISIBLE is_floating_point + : public __is_floating_point::type> {}; // is_array -template struct is_array : public false_type {}; -template struct is_array<_Tp[]> : public true_type {}; -template struct is_array<_Tp[_Np]> : public true_type {}; +template struct _LIBCPP_VISIBLE is_array + : public false_type {}; +template struct _LIBCPP_VISIBLE is_array<_Tp[]> + : public true_type {}; +template struct _LIBCPP_VISIBLE is_array<_Tp[_Np]> + : public true_type {}; // is_pointer template struct __is_pointer : public false_type {}; template struct __is_pointer<_Tp*> : public true_type {}; -template struct is_pointer : public __is_pointer::type> {}; +template struct _LIBCPP_VISIBLE is_pointer + : public __is_pointer::type> {}; // is_reference -template struct is_lvalue_reference : public false_type {}; -template struct is_lvalue_reference<_Tp&> : public true_type {}; +template struct _LIBCPP_VISIBLE is_lvalue_reference : public false_type {}; +template struct _LIBCPP_VISIBLE is_lvalue_reference<_Tp&> : public true_type {}; -template struct is_rvalue_reference : public false_type {}; +template struct _LIBCPP_VISIBLE is_rvalue_reference : public false_type {}; #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -template struct is_rvalue_reference<_Tp&&> : public true_type {}; +template struct _LIBCPP_VISIBLE is_rvalue_reference<_Tp&&> : public true_type {}; #endif -template struct is_reference : public false_type {}; -template struct is_reference<_Tp&> : public true_type {}; +template struct _LIBCPP_VISIBLE is_reference : public false_type {}; +template struct _LIBCPP_VISIBLE is_reference<_Tp&> : public true_type {}; #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -template struct is_reference<_Tp&&> : public true_type {}; +template 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 struct is_reference<_Tp&&> : public true_type {}; #ifdef _LIBCPP_HAS_TYPE_TRAITS -template struct is_union +template struct _LIBCPP_VISIBLE is_union : public integral_constant {}; #else // _LIBCPP_HAS_TYPE_TRAITS template struct __libcpp_union : public false_type {}; -template struct is_union : public __libcpp_union::type> {}; +template struct _LIBCPP_VISIBLE is_union + : public __libcpp_union::type> {}; #endif // _LIBCPP_HAS_TYPE_TRAITS @@ -286,7 +297,7 @@ template struct is_union : public __libcpp_union struct is_class +template struct _LIBCPP_VISIBLE is_class : public integral_constant {}; #else // _LIBCPP_HAS_TYPE_TRAITS @@ -297,7 +308,7 @@ template char __test(int _Tp::*); template __two __test(...); } -template struct is_class +template struct _LIBCPP_VISIBLE is_class : public integral_constant(0)) == 1 && !is_union<_Tp>::value> {}; #endif // _LIBCPP_HAS_TYPE_TRAITS @@ -320,14 +331,15 @@ struct __is_function {}; template struct __is_function<_Tp, true> : public false_type {}; -template struct is_function : public __is_function<_Tp> {}; +template struct _LIBCPP_VISIBLE is_function + : public __is_function<_Tp> {}; // is_member_function_pointer template struct __is_member_function_pointer : public false_type {}; template struct __is_member_function_pointer<_Tp _Up::*> : public is_function<_Tp> {}; -template struct is_member_function_pointer +template struct _LIBCPP_VISIBLE is_member_function_pointer : public __is_member_function_pointer::type> {}; // is_member_pointer @@ -335,12 +347,12 @@ template struct is_member_function_pointer template struct __is_member_pointer : public false_type {}; template struct __is_member_pointer<_Tp _Up::*> : public true_type {}; -template struct is_member_pointer +template struct _LIBCPP_VISIBLE is_member_pointer : public __is_member_pointer::type> {}; // is_member_object_pointer -template struct is_member_object_pointer +template struct _LIBCPP_VISIBLE is_member_object_pointer : public integral_constant::value && !is_member_function_pointer<_Tp>::value> {}; @@ -348,12 +360,12 @@ template struct is_member_object_pointer #ifdef _LIBCPP_HAS_TYPE_TRAITS -template struct is_enum +template struct _LIBCPP_VISIBLE is_enum : public integral_constant {}; #else // _LIBCPP_HAS_TYPE_TRAITS -template struct is_enum +template struct _LIBCPP_VISIBLE is_enum : public integral_constant::value && !is_integral<_Tp>::value && !is_floating_point<_Tp>::value && @@ -369,19 +381,19 @@ template struct is_enum // is_arithmetic -template struct is_arithmetic +template struct _LIBCPP_VISIBLE is_arithmetic : public integral_constant::value || is_floating_point<_Tp>::value> {}; // is_fundamental -template struct is_fundamental +template struct _LIBCPP_VISIBLE is_fundamental : public integral_constant::value || is_arithmetic<_Tp>::value> {}; // is_scalar -template struct is_scalar +template struct _LIBCPP_VISIBLE is_scalar : public integral_constant::value || is_member_pointer<_Tp>::value || is_pointer<_Tp>::value || @@ -389,7 +401,7 @@ template struct is_scalar // is_object -template struct is_object +template struct _LIBCPP_VISIBLE is_object : public integral_constant::value || is_array<_Tp>::value || is_union<_Tp>::value || @@ -397,7 +409,8 @@ template struct is_object // is_compound -template struct is_compound : public integral_constant::value> {}; +template struct _LIBCPP_VISIBLE is_compound + : public integral_constant::value> {}; // add_const @@ -409,7 +422,8 @@ struct __add_const {typedef _Tp type;}; template struct __add_const<_Tp, false> {typedef const _Tp type;}; -template struct add_const {typedef typename __add_const<_Tp>::type type;}; +template 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 struct __add_volatile<_Tp, false> {typedef volatile _Tp type;}; -template struct add_volatile {typedef typename __add_volatile<_Tp>::type type;}; +template struct _LIBCPP_VISIBLE add_volatile + {typedef typename __add_volatile<_Tp>::type type;}; // add_cv -template struct add_cv {typedef typename add_const::type>::type type;}; +template struct _LIBCPP_VISIBLE add_cv + {typedef typename add_const::type>::type type;}; // remove_reference -template struct remove_reference {typedef _Tp type;}; -template struct remove_reference<_Tp&> {typedef _Tp type;}; +template struct _LIBCPP_VISIBLE remove_reference {typedef _Tp type;}; +template struct _LIBCPP_VISIBLE remove_reference<_Tp&> {typedef _Tp type;}; #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -template struct remove_reference<_Tp&&> {typedef _Tp type;}; +template struct _LIBCPP_VISIBLE remove_reference<_Tp&&> {typedef _Tp type;}; #endif // add_lvalue_reference -template struct add_lvalue_reference {typedef _Tp& type;}; -template struct add_lvalue_reference<_Tp&> {typedef _Tp& type;}; // for older compiler -template <> struct add_lvalue_reference {typedef void type;}; -template <> struct add_lvalue_reference {typedef const void type;}; -template <> struct add_lvalue_reference {typedef volatile void type;}; -template <> struct add_lvalue_reference {typedef const volatile void type;}; +template struct _LIBCPP_VISIBLE add_lvalue_reference {typedef _Tp& type;}; +template struct _LIBCPP_VISIBLE add_lvalue_reference<_Tp&> {typedef _Tp& type;}; // for older compiler +template <> struct _LIBCPP_VISIBLE add_lvalue_reference {typedef void type;}; +template <> struct _LIBCPP_VISIBLE add_lvalue_reference {typedef const void type;}; +template <> struct _LIBCPP_VISIBLE add_lvalue_reference {typedef volatile void type;}; +template <> struct _LIBCPP_VISIBLE add_lvalue_reference {typedef const volatile void type;}; #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -template struct add_rvalue_reference {typedef _Tp&& type;}; -template <> struct add_rvalue_reference {typedef void type;}; -template <> struct add_rvalue_reference {typedef const void type;}; -template <> struct add_rvalue_reference {typedef volatile void type;}; -template <> struct add_rvalue_reference {typedef const volatile void type;}; +template struct _LIBCPP_VISIBLE add_rvalue_reference {typedef _Tp&& type;}; +template <> struct _LIBCPP_VISIBLE add_rvalue_reference {typedef void type;}; +template <> struct _LIBCPP_VISIBLE add_rvalue_reference {typedef const void type;}; +template <> struct _LIBCPP_VISIBLE add_rvalue_reference {typedef volatile void type;}; +template <> struct _LIBCPP_VISIBLE add_rvalue_reference {typedef const volatile void type;}; #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES @@ -475,15 +491,16 @@ struct __any // remove_pointer -template struct remove_pointer {typedef _Tp type;}; -template struct remove_pointer<_Tp*> {typedef _Tp type;}; -template struct remove_pointer<_Tp* const> {typedef _Tp type;}; -template struct remove_pointer<_Tp* volatile> {typedef _Tp type;}; -template struct remove_pointer<_Tp* const volatile> {typedef _Tp type;}; +template struct _LIBCPP_VISIBLE remove_pointer {typedef _Tp type;}; +template struct _LIBCPP_VISIBLE remove_pointer<_Tp*> {typedef _Tp type;}; +template struct _LIBCPP_VISIBLE remove_pointer<_Tp* const> {typedef _Tp type;}; +template struct _LIBCPP_VISIBLE remove_pointer<_Tp* volatile> {typedef _Tp type;}; +template struct _LIBCPP_VISIBLE remove_pointer<_Tp* const volatile> {typedef _Tp type;}; // add_pointer -template struct add_pointer {typedef typename remove_reference<_Tp>::type* type;}; +template 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 struct __is_signed<_Tp, false> : public false_type {}; -template struct is_signed : public __is_signed<_Tp> {}; +template struct _LIBCPP_VISIBLE is_signed : public __is_signed<_Tp> {}; // is_unsigned @@ -513,38 +530,52 @@ struct __is_unsigned : public ___is_unsigned<_Tp> {}; template struct __is_unsigned<_Tp, false> : public false_type {}; -template struct is_unsigned : public __is_unsigned<_Tp> {}; +template struct _LIBCPP_VISIBLE is_unsigned : public __is_unsigned<_Tp> {}; // rank -template struct rank : public integral_constant {}; -template struct rank<_Tp[]> : public integral_constant::value + 1> {}; -template struct rank<_Tp[_Np]> : public integral_constant::value + 1> {}; +template struct _LIBCPP_VISIBLE rank + : public integral_constant {}; +template struct _LIBCPP_VISIBLE rank<_Tp[]> + : public integral_constant::value + 1> {}; +template struct _LIBCPP_VISIBLE rank<_Tp[_Np]> + : public integral_constant::value + 1> {}; // extent -template struct extent : public integral_constant {}; -template struct extent<_Tp[], 0> : public integral_constant {}; -template struct extent<_Tp[], _Ip> : public integral_constant::value> {}; -template struct extent<_Tp[_Np], 0> : public integral_constant {}; -template struct extent<_Tp[_Np], _Ip> : public integral_constant::value> {}; +template struct _LIBCPP_VISIBLE extent + : public integral_constant {}; +template struct _LIBCPP_VISIBLE extent<_Tp[], 0> + : public integral_constant {}; +template struct _LIBCPP_VISIBLE extent<_Tp[], _Ip> + : public integral_constant::value> {}; +template struct _LIBCPP_VISIBLE extent<_Tp[_Np], 0> + : public integral_constant {}; +template struct _LIBCPP_VISIBLE extent<_Tp[_Np], _Ip> + : public integral_constant::value> {}; // remove_extent -template struct remove_extent {typedef _Tp type;}; -template struct remove_extent<_Tp[]> {typedef _Tp type;}; -template struct remove_extent<_Tp[_Np]> {typedef _Tp type;}; +template struct _LIBCPP_VISIBLE remove_extent + {typedef _Tp type;}; +template struct _LIBCPP_VISIBLE remove_extent<_Tp[]> + {typedef _Tp type;}; +template struct _LIBCPP_VISIBLE remove_extent<_Tp[_Np]> + {typedef _Tp type;}; // remove_all_extents -template struct remove_all_extents {typedef _Tp type;}; -template struct remove_all_extents<_Tp[]> {typedef typename remove_all_extents<_Tp>::type type;}; -template struct remove_all_extents<_Tp[_Np]> {typedef typename remove_all_extents<_Tp>::type type;}; +template struct _LIBCPP_VISIBLE remove_all_extents + {typedef _Tp type;}; +template struct _LIBCPP_VISIBLE remove_all_extents<_Tp[]> + {typedef typename remove_all_extents<_Tp>::type type;}; +template struct _LIBCPP_VISIBLE remove_all_extents<_Tp[_Np]> + {typedef typename remove_all_extents<_Tp>::type type;}; // is_same -template struct is_same : public false_type {}; -template struct is_same<_Tp, _Tp> : public true_type {}; +template struct _LIBCPP_VISIBLE is_same : public false_type {}; +template struct _LIBCPP_VISIBLE is_same<_Tp, _Tp> : public true_type {}; // is_abstract @@ -559,7 +590,7 @@ struct __libcpp_abstract : public integral_constant struct __libcpp_abstract<_Tp, false> : public false_type {}; -template struct is_abstract : public __libcpp_abstract<_Tp> {}; +template struct _LIBCPP_VISIBLE is_abstract : public __libcpp_abstract<_Tp> {}; // is_convertible @@ -656,7 +687,8 @@ template struct __is_convertible<_T1, _T2, 1, 3> : public template struct __is_convertible<_T1, _T2, 2, 3> : public false_type {}; template struct __is_convertible<_T1, _T2, 3, 3> : public true_type {}; -template struct is_convertible : public __is_convertible<_T1, _T2> +template 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::value> {}; template -struct is_base_of +struct _LIBCPP_VISIBLE is_base_of : public __libcpp_base_of::type, typename remove_cv<_Dp>::type> { }; @@ -729,7 +761,7 @@ struct __libcpp_empty : public integral_constant) template struct __libcpp_empty<_Tp, false> : public false_type {}; -template struct is_empty : public __libcpp_empty<_Tp> {}; +template struct _LIBCPP_VISIBLE is_empty : public __libcpp_empty<_Tp> {}; // is_polymorphic @@ -742,13 +774,14 @@ struct __libcpp_polymorphic template struct __libcpp_polymorphic<_Tp, false> : public false_type {}; -template struct is_polymorphic : public __libcpp_polymorphic<_Tp> {}; +template struct _LIBCPP_VISIBLE is_polymorphic + : public __libcpp_polymorphic<_Tp> {}; // has_trivial_default_constructor #ifdef _LIBCPP_HAS_TYPE_TRAITS -template struct has_trivial_default_constructor +template struct _LIBCPP_VISIBLE has_trivial_default_constructor : public integral_constant {}; #else // _LIBCPP_HAS_TYPE_TRAITS @@ -756,7 +789,7 @@ template struct has_trivial_default_constructor template struct __has_trivial_default_constructor : public integral_constant::value> {}; -template struct has_trivial_default_constructor +template struct _LIBCPP_VISIBLE has_trivial_default_constructor : public __has_trivial_default_constructor::type> {}; #endif // _LIBCPP_HAS_TYPE_TRAITS @@ -765,12 +798,12 @@ template struct has_trivial_default_constructor #ifdef _LIBCPP_HAS_TYPE_TRAITS -template struct has_nothrow_default_constructor +template struct _LIBCPP_VISIBLE has_nothrow_default_constructor : public integral_constant {}; #else // _LIBCPP_HAS_TYPE_TRAITS -template struct has_nothrow_default_constructor +template struct _LIBCPP_VISIBLE has_nothrow_default_constructor : public has_trivial_default_constructor<_Tp> {}; #endif // _LIBCPP_HAS_TYPE_TRAITS @@ -779,12 +812,12 @@ template struct has_nothrow_default_constructor #ifdef _LIBCPP_HAS_TYPE_TRAITS -template struct has_trivial_copy_constructor +template struct _LIBCPP_VISIBLE has_trivial_copy_constructor : public integral_constant {}; #else // _LIBCPP_HAS_TYPE_TRAITS -template struct has_trivial_copy_constructor +template struct _LIBCPP_VISIBLE has_trivial_copy_constructor : public integral_constant::value || is_reference<_Tp>::value> {}; @@ -794,30 +827,31 @@ template struct has_trivial_copy_constructor #ifdef _LIBCPP_HAS_TYPE_TRAITS -template struct has_nothrow_copy_constructor +template struct _LIBCPP_VISIBLE has_nothrow_copy_constructor : public integral_constant {}; #else // _LIBCPP_HAS_TYPE_TRAITS -template struct has_nothrow_copy_constructor +template struct _LIBCPP_VISIBLE has_nothrow_copy_constructor : public has_trivial_copy_constructor<_Tp> {}; #endif // _LIBCPP_HAS_TYPE_TRAITS // has_nothrow_move_constructor -template struct has_nothrow_move_constructor : public has_nothrow_copy_constructor<_Tp> {}; +template struct _LIBCPP_VISIBLE has_nothrow_move_constructor + : public has_nothrow_copy_constructor<_Tp> {}; // has_trivial_copy_assign #ifdef _LIBCPP_HAS_TYPE_TRAITS -template struct has_trivial_copy_assign +template struct _LIBCPP_VISIBLE has_trivial_copy_assign : public integral_constant {}; #else // _LIBCPP_HAS_TYPE_TRAITS -template struct has_trivial_copy_assign +template struct _LIBCPP_VISIBLE has_trivial_copy_assign : public integral_constant::value && !is_const<_Tp>::value> {}; @@ -827,12 +861,12 @@ template struct has_trivial_copy_assign #ifdef _LIBCPP_HAS_TYPE_TRAITS -template struct has_nothrow_copy_assign +template struct _LIBCPP_VISIBLE has_nothrow_copy_assign : public integral_constant {}; #else // _LIBCPP_HAS_TYPE_TRAITS -template struct has_nothrow_copy_assign +template struct _LIBCPP_VISIBLE has_nothrow_copy_assign : public has_trivial_copy_assign<_Tp> {}; #endif // _LIBCPP_HAS_TYPE_TRAITS @@ -841,7 +875,7 @@ template struct has_nothrow_copy_assign #ifdef _LIBCPP_HAS_TYPE_TRAITS -template struct has_trivial_destructor +template struct _LIBCPP_VISIBLE has_trivial_destructor : public integral_constant {}; #else // _LIBCPP_HAS_TYPE_TRAITS @@ -850,7 +884,7 @@ template struct __libcpp_trivial_destructor : public integral_constant::value || is_reference<_Tp>::value> {}; -template struct has_trivial_destructor +template struct _LIBCPP_VISIBLE has_trivial_destructor : public __libcpp_trivial_destructor::type> {}; #endif // _LIBCPP_HAS_TYPE_TRAITS @@ -859,12 +893,13 @@ template struct has_trivial_destructor #ifdef _LIBCPP_HAS_TYPE_TRAITS -template struct has_virtual_destructor +template struct _LIBCPP_VISIBLE has_virtual_destructor : public integral_constant {}; #else // _LIBCPP_HAS_TYPE_TRAITS -template struct has_virtual_destructor : public false_type {}; +template struct _LIBCPP_VISIBLE has_virtual_destructor + : public false_type {}; #endif // _LIBCPP_HAS_TYPE_TRAITS @@ -872,15 +907,16 @@ template struct has_virtual_destructor : public false_type {}; #ifdef _LIBCPP_HAS_TYPE_TRAITS -template struct is_pod +template struct _LIBCPP_VISIBLE is_pod : public integral_constant {}; #else // _LIBCPP_HAS_TYPE_TRAITS -template struct is_pod : public integral_constant::value && - has_trivial_copy_constructor<_Tp>::value && - has_trivial_copy_assign<_Tp>::value && - has_trivial_destructor<_Tp>::value> {}; +template struct _LIBCPP_VISIBLE is_pod + : public integral_constant::value && + has_trivial_copy_constructor<_Tp>::value && + has_trivial_copy_assign<_Tp>::value && + has_trivial_destructor<_Tp>::value> {}; #endif // _LIBCPP_HAS_TYPE_TRAITS @@ -888,7 +924,7 @@ template struct is_pod : public integral_constant struct __alignment_of {_Tp _;}; -template struct alignment_of +template struct _LIBCPP_VISIBLE alignment_of : public integral_constant::type>)> {}; // aligned_storage @@ -968,7 +1004,7 @@ struct __find_max_align<__type_list<_Hp, _Tp>, _Len> : public integral_constant::value>::value> {}; template ::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 \ -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 {typedef long long type;}; template -struct make_signed +struct _LIBCPP_VISIBLE make_signed { typedef typename __apply_cv<_Tp, typename __make_signed::type>::type>::type type; }; @@ -1186,7 +1222,7 @@ template <> struct __make_unsigned< signed long long, true> {typedef unsigned l template <> struct __make_unsigned {typedef unsigned long long type;}; template -struct make_unsigned +struct _LIBCPP_VISIBLE make_unsigned { typedef typename __apply_cv<_Tp, typename __make_unsigned::type>::type>::type type; }; @@ -1194,21 +1230,21 @@ struct make_unsigned #ifdef _LIBCPP_HAS_NO_VARIADICS template -struct common_type +struct _LIBCPP_VISIBLE common_type { public: typedef typename common_type::type, V>::type type; }; template -struct common_type<_Tp, void, void> +struct _LIBCPP_VISIBLE common_type<_Tp, void, void> { public: typedef _Tp type; }; template -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 struct common_type; template -struct common_type<_Tp> +struct _LIBCPP_VISIBLE common_type<_Tp> { typedef _Tp type; }; template -struct common_type<_Tp, _Up> +struct _LIBCPP_VISIBLE common_type<_Tp, _Up> { private: static _Tp&& __t(); @@ -1245,7 +1281,7 @@ public: }; template -struct common_type<_Tp, _Up, _Vp...> +struct _LIBCPP_VISIBLE common_type<_Tp, _Up, _Vp...> { typedef typename common_type::type, _Vp...>::type type; }; @@ -1281,13 +1317,13 @@ struct __is_assignable // has_copy_assign -template struct has_copy_assign +template struct _LIBCPP_VISIBLE has_copy_assign : public __is_assignable<_Tp&, const _Tp&> {}; -template struct has_copy_assign<_Tp[]> +template struct _LIBCPP_VISIBLE has_copy_assign<_Tp[]> : public false_type {}; -template struct has_copy_assign<_Tp&> +template 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 -inline +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < !is_convertible<_Tp, __rv<_Tp> >::value, @@ -1395,7 +1433,7 @@ move(_Tp& __t) } template -inline +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < is_convertible<_Tp, __rv<_Tp> >::value, @@ -1407,7 +1445,7 @@ move(_Tp& __t) } template -inline +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < !is_convertible<_Tp, __rv<_Tp> >::value, @@ -1419,7 +1457,7 @@ forward(_Up& __t) } template -inline +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < !is_convertible<_Tp, __rv<_Tp> >::value, @@ -1431,7 +1469,7 @@ forward(const _Up& __t) } template -inline +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < is_convertible<_Tp, __rv<_Tp> >::value, @@ -1443,7 +1481,7 @@ forward(_Up& __t) } template -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 -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 result_of<_Fn(_ArgTypes...)> +class _LIBCPP_VISIBLE result_of<_Fn(_ArgTypes...)> : public __result_of<_Fn(_ArgTypes...), is_class::type>::value || is_function -class result_of<_Fn()> +class _LIBCPP_VISIBLE result_of<_Fn()> : public __result_of<_Fn(), is_class::type>::value || is_function }; template -class result_of<_Fn(_A0)> +class _LIBCPP_VISIBLE result_of<_Fn(_A0)> : public __result_of<_Fn(_A0), is_class::type>::value || is_function }; template -class result_of<_Fn(_A0, _A1)> +class _LIBCPP_VISIBLE result_of<_Fn(_A0, _A1)> : public __result_of<_Fn(_A0, _A1), is_class::type>::value || is_function }; template -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::type>::value || is_function // is_constructible entry point template -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 {}; template -struct has_default_constructor +struct _LIBCPP_VISIBLE has_default_constructor : public is_constructible<_Tp> {}; @@ -1823,7 +1861,7 @@ struct __is_constructible0_void_check // has_default_constructor entry point template -struct has_default_constructor +struct _LIBCPP_VISIBLE has_default_constructor : public __is_constructible0_void_check::value || is_abstract<_Tp>::value, _Tp> @@ -1851,14 +1889,14 @@ struct __is_constructible0_imp #ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE template -struct has_copy_constructor +struct _LIBCPP_VISIBLE has_copy_constructor : public is_constructible<_Tp, typename add_lvalue_reference::type> {}; #else // _LIBCPP_HAS_NO_ADVANCED_SFINAE template -struct has_copy_constructor +struct _LIBCPP_VISIBLE has_copy_constructor : public has_nothrow_copy_constructor<_Tp> {}; diff --git a/libcxx/include/typeindex b/libcxx/include/typeindex index cd7e13ed1160..2746f863f99f 100644 --- a/libcxx/include/typeindex +++ b/libcxx/include/typeindex @@ -53,29 +53,39 @@ struct hash _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 struct hash; +template struct _LIBCPP_VISIBLE hash; template <> -struct hash +struct _LIBCPP_VISIBLE hash : public unary_function { + _LIBCPP_INLINE_VISIBILITY size_t operator()(type_index __index) const {return __index.hash_code();} }; diff --git a/libcxx/include/typeinfo b/libcxx/include/typeinfo index f1334ca2ad62..6ad9d0cc36d6 100644 --- a/libcxx/include/typeinfo +++ b/libcxx/include/typeinfo @@ -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(&__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);} diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map index 2dd61a5067e9..3571bfd055e3 100644 --- a/libcxx/include/unordered_map +++ b/libcxx/include/unordered_map @@ -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(*this)(__x.first);} + _LIBCPP_INLINE_VISIBILITY size_t operator()(const typename _Tp::first_type& __x) const {return static_cast(*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(*this)(__x.first, __y.first);} + _LIBCPP_INLINE_VISIBILITY bool operator()(const typename _Tp::first_type& __x, const _Tp& __y) const {return static_cast(*this)(__x, __y.first);} + _LIBCPP_INLINE_VISIBILITY bool operator()(const _Tp& __x, const typename _Tp::first_type& __y) const {return static_cast(*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(*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&& __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& __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 __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 friend class unordered_map; - template friend class unordered_multimap; - template friend class __hash_const_iterator; - template friend class __hash_const_local_iterator; - template friend class __hash_map_const_iterator; + template friend class _LIBCPP_VISIBLE unordered_map; + template friend class _LIBCPP_VISIBLE unordered_multimap; + template friend class _LIBCPP_VISIBLE __hash_const_iterator; + template friend class _LIBCPP_VISIBLE __hash_const_local_iterator; + template friend class _LIBCPP_VISIBLE __hash_map_const_iterator; }; template -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 __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 friend class unordered_map; - template friend class unordered_multimap; - template friend class __hash_const_iterator; - template friend class __hash_const_local_iterator; + template friend class _LIBCPP_VISIBLE unordered_map; + template friend class _LIBCPP_VISIBLE unordered_multimap; + template friend class _LIBCPP_VISIBLE __hash_const_iterator; + template friend class _LIBCPP_VISIBLE __hash_const_local_iterator; }; template , class _Pred = equal_to<_Key>, class _Alloc = allocator > > -class unordered_map +class _LIBCPP_VISIBLE unordered_map { public: // types @@ -553,6 +598,7 @@ public: typedef __hash_map_iterator local_iterator; typedef __hash_map_const_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 __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 emplace() {return __table_.__emplace_unique();} template ::value>::type> + _LIBCPP_INLINE_VISIBILITY pair 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 ::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 ::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 insert(const value_type& __x) {return __table_.__insert_unique(__x);} #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template ::value>::type> + _LIBCPP_INLINE_VISIBILITY pair 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 ::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 void insert(_InputIterator __first, _InputIterator __last); + _LIBCPP_INLINE_VISIBILITY void insert(initializer_list __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 equal_range(const key_type& __k) {return __table_.__equal_range_unique(__k);} + _LIBCPP_INLINE_VISIBILITY pair 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 -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 -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 -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 -inline +inline _LIBCPP_INLINE_VISIBILITY unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=( initializer_list __il) @@ -950,7 +1043,7 @@ unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node(const key_type& template template -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 -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 -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 _Pred = equal_to<_Key>, class _Alloc = allocator > > -class unordered_multimap +class _LIBCPP_VISIBLE unordered_multimap { public: // types @@ -1099,6 +1192,7 @@ public: typedef __hash_map_iterator local_iterator; typedef __hash_map_const_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 __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 ::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 ::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 ::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 ::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 void insert(_InputIterator __first, _InputIterator __last); + _LIBCPP_INLINE_VISIBILITY void insert(initializer_list __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 equal_range(const key_type& __k) {return __table_.__equal_range_multi(__k);} + _LIBCPP_INLINE_VISIBILITY pair 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 -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 -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 -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 -inline +inline _LIBCPP_INLINE_VISIBILITY unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::operator=( initializer_list __il) @@ -1483,7 +1623,7 @@ unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::emplace_hint( template template -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 -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 -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) diff --git a/libcxx/include/unordered_set b/libcxx/include/unordered_set index d677e8b73f1e..419674c51fa7 100644 --- a/libcxx/include/unordered_set +++ b/libcxx/include/unordered_set @@ -271,7 +271,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template , 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 __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 + _LIBCPP_INLINE_VISIBILITY pair emplace(_Args&&... __args) {return __table_.__emplace_unique(_STD::forward<_Args>(__args)...);} template + _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 insert(const value_type& __x) {return __table_.__insert_unique(__x);} #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + _LIBCPP_INLINE_VISIBILITY pair 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 void insert(_InputIterator __first, _InputIterator __last); + _LIBCPP_INLINE_VISIBILITY void insert(initializer_list __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 equal_range(const key_type& __k) {return __table_.__equal_range_unique(__k);} + _LIBCPP_INLINE_VISIBILITY pair 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 -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 -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 -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 -inline +inline _LIBCPP_INLINE_VISIBILITY unordered_set<_Value, _Hash, _Pred, _Alloc>& unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=( initializer_list __il) @@ -562,7 +607,7 @@ unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=( template template -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 -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 -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 _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 __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 + _LIBCPP_INLINE_VISIBILITY iterator emplace(_Args&&... __args) {return __table_.__emplace_multi(_STD::forward<_Args>(__args)...);} template + _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 void insert(_InputIterator __first, _InputIterator __last); + _LIBCPP_INLINE_VISIBILITY void insert(initializer_list __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 equal_range(const key_type& __k) {return __table_.__equal_range_multi(__k);} + _LIBCPP_INLINE_VISIBILITY pair 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 -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 -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 -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 template -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 -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 -inline +inline _LIBCPP_INLINE_VISIBILITY bool operator!=(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x, const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y) diff --git a/libcxx/include/utility b/libcxx/include/utility index ccf20a773b0f..1c1e4a3912b4 100644 --- a/libcxx/include/utility +++ b/libcxx/include/utility @@ -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 struct pair; template void swap(pair<_T1, _T2>&, pair<_T1, _T2>&); template -struct pair +struct _LIBCPP_VISIBLE pair { typedef _T1 first_type; typedef _T2 second_type; @@ -231,6 +231,7 @@ struct pair {} template + _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 ::value>::type> + _LIBCPP_INLINE_VISIBILITY pair& operator=(_Tuple&& __p) { @@ -349,7 +351,7 @@ struct __make_pair_return }; template -inline +inline _LIBCPP_INLINE_VISIBILITY pair::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 tuple_size > : public integral_constant {}; + class _LIBCPP_VISIBLE tuple_size > + : public integral_constant {}; template - class tuple_size > : public integral_constant {}; + class _LIBCPP_VISIBLE tuple_size > + : public integral_constant {}; template -class tuple_element<0, pair<_T1, _T2> > +class _LIBCPP_VISIBLE tuple_element<0, pair<_T1, _T2> > { public: typedef _T1 type; }; template -class tuple_element<1, pair<_T1, _T2> > +class _LIBCPP_VISIBLE tuple_element<1, pair<_T1, _T2> > { public: typedef _T2 type; }; template -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 tuple_element<1, const pair<_T1, _T2> > +class _LIBCPP_VISIBLE tuple_element<1, const pair<_T1, _T2> > { public: typedef const _T2 type; diff --git a/libcxx/include/valarray b/libcxx/include/valarray index 2cac7331e349..9eceac27b558 100644 --- a/libcxx/include/valarray +++ b/libcxx/include/valarray @@ -352,29 +352,29 @@ _LIBCPP_BEGIN_NAMESPACE_STD template class valarray; -class slice +class _LIBCPP_VISIBLE slice { size_t __start_; size_t __size_; size_t __stride_; public: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY slice() : __start_(0), __size_(0), __stride_(0) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY slice(size_t __start, size_t __size, size_t __stride) : __start_(__start), __size_(__size), __stride_(__stride) {} - _LIBCPP_ALWAYS_INLINE size_t start() const {return __start_;} - _LIBCPP_ALWAYS_INLINE size_t size() const {return __size_;} - _LIBCPP_ALWAYS_INLINE size_t stride() const {return __stride_;} + _LIBCPP_INLINE_VISIBILITY size_t start() const {return __start_;} + _LIBCPP_INLINE_VISIBILITY size_t size() const {return __size_;} + _LIBCPP_INLINE_VISIBILITY size_t stride() const {return __stride_;} }; template class slice_array; @@ -408,13 +408,13 @@ struct _UnaryOp _Op __op_; _A0 __a0_; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _UnaryOp(const _Op& __op, const _A0& __a0) : __op_(__op), __a0_(__a0) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY result_type operator[](size_t __i) const {return __op_(__a0_[__i]);} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY size_t size() const {return __a0_.size();} }; @@ -428,14 +428,14 @@ struct _BinaryOp _A0 __a0_; _A1 __a1_; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _BinaryOp(const _Op& __op, const _A0& __a0, const _A1& __a1) : __op_(__op), __a0_(__a0), __a1_(__a1) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY value_type operator[](size_t __i) const {return __op_(__a0_[__i], __a1_[__i]);} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY size_t size() const {return __a0_.size();} }; @@ -449,20 +449,20 @@ private: const value_type& __t_; size_t __s_; public: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit __scalar_expr(const value_type& __t, size_t __s) : __t_(__t), __s_(__s) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY result_type operator[](size_t) const {return __t_;} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY size_t size() const {return __s_;} }; template struct __unary_plus : unary_function<_Tp, _Tp> { - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x) const {return +__x;} }; @@ -470,7 +470,7 @@ struct __unary_plus : unary_function<_Tp, _Tp> template struct __bit_not : unary_function<_Tp, _Tp> { - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x) const {return ~__x;} }; @@ -478,7 +478,7 @@ struct __bit_not : unary_function<_Tp, _Tp> template struct __bit_shift_left : binary_function<_Tp, _Tp, _Tp> { - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const {return __x << __y;} }; @@ -486,7 +486,7 @@ struct __bit_shift_left : binary_function<_Tp, _Tp, _Tp> template struct __bit_shift_right : binary_function<_Tp, _Tp, _Tp> { - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const {return __x >> __y;} }; @@ -497,10 +497,10 @@ struct __apply_expr : unary_function<_Tp, _Tp> private: _F __f_; public: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit __apply_expr(_F __f) : __f_(__f) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x) const {return __f_(__x);} }; @@ -508,7 +508,7 @@ public: template struct __abs_expr : unary_function<_Tp, _Tp> { - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x) const {return abs(__x);} }; @@ -516,7 +516,7 @@ struct __abs_expr : unary_function<_Tp, _Tp> template struct __acos_expr : unary_function<_Tp, _Tp> { - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x) const {return acos(__x);} }; @@ -524,7 +524,7 @@ struct __acos_expr : unary_function<_Tp, _Tp> template struct __asin_expr : unary_function<_Tp, _Tp> { - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x) const {return asin(__x);} }; @@ -532,7 +532,7 @@ struct __asin_expr : unary_function<_Tp, _Tp> template struct __atan_expr : unary_function<_Tp, _Tp> { - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x) const {return atan(__x);} }; @@ -540,7 +540,7 @@ struct __atan_expr : unary_function<_Tp, _Tp> template struct __atan2_expr : binary_function<_Tp, _Tp, _Tp> { - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const {return atan2(__x, __y);} }; @@ -548,7 +548,7 @@ struct __atan2_expr : binary_function<_Tp, _Tp, _Tp> template struct __cos_expr : unary_function<_Tp, _Tp> { - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x) const {return cos(__x);} }; @@ -556,7 +556,7 @@ struct __cos_expr : unary_function<_Tp, _Tp> template struct __cosh_expr : unary_function<_Tp, _Tp> { - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x) const {return cosh(__x);} }; @@ -564,7 +564,7 @@ struct __cosh_expr : unary_function<_Tp, _Tp> template struct __exp_expr : unary_function<_Tp, _Tp> { - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x) const {return exp(__x);} }; @@ -572,7 +572,7 @@ struct __exp_expr : unary_function<_Tp, _Tp> template struct __log_expr : unary_function<_Tp, _Tp> { - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x) const {return log(__x);} }; @@ -580,7 +580,7 @@ struct __log_expr : unary_function<_Tp, _Tp> template struct __log10_expr : unary_function<_Tp, _Tp> { - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x) const {return log10(__x);} }; @@ -588,7 +588,7 @@ struct __log10_expr : unary_function<_Tp, _Tp> template struct __pow_expr : binary_function<_Tp, _Tp, _Tp> { - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x, const _Tp& __y) const {return pow(__x, __y);} }; @@ -596,7 +596,7 @@ struct __pow_expr : binary_function<_Tp, _Tp, _Tp> template struct __sin_expr : unary_function<_Tp, _Tp> { - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x) const {return sin(__x);} }; @@ -604,7 +604,7 @@ struct __sin_expr : unary_function<_Tp, _Tp> template struct __sinh_expr : unary_function<_Tp, _Tp> { - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x) const {return sinh(__x);} }; @@ -612,7 +612,7 @@ struct __sinh_expr : unary_function<_Tp, _Tp> template struct __sqrt_expr : unary_function<_Tp, _Tp> { - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x) const {return sqrt(__x);} }; @@ -620,7 +620,7 @@ struct __sqrt_expr : unary_function<_Tp, _Tp> template struct __tan_expr : unary_function<_Tp, _Tp> { - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x) const {return tan(__x);} }; @@ -628,7 +628,7 @@ struct __tan_expr : unary_function<_Tp, _Tp> template struct __tanh_expr : unary_function<_Tp, _Tp> { - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _Tp operator()(const _Tp& __x) const {return tanh(__x);} }; @@ -647,7 +647,7 @@ private: size_t __size_; size_t __stride_; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY __slice_expr(const slice& __sl, const _RmExpr& __e) : __expr_(__e), __start_(__sl.start()), @@ -656,14 +656,14 @@ private: {} public: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY result_type operator[](size_t __i) const {return __expr_[__start_ + __i * __stride_];} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY size_t size() const {return __size_;} - template friend class valarray; + template friend class _LIBCPP_VISIBLE valarray; }; template @@ -689,7 +689,7 @@ private: static const ptrdiff_t _N = static_cast( sizeof(ptrdiff_t) * __CHAR_BIT__ - 1); - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY __shift_expr(int __n, const _RmExpr& __e) : __expr_(__e), __size_(__e.size()), @@ -701,7 +701,7 @@ private: } public: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY result_type operator[](size_t __j) const { ptrdiff_t __i = static_cast(__j); @@ -709,7 +709,7 @@ public: return (__expr_[(__i + __n_) & __m] & __m) | (value_type() & ~__m); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY size_t size() const {return __size_;} template friend class __val_expr; @@ -730,7 +730,7 @@ private: size_t __o1_; size_t __o2_; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY __cshift_expr(int __n, const _RmExpr& __e) : __expr_(__e), __size_(__e.size()) @@ -751,7 +751,7 @@ private: } public: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY result_type operator[](size_t __i) const { if (__i < __m_) @@ -759,7 +759,7 @@ public: return __expr_[__i + __o2_]; } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY size_t size() const {return __size_;} template friend class __val_expr; @@ -778,7 +778,7 @@ template struct __is_val_expr > : true_type {}; template -class valarray +class _LIBCPP_VISIBLE valarray { public: typedef _Tp value_type; @@ -790,6 +790,7 @@ private: public: // construct/destroy: + _LIBCPP_INLINE_VISIBILITY valarray() : __begin_(0), __end_(0) {} explicit valarray(size_t __n); valarray(const value_type& __x, size_t __n); @@ -818,10 +819,10 @@ public: valarray& operator=(const indirect_array& __ia); // element access: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY const value_type& operator[](size_t __i) const {return __begin_[__i];} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY value_type& operator[](size_t __i) {return __begin_[__i];} // subset operations: @@ -947,7 +948,7 @@ public: // member functions: void swap(valarray& __v); - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY size_t size() const {return __end_ - __begin_;} value_type sum() const; @@ -961,12 +962,12 @@ public: void resize(size_t __n, value_type __x = value_type()); private: - template friend class valarray; - template friend class slice_array; - template friend class gslice_array; - template friend class mask_array; + template friend class _LIBCPP_VISIBLE valarray; + template friend class _LIBCPP_VISIBLE slice_array; + template friend class _LIBCPP_VISIBLE gslice_array; + template friend class _LIBCPP_VISIBLE mask_array; template friend class __mask_expr; - template friend class indirect_array; + template friend class _LIBCPP_VISIBLE indirect_array; template friend class __indirect_expr; template friend class __val_expr; @@ -1000,13 +1001,13 @@ struct _UnaryOp<_Op, valarray<_Tp> > _Op __op_; const valarray<_Tp>& __a0_; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _UnaryOp(const _Op& __op, const valarray<_Tp>& __a0) : __op_(__op), __a0_(__a0) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY result_type operator[](size_t __i) const {return __op_(__a0_[__i]);} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY size_t size() const {return __a0_.size();} }; @@ -1020,14 +1021,14 @@ struct _BinaryOp<_Op, valarray<_Tp>, _A1> const valarray<_Tp>& __a0_; _A1 __a1_; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _BinaryOp(const _Op& __op, const valarray<_Tp>& __a0, const _A1& __a1) : __op_(__op), __a0_(__a0), __a1_(__a1) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY value_type operator[](size_t __i) const {return __op_(__a0_[__i], __a1_[__i]);} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY size_t size() const {return __a0_.size();} }; @@ -1041,14 +1042,14 @@ struct _BinaryOp<_Op, _A0, valarray<_Tp> > _A0 __a0_; const valarray<_Tp>& __a1_; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _BinaryOp(const _Op& __op, const _A0& __a0, const valarray<_Tp>& __a1) : __op_(__op), __a0_(__a0), __a1_(__a1) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY value_type operator[](size_t __i) const {return __op_(__a0_[__i], __a1_[__i]);} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY size_t size() const {return __a0_.size();} }; @@ -1062,21 +1063,21 @@ struct _BinaryOp<_Op, valarray<_Tp>, valarray<_Tp> > const valarray<_Tp>& __a0_; const valarray<_Tp>& __a1_; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY _BinaryOp(const _Op& __op, const valarray<_Tp>& __a0, const valarray<_Tp>& __a1) : __op_(__op), __a0_(__a0), __a1_(__a1) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY value_type operator[](size_t __i) const {return __op_(__a0_[__i], __a1_[__i]);} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY size_t size() const {return __a0_.size();} }; // slice_array template -class slice_array +class _LIBCPP_VISIBLE slice_array { public: typedef _Tp value_type; @@ -1180,6 +1181,7 @@ public: void operator=(const value_type& __x) const; private: + _LIBCPP_INLINE_VISIBILITY slice_array(const slice& __sl, const valarray& __v) : __vp_(const_cast(__v.__begin_ + __sl.start())), __size_(__sl.size()), @@ -1191,7 +1193,7 @@ private: }; template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY const slice_array<_Tp>& slice_array<_Tp>::operator=(const slice_array& __sa) const { @@ -1203,7 +1205,7 @@ slice_array<_Tp>::operator=(const slice_array& __sa) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -1218,7 +1220,7 @@ slice_array<_Tp>::operator=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -1233,7 +1235,7 @@ slice_array<_Tp>::operator*=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -1248,7 +1250,7 @@ slice_array<_Tp>::operator/=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -1263,7 +1265,7 @@ slice_array<_Tp>::operator%=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -1278,7 +1280,7 @@ slice_array<_Tp>::operator+=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -1293,7 +1295,7 @@ slice_array<_Tp>::operator-=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -1308,7 +1310,7 @@ slice_array<_Tp>::operator^=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -1323,7 +1325,7 @@ slice_array<_Tp>::operator&=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -1338,7 +1340,7 @@ slice_array<_Tp>::operator|=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -1353,7 +1355,7 @@ slice_array<_Tp>::operator<<=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -1367,7 +1369,7 @@ slice_array<_Tp>::operator>>=(const _Expr& __v) const } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY void slice_array<_Tp>::operator=(const value_type& __x) const { @@ -1378,17 +1380,17 @@ slice_array<_Tp>::operator=(const value_type& __x) const // gslice -class gslice +class _LIBCPP_VISIBLE gslice { valarray __size_; valarray __stride_; valarray __1d_; public: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY gslice() {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY gslice(size_t __start, const valarray& __size, const valarray& __stride) : __size_(__size), @@ -1397,21 +1399,21 @@ public: #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY gslice(size_t __start, const valarray& __size, valarray&& __stride) : __size_(__size), __stride_(move(__stride)) {__init(__start);} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY gslice(size_t __start, valarray&& __size, const valarray& __stride) : __size_(move(__size)), __stride_(__stride) {__init(__start);} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY gslice(size_t __start, valarray&& __size, valarray&& __stride) : __size_(move(__size)), @@ -1425,13 +1427,13 @@ public: // gslice& operator=(const gslice&) = default; // gslice& operator=(gslice&&) = default; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY size_t start() const {return __1d_.size() ? __1d_[0] : 0;} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY valarray size() const {return __size_;} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY valarray stride() const {return __stride_;} private: @@ -1445,7 +1447,7 @@ private: // gslice_array template -class gslice_array +class _LIBCPP_VISIBLE gslice_array { public: typedef _Tp value_type; @@ -1553,7 +1555,7 @@ public: // gslice_array& operator=(gslice_array&&) = default; private: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY gslice_array(const gslice& __gs, const valarray& __v) : __vp_(const_cast(__v.__begin_)), __1d_(__gs.__1d_) @@ -1561,7 +1563,7 @@ private: #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY gslice_array(gslice&& __gs, const valarray& __v) : __vp_(const_cast(__v.__begin_)), __1d_(move(__gs.__1d_)) @@ -1574,7 +1576,7 @@ private: template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -1590,7 +1592,7 @@ gslice_array<_Tp>::operator=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -1606,7 +1608,7 @@ gslice_array<_Tp>::operator*=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -1622,7 +1624,7 @@ gslice_array<_Tp>::operator/=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -1638,7 +1640,7 @@ gslice_array<_Tp>::operator%=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -1654,7 +1656,7 @@ gslice_array<_Tp>::operator+=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -1670,7 +1672,7 @@ gslice_array<_Tp>::operator-=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -1686,7 +1688,7 @@ gslice_array<_Tp>::operator^=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -1702,7 +1704,7 @@ gslice_array<_Tp>::operator&=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -1718,7 +1720,7 @@ gslice_array<_Tp>::operator|=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -1734,7 +1736,7 @@ gslice_array<_Tp>::operator<<=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -1749,7 +1751,7 @@ gslice_array<_Tp>::operator>>=(const _Expr& __v) const } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY const gslice_array<_Tp>& gslice_array<_Tp>::operator=(const gslice_array& __ga) const { @@ -1762,7 +1764,7 @@ gslice_array<_Tp>::operator=(const gslice_array& __ga) const } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY void gslice_array<_Tp>::operator=(const value_type& __x) const { @@ -1774,7 +1776,7 @@ gslice_array<_Tp>::operator=(const value_type& __x) const // mask_array template -class mask_array +class _LIBCPP_VISIBLE mask_array { public: typedef _Tp value_type; @@ -1882,7 +1884,7 @@ public: // mask_array& operator=(mask_array&&) = default; private: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY mask_array(const valarray& __vb, const valarray& __v) : __vp_(const_cast(__v.__begin_)), __1d_(count(__vb.__begin_, __vb.__end_, true)) @@ -1898,7 +1900,7 @@ private: template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -1913,7 +1915,7 @@ mask_array<_Tp>::operator=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -1928,7 +1930,7 @@ mask_array<_Tp>::operator*=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -1943,7 +1945,7 @@ mask_array<_Tp>::operator/=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -1958,7 +1960,7 @@ mask_array<_Tp>::operator%=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -1973,7 +1975,7 @@ mask_array<_Tp>::operator+=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -1988,7 +1990,7 @@ mask_array<_Tp>::operator-=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -2003,7 +2005,7 @@ mask_array<_Tp>::operator^=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -2018,7 +2020,7 @@ mask_array<_Tp>::operator&=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -2033,7 +2035,7 @@ mask_array<_Tp>::operator|=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -2048,7 +2050,7 @@ mask_array<_Tp>::operator<<=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -2062,7 +2064,7 @@ mask_array<_Tp>::operator>>=(const _Expr& __v) const } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY const mask_array<_Tp>& mask_array<_Tp>::operator=(const mask_array& __ma) const { @@ -2072,7 +2074,7 @@ mask_array<_Tp>::operator=(const mask_array& __ma) const } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY void mask_array<_Tp>::operator=(const value_type& __x) const { @@ -2093,7 +2095,7 @@ private: _ValExpr __expr_; valarray __1d_; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY __mask_expr(const valarray& __vb, const _RmExpr& __e) : __expr_(__e), __1d_(count(__vb.__begin_, __vb.__end_, true)) @@ -2105,11 +2107,11 @@ private: } public: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY result_type operator[](size_t __i) const {return __expr_[__1d_[__i]];} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY size_t size() const {return __1d_.size();} template friend class valarray; @@ -2118,7 +2120,7 @@ public: // indirect_array template -class indirect_array +class _LIBCPP_VISIBLE indirect_array { public: typedef _Tp value_type; @@ -2226,7 +2228,7 @@ public: // indirect_array& operator=(indirect_array&&) = default; private: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY indirect_array(const valarray& __ia, const valarray& __v) : __vp_(const_cast(__v.__begin_)), __1d_(__ia) @@ -2234,7 +2236,7 @@ private: #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY indirect_array(valarray&& __ia, const valarray& __v) : __vp_(const_cast(__v.__begin_)), __1d_(move(__ia)) @@ -2247,7 +2249,7 @@ private: template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -2262,7 +2264,7 @@ indirect_array<_Tp>::operator=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -2277,7 +2279,7 @@ indirect_array<_Tp>::operator*=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -2292,7 +2294,7 @@ indirect_array<_Tp>::operator/=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -2307,7 +2309,7 @@ indirect_array<_Tp>::operator%=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -2322,7 +2324,7 @@ indirect_array<_Tp>::operator+=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -2337,7 +2339,7 @@ indirect_array<_Tp>::operator-=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -2352,7 +2354,7 @@ indirect_array<_Tp>::operator^=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -2367,7 +2369,7 @@ indirect_array<_Tp>::operator&=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -2382,7 +2384,7 @@ indirect_array<_Tp>::operator|=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -2397,7 +2399,7 @@ indirect_array<_Tp>::operator<<=(const _Expr& __v) const template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -2411,7 +2413,7 @@ indirect_array<_Tp>::operator>>=(const _Expr& __v) const } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY const indirect_array<_Tp>& indirect_array<_Tp>::operator=(const indirect_array& __ia) const { @@ -2424,7 +2426,7 @@ indirect_array<_Tp>::operator=(const indirect_array& __ia) const } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY void indirect_array<_Tp>::operator=(const value_type& __x) const { @@ -2445,6 +2447,7 @@ private: _ValExpr __expr_; valarray __1d_; + _LIBCPP_INLINE_VISIBILITY __indirect_expr(const valarray& __ia, const _RmExpr& __e) : __expr_(__e), __1d_(__ia) @@ -2452,6 +2455,7 @@ private: #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + _LIBCPP_INLINE_VISIBILITY __indirect_expr(valarray&& __ia, const _RmExpr& __e) : __expr_(__e), __1d_(move(__ia)) @@ -2460,14 +2464,14 @@ private: #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES public: - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY result_type operator[](size_t __i) const {return __expr_[__1d_[__i]];} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY size_t size() const {return __1d_.size();} - template friend class valarray; + template friend class _LIBCPP_VISIBLE valarray; }; template @@ -2480,30 +2484,30 @@ public: typedef typename _RmExpr::value_type value_type; typedef typename _RmExpr::result_type result_type; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY explicit __val_expr(const _RmExpr& __e) : __expr_(__e) {} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY result_type operator[](size_t __i) const {return __expr_[__i];} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY __val_expr<__slice_expr<_ValExpr> > operator[](slice __s) const {return __val_expr<__slice_expr<_ValExpr> >(__expr_, __s);} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY __val_expr<__indirect_expr<_ValExpr> > operator[](const gslice& __gs) const {return __val_expr<__indirect_expr<_ValExpr> >(__expr_, __gs.__1d_);} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY __val_expr<__mask_expr<_ValExpr> > operator[](const valarray& __vb) const {return __val_expr<__mask_expr<_ValExpr> >(__expr_, __vb);} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY __val_expr<__indirect_expr<_ValExpr> > operator[](const valarray& __vs) const {return __val_expr<__indirect_expr<_ValExpr> >(__expr_, __vs);} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY __val_expr<_UnaryOp<__unary_plus, _ValExpr> > operator+() const { @@ -2511,7 +2515,7 @@ public: return __val_expr<_NewExpr>(_NewExpr(__unary_plus(), __expr_)); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY __val_expr<_UnaryOp, _ValExpr> > operator-() const { @@ -2519,7 +2523,7 @@ public: return __val_expr<_NewExpr>(_NewExpr(negate(), __expr_)); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY __val_expr<_UnaryOp<__bit_not, _ValExpr> > operator~() const { @@ -2527,7 +2531,7 @@ public: return __val_expr<_NewExpr>(_NewExpr(__bit_not(), __expr_)); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY __val_expr<_UnaryOp, _ValExpr> > operator!() const { @@ -2537,10 +2541,10 @@ public: operator valarray() const; - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY size_t size() const {return __expr_.size();} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY result_type sum() const { size_t __n = __expr_.size(); @@ -2550,7 +2554,7 @@ public: return __r; } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY result_type min() const { size_t __n = size(); @@ -2564,7 +2568,7 @@ public: return __r; } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY result_type max() const { size_t __n = size(); @@ -2578,15 +2582,15 @@ public: return __r; } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY __val_expr<__shift_expr<_ValExpr> > shift (int __i) const {return __val_expr<__shift_expr<_ValExpr> >(__shift_expr<_ValExpr>(__i, __expr_));} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY __val_expr<__cshift_expr<_ValExpr> > cshift(int __i) const {return __val_expr<__cshift_expr<_ValExpr> >(__cshift_expr<_ValExpr>(__i, __expr_));} - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY __val_expr<_UnaryOp<__apply_expr, _ValExpr> > apply(value_type __f(value_type)) const { @@ -2595,7 +2599,7 @@ public: return __val_expr<_NewExpr>(_NewExpr(_Op(__f), __expr_)); } - _LIBCPP_ALWAYS_INLINE + _LIBCPP_INLINE_VISIBILITY __val_expr<_UnaryOp<__apply_expr, _ValExpr> > apply(value_type __f(const value_type&)) const { @@ -2624,7 +2628,7 @@ __val_expr<_ValExpr>::operator valarray() const // valarray template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY valarray<_Tp>::valarray(size_t __n) : __begin_(0), __end_(0) @@ -2633,7 +2637,7 @@ valarray<_Tp>::valarray(size_t __n) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY valarray<_Tp>::valarray(const value_type& __x, size_t __n) : __begin_(0), __end_(0) @@ -2694,7 +2698,7 @@ valarray<_Tp>::valarray(const valarray& __v) #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY valarray<_Tp>::valarray(valarray&& __v) : __begin_(__v.__begin_), __end_(__v.__end_) @@ -2844,7 +2848,7 @@ valarray<_Tp>::valarray(const indirect_array& __ia) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY valarray<_Tp>::~valarray() { resize(0); @@ -2866,7 +2870,7 @@ valarray<_Tp>::operator=(const valarray& __v) #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY valarray<_Tp>& valarray<_Tp>::operator=(valarray&& __v) { @@ -2879,7 +2883,7 @@ valarray<_Tp>::operator=(valarray&& __v) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY valarray<_Tp>& valarray<_Tp>::operator=(initializer_list __il) { @@ -2892,7 +2896,7 @@ valarray<_Tp>::operator=(initializer_list __il) #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY valarray<_Tp>& valarray<_Tp>::operator=(const value_type& __x) { @@ -2901,7 +2905,7 @@ valarray<_Tp>::operator=(const value_type& __x) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY valarray<_Tp>& valarray<_Tp>::operator=(const slice_array& __sa) { @@ -2913,7 +2917,7 @@ valarray<_Tp>::operator=(const slice_array& __sa) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY valarray<_Tp>& valarray<_Tp>::operator=(const gslice_array& __ga) { @@ -2927,7 +2931,7 @@ valarray<_Tp>::operator=(const gslice_array& __ga) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY valarray<_Tp>& valarray<_Tp>::operator=(const mask_array& __ma) { @@ -2941,7 +2945,7 @@ valarray<_Tp>::operator=(const mask_array& __ma) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY valarray<_Tp>& valarray<_Tp>::operator=(const indirect_array& __ia) { @@ -2955,7 +2959,7 @@ valarray<_Tp>::operator=(const indirect_array& __ia) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY __val_expr<__slice_expr&> > valarray<_Tp>::operator[](slice __s) const { @@ -2963,7 +2967,7 @@ valarray<_Tp>::operator[](slice __s) const } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY slice_array<_Tp> valarray<_Tp>::operator[](slice __s) { @@ -2971,7 +2975,7 @@ valarray<_Tp>::operator[](slice __s) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY __val_expr<__indirect_expr&> > valarray<_Tp>::operator[](const gslice& __gs) const { @@ -2979,7 +2983,7 @@ valarray<_Tp>::operator[](const gslice& __gs) const } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY gslice_array<_Tp> valarray<_Tp>::operator[](const gslice& __gs) { @@ -2989,7 +2993,7 @@ valarray<_Tp>::operator[](const gslice& __gs) #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY __val_expr<__indirect_expr&> > valarray<_Tp>::operator[](gslice&& __gs) const { @@ -2997,7 +3001,7 @@ valarray<_Tp>::operator[](gslice&& __gs) const } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY gslice_array<_Tp> valarray<_Tp>::operator[](gslice&& __gs) { @@ -3007,7 +3011,7 @@ valarray<_Tp>::operator[](gslice&& __gs) #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY __val_expr<__mask_expr&> > valarray<_Tp>::operator[](const valarray& __vb) const { @@ -3015,7 +3019,7 @@ valarray<_Tp>::operator[](const valarray& __vb) const } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY mask_array<_Tp> valarray<_Tp>::operator[](const valarray& __vb) { @@ -3025,7 +3029,7 @@ valarray<_Tp>::operator[](const valarray& __vb) #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY __val_expr<__mask_expr&> > valarray<_Tp>::operator[](valarray&& __vb) const { @@ -3033,7 +3037,7 @@ valarray<_Tp>::operator[](valarray&& __vb) const } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY mask_array<_Tp> valarray<_Tp>::operator[](valarray&& __vb) { @@ -3043,7 +3047,7 @@ valarray<_Tp>::operator[](valarray&& __vb) #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY __val_expr<__indirect_expr&> > valarray<_Tp>::operator[](const valarray& __vs) const { @@ -3051,7 +3055,7 @@ valarray<_Tp>::operator[](const valarray& __vs) const } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY indirect_array<_Tp> valarray<_Tp>::operator[](const valarray& __vs) { @@ -3061,7 +3065,7 @@ valarray<_Tp>::operator[](const valarray& __vs) #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY __val_expr<__indirect_expr&> > valarray<_Tp>::operator[](valarray&& __vs) const { @@ -3069,7 +3073,7 @@ valarray<_Tp>::operator[](valarray&& __vs) const } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY indirect_array<_Tp> valarray<_Tp>::operator[](valarray&& __vs) { @@ -3147,7 +3151,7 @@ valarray<_Tp>::operator!() const } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY valarray<_Tp>& valarray<_Tp>::operator*=(const value_type& __x) { @@ -3157,7 +3161,7 @@ valarray<_Tp>::operator*=(const value_type& __x) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY valarray<_Tp>& valarray<_Tp>::operator/=(const value_type& __x) { @@ -3167,7 +3171,7 @@ valarray<_Tp>::operator/=(const value_type& __x) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY valarray<_Tp>& valarray<_Tp>::operator%=(const value_type& __x) { @@ -3177,7 +3181,7 @@ valarray<_Tp>::operator%=(const value_type& __x) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY valarray<_Tp>& valarray<_Tp>::operator+=(const value_type& __x) { @@ -3187,7 +3191,7 @@ valarray<_Tp>::operator+=(const value_type& __x) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY valarray<_Tp>& valarray<_Tp>::operator-=(const value_type& __x) { @@ -3197,7 +3201,7 @@ valarray<_Tp>::operator-=(const value_type& __x) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY valarray<_Tp>& valarray<_Tp>::operator^=(const value_type& __x) { @@ -3207,7 +3211,7 @@ valarray<_Tp>::operator^=(const value_type& __x) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY valarray<_Tp>& valarray<_Tp>::operator&=(const value_type& __x) { @@ -3217,7 +3221,7 @@ valarray<_Tp>::operator&=(const value_type& __x) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY valarray<_Tp>& valarray<_Tp>::operator|=(const value_type& __x) { @@ -3227,7 +3231,7 @@ valarray<_Tp>::operator|=(const value_type& __x) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY valarray<_Tp>& valarray<_Tp>::operator<<=(const value_type& __x) { @@ -3237,7 +3241,7 @@ valarray<_Tp>::operator<<=(const value_type& __x) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY valarray<_Tp>& valarray<_Tp>::operator>>=(const value_type& __x) { @@ -3248,7 +3252,7 @@ valarray<_Tp>::operator>>=(const value_type& __x) template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -3264,7 +3268,7 @@ valarray<_Tp>::operator*=(const _Expr& __v) template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -3280,7 +3284,7 @@ valarray<_Tp>::operator/=(const _Expr& __v) template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -3296,7 +3300,7 @@ valarray<_Tp>::operator%=(const _Expr& __v) template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -3312,7 +3316,7 @@ valarray<_Tp>::operator+=(const _Expr& __v) template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -3328,7 +3332,7 @@ valarray<_Tp>::operator-=(const _Expr& __v) template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -3344,7 +3348,7 @@ valarray<_Tp>::operator^=(const _Expr& __v) template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -3360,7 +3364,7 @@ valarray<_Tp>::operator|=(const _Expr& __v) template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -3376,7 +3380,7 @@ valarray<_Tp>::operator&=(const _Expr& __v) template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -3392,7 +3396,7 @@ valarray<_Tp>::operator<<=(const _Expr& __v) template template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -3407,7 +3411,7 @@ valarray<_Tp>::operator>>=(const _Expr& __v) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY void valarray<_Tp>::swap(valarray& __v) { @@ -3416,7 +3420,7 @@ valarray<_Tp>::swap(valarray& __v) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY _Tp valarray<_Tp>::sum() const { @@ -3430,7 +3434,7 @@ valarray<_Tp>::sum() const } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY _Tp valarray<_Tp>::min() const { @@ -3440,7 +3444,7 @@ valarray<_Tp>::min() const } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY _Tp valarray<_Tp>::max() const { @@ -3574,7 +3578,7 @@ valarray<_Tp>::resize(size_t __n, value_type __x) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY void swap(valarray<_Tp>& __x, valarray<_Tp>& __y) { @@ -3582,7 +3586,7 @@ swap(valarray<_Tp>& __x, valarray<_Tp>& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, @@ -3596,7 +3600,7 @@ operator*(const _Expr1& __x, const _Expr2& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -3612,7 +3616,7 @@ operator*(const _Expr& __x, const typename _Expr::value_type& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -3628,7 +3632,7 @@ operator*(const typename _Expr::value_type& __x, const _Expr& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, @@ -3642,7 +3646,7 @@ operator/(const _Expr1& __x, const _Expr2& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -3658,7 +3662,7 @@ operator/(const _Expr& __x, const typename _Expr::value_type& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -3674,7 +3678,7 @@ operator/(const typename _Expr::value_type& __x, const _Expr& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, @@ -3688,7 +3692,7 @@ operator%(const _Expr1& __x, const _Expr2& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -3704,7 +3708,7 @@ operator%(const _Expr& __x, const typename _Expr::value_type& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -3720,7 +3724,7 @@ operator%(const typename _Expr::value_type& __x, const _Expr& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, @@ -3734,7 +3738,7 @@ operator+(const _Expr1& __x, const _Expr2& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -3750,7 +3754,7 @@ operator+(const _Expr& __x, const typename _Expr::value_type& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -3766,7 +3770,7 @@ operator+(const typename _Expr::value_type& __x, const _Expr& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, @@ -3780,7 +3784,7 @@ operator-(const _Expr1& __x, const _Expr2& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -3796,7 +3800,7 @@ operator-(const _Expr& __x, const typename _Expr::value_type& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -3812,7 +3816,7 @@ operator-(const typename _Expr::value_type& __x, const _Expr& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, @@ -3826,7 +3830,7 @@ operator^(const _Expr1& __x, const _Expr2& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -3842,7 +3846,7 @@ operator^(const _Expr& __x, const typename _Expr::value_type& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -3858,7 +3862,7 @@ operator^(const typename _Expr::value_type& __x, const _Expr& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, @@ -3872,7 +3876,7 @@ operator&(const _Expr1& __x, const _Expr2& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -3888,7 +3892,7 @@ operator&(const _Expr& __x, const typename _Expr::value_type& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -3904,7 +3908,7 @@ operator&(const typename _Expr::value_type& __x, const _Expr& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, @@ -3918,7 +3922,7 @@ operator|(const _Expr1& __x, const _Expr2& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -3934,7 +3938,7 @@ operator|(const _Expr& __x, const typename _Expr::value_type& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -3950,7 +3954,7 @@ operator|(const typename _Expr::value_type& __x, const _Expr& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, @@ -3964,7 +3968,7 @@ operator<<(const _Expr1& __x, const _Expr2& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -3980,7 +3984,7 @@ operator<<(const _Expr& __x, const typename _Expr::value_type& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -3996,7 +4000,7 @@ operator<<(const typename _Expr::value_type& __x, const _Expr& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, @@ -4010,7 +4014,7 @@ operator>>(const _Expr1& __x, const _Expr2& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4026,7 +4030,7 @@ operator>>(const _Expr& __x, const typename _Expr::value_type& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4042,7 +4046,7 @@ operator>>(const typename _Expr::value_type& __x, const _Expr& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, @@ -4056,7 +4060,7 @@ operator&&(const _Expr1& __x, const _Expr2& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4072,7 +4076,7 @@ operator&&(const _Expr& __x, const typename _Expr::value_type& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4088,7 +4092,7 @@ operator&&(const typename _Expr::value_type& __x, const _Expr& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, @@ -4102,7 +4106,7 @@ operator||(const _Expr1& __x, const _Expr2& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4118,7 +4122,7 @@ operator||(const _Expr& __x, const typename _Expr::value_type& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4134,7 +4138,7 @@ operator||(const typename _Expr::value_type& __x, const _Expr& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, @@ -4148,7 +4152,7 @@ operator==(const _Expr1& __x, const _Expr2& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4164,7 +4168,7 @@ operator==(const _Expr& __x, const typename _Expr::value_type& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4180,7 +4184,7 @@ operator==(const typename _Expr::value_type& __x, const _Expr& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, @@ -4194,7 +4198,7 @@ operator!=(const _Expr1& __x, const _Expr2& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4210,7 +4214,7 @@ operator!=(const _Expr& __x, const typename _Expr::value_type& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4226,7 +4230,7 @@ operator!=(const typename _Expr::value_type& __x, const _Expr& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, @@ -4240,7 +4244,7 @@ operator<(const _Expr1& __x, const _Expr2& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4256,7 +4260,7 @@ operator<(const _Expr& __x, const typename _Expr::value_type& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4272,7 +4276,7 @@ operator<(const typename _Expr::value_type& __x, const _Expr& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, @@ -4286,7 +4290,7 @@ operator>(const _Expr1& __x, const _Expr2& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4302,7 +4306,7 @@ operator>(const _Expr& __x, const typename _Expr::value_type& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4318,7 +4322,7 @@ operator>(const typename _Expr::value_type& __x, const _Expr& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, @@ -4332,7 +4336,7 @@ operator<=(const _Expr1& __x, const _Expr2& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4348,7 +4352,7 @@ operator<=(const _Expr& __x, const typename _Expr::value_type& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4364,7 +4368,7 @@ operator<=(const typename _Expr::value_type& __x, const _Expr& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, @@ -4378,7 +4382,7 @@ operator>=(const _Expr1& __x, const _Expr2& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4394,7 +4398,7 @@ operator>=(const _Expr& __x, const typename _Expr::value_type& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4410,7 +4414,7 @@ operator>=(const typename _Expr::value_type& __x, const _Expr& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4424,7 +4428,7 @@ abs(const _Expr& __x) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4438,7 +4442,7 @@ acos(const _Expr& __x) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4452,7 +4456,7 @@ asin(const _Expr& __x) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4466,7 +4470,7 @@ atan(const _Expr& __x) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, @@ -4480,7 +4484,7 @@ atan2(const _Expr1& __x, const _Expr2& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4496,7 +4500,7 @@ atan2(const _Expr& __x, const typename _Expr::value_type& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4512,7 +4516,7 @@ atan2(const typename _Expr::value_type& __x, const _Expr& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4526,7 +4530,7 @@ cos(const _Expr& __x) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4540,7 +4544,7 @@ cosh(const _Expr& __x) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4554,7 +4558,7 @@ exp(const _Expr& __x) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4568,7 +4572,7 @@ log(const _Expr& __x) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4582,7 +4586,7 @@ log10(const _Expr& __x) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr1>::value && __is_val_expr<_Expr2>::value, @@ -4596,7 +4600,7 @@ pow(const _Expr1& __x, const _Expr2& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4612,7 +4616,7 @@ pow(const _Expr& __x, const typename _Expr::value_type& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4628,7 +4632,7 @@ pow(const typename _Expr::value_type& __x, const _Expr& __y) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4642,7 +4646,7 @@ sin(const _Expr& __x) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4656,7 +4660,7 @@ sinh(const _Expr& __x) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4670,7 +4674,7 @@ sqrt(const _Expr& __x) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4684,7 +4688,7 @@ tan(const _Expr& __x) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY typename enable_if < __is_val_expr<_Expr>::value, @@ -4698,7 +4702,7 @@ tanh(const _Expr& __x) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY _Tp* begin(valarray<_Tp>& __v) { @@ -4706,7 +4710,7 @@ begin(valarray<_Tp>& __v) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY const _Tp* begin(const valarray<_Tp>& __v) { @@ -4714,7 +4718,7 @@ begin(const valarray<_Tp>& __v) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY _Tp* end(valarray<_Tp>& __v) { @@ -4722,7 +4726,7 @@ end(valarray<_Tp>& __v) } template -inline _LIBCPP_ALWAYS_INLINE +inline _LIBCPP_INLINE_VISIBILITY const _Tp* end(const valarray<_Tp>& __v) { diff --git a/libcxx/include/vector b/libcxx/include/vector index f985a0e25d4a..6bb2d6ce1a1f 100644 --- a/libcxx/include/vector +++ b/libcxx/include/vector @@ -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());} + _LIBCPP_INLINE_VISIBILITY void __move_assign_alloc(__vector_base& __c) {__move_assign_alloc(__c, integral_constant());} + _LIBCPP_INLINE_VISIBILITY static void __swap_alloc(allocator_type& __x, allocator_type& __y) {__swap_alloc(__x, __y, integral_constant());} 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 __il); vector(initializer_list __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 __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 __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 __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 __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 __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 __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());} + _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());} + _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());} + _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; friend class __bit_iterator; friend class __bit_array; - friend struct hash; + friend struct _LIBCPP_VISIBLE hash; }; template @@ -2722,9 +2747,10 @@ vector::__hash_code() const } template -struct hash > +struct _LIBCPP_VISIBLE hash > : public unary_function, size_t> { + _LIBCPP_INLINE_VISIBILITY size_t operator()(const vector& __vec) const {return __vec.__hash_code();} };