/
usr
/
include
/
boost
/
type_traits
/
/usr/include/boost/type_traits
mkdir
upload
Name
Size
Mode
Actions
detail/
-
0755
rm
add_const.hpp
1439
0644
edit
dl
rm
add_cv.hpp
1399
0644
edit
dl
rm
add_lvalue_reference.hpp
768
0644
edit
dl
rm
add_pointer.hpp
1505
0644
edit
dl
rm
add_reference.hpp
1709
0644
edit
dl
rm
add_rvalue_reference.hpp
2395
0644
edit
dl
rm
add_volatile.hpp
1424
0644
edit
dl
rm
aligned_storage.hpp
3350
0644
edit
dl
rm
alignment_of.hpp
3575
0644
edit
dl
rm
alignment_traits.hpp
573
0644
edit
dl
rm
arithmetic_traits.hpp
862
0644
edit
dl
rm
array_traits.hpp
569
0644
edit
dl
rm
broken_compiler_spec.hpp
724
0644
edit
dl
rm
common_type.hpp
4555
0644
edit
dl
rm
composite_traits.hpp
1001
0644
edit
dl
rm
conditional.hpp
843
0644
edit
dl
rm
config.hpp
708
0644
edit
dl
rm
conjunction.hpp
889
0644
edit
dl
rm
conversion_traits.hpp
658
0644
edit
dl
rm
copy_cv.hpp
1058
0644
edit
dl
rm
copy_cv_ref.hpp
790
0644
edit
dl
rm
copy_reference.hpp
1044
0644
edit
dl
rm
cv_traits.hpp
994
0644
edit
dl
rm
decay.hpp
1496
0644
edit
dl
rm
declval.hpp
1899
0644
edit
dl
rm
detected.hpp
569
0644
edit
dl
rm
detected_or.hpp
670
0644
edit
dl
rm
disjunction.hpp
891
0644
edit
dl
rm
enable_if.hpp
829
0644
edit
dl
rm
extent.hpp
3751
0644
edit
dl
rm
floating_point_promotion.hpp
1071
0644
edit
dl
rm
function_traits.hpp
4801
0644
edit
dl
rm
has_bit_and.hpp
1572
0644
edit
dl
rm
has_bit_and_assign.hpp
1841
0644
edit
dl
rm
has_bit_or.hpp
1569
0644
edit
dl
rm
has_bit_or_assign.hpp
1839
0644
edit
dl
rm
has_bit_xor.hpp
1571
0644
edit
dl
rm
has_bit_xor_assign.hpp
1842
0644
edit
dl
rm
has_complement.hpp
936
0644
edit
dl
rm
has_dereference.hpp
16135
0644
edit
dl
rm
has_divides.hpp
1156
0644
edit
dl
rm
has_divides_assign.hpp
1513
0644
edit
dl
rm
has_equal_to.hpp
1762
0644
edit
dl
rm
has_greater.hpp
1756
0644
edit
dl
rm
has_greater_equal.hpp
1775
0644
edit
dl
rm
has_left_shift.hpp
1581
0644
edit
dl
rm
has_left_shift_assign.hpp
1851
0644
edit
dl
rm
has_less.hpp
1750
0644
edit
dl
rm
has_less_equal.hpp
1769
0644
edit
dl
rm
has_logical_and.hpp
1212
0644
edit
dl
rm
has_logical_not.hpp
998
0644
edit
dl
rm
has_logical_or.hpp
1208
0644
edit
dl
rm
has_minus.hpp
6520
0644
edit
dl
rm
has_minus_assign.hpp
6809
0644
edit
dl
rm
has_modulus.hpp
1570
0644
edit
dl
rm
has_modulus_assign.hpp
1841
0644
edit
dl
rm
has_multiplies.hpp
1162
0644
edit
dl
rm
has_multiplies_assign.hpp
1521
0644
edit
dl
rm
has_negate.hpp
731
0644
edit
dl
rm
has_new_operator.hpp
5166
0644
edit
dl
rm
has_nothrow_assign.hpp
3766
0644
edit
dl
rm
has_nothrow_constructor.hpp
2633
0644
edit
dl
rm
has_nothrow_copy.hpp
3047
0644
edit
dl
rm
has_nothrow_destructor.hpp
2204
0644
edit
dl
rm
has_not_equal_to.hpp
1774
0644
edit
dl
rm
has_operator.hpp
2282
0644
edit
dl
rm
has_plus.hpp
1800
0644
edit
dl
rm
has_plus_assign.hpp
6891
0644
edit
dl
rm
has_post_decrement.hpp
1932
0644
edit
dl
rm
has_post_increment.hpp
1932
0644
edit
dl
rm
has_pre_decrement.hpp
1922
0644
edit
dl
rm
has_pre_increment.hpp
1923
0644
edit
dl
rm
has_right_shift.hpp
1584
0644
edit
dl
rm
has_right_shift_assign.hpp
1854
0644
edit
dl
rm
has_trivial_assign.hpp
2208
0644
edit
dl
rm
has_trivial_constructor.hpp
2233
0644
edit
dl
rm
has_trivial_copy.hpp
2417
0644
edit
dl
rm
has_trivial_destructor.hpp
1683
0644
edit
dl
rm
has_trivial_move_assign.hpp
2666
0644
edit
dl
rm
has_trivial_move_constructor.hpp
2939
0644
edit
dl
rm
has_unary_minus.hpp
746
0644
edit
dl
rm
has_unary_plus.hpp
690
0644
edit
dl
rm
has_virtual_destructor.hpp
901
0644
edit
dl
rm
ice.hpp
768
0644
edit
dl
rm
integral_constant.hpp
2546
0644
edit
dl
rm
integral_promotion.hpp
6268
0644
edit
dl
rm
intrinsics.hpp
22018
0644
edit
dl
rm
is_abstract.hpp
4501
0644
edit
dl
rm
is_arithmetic.hpp
778
0644
edit
dl
rm
is_array.hpp
1755
0644
edit
dl
rm
is_assignable.hpp
3925
0644
edit
dl
rm
is_base_and_derived.hpp
7997
0644
edit
dl
rm
is_base_of.hpp
1500
0644
edit
dl
rm
is_base_of_tr1.hpp
1486
0644
edit
dl
rm
is_bounded_array.hpp
912
0644
edit
dl
rm
is_class.hpp
3595
0644
edit
dl
rm
is_complete.hpp
2803
0644
edit
dl
rm
is_complex.hpp
952
0644
edit
dl
rm
is_compound.hpp
848
0644
edit
dl
rm
is_const.hpp
1630
0644
edit
dl
rm
is_constructible.hpp
4350
0644
edit
dl
rm
is_convertible.hpp
18672
0644
edit
dl
rm
is_copy_assignable.hpp
4904
0644
edit
dl
rm
is_copy_constructible.hpp
6813
0644
edit
dl
rm
is_default_constructible.hpp
4526
0644
edit
dl
rm
is_destructible.hpp
2572
0644
edit
dl
rm
is_detected.hpp
752
0644
edit
dl
rm
is_detected_convertible.hpp
815
0644
edit
dl
rm
is_detected_exact.hpp
796
0644
edit
dl
rm
is_empty.hpp
3004
0644
edit
dl
rm
is_enum.hpp
4996
0644
edit
dl
rm
is_final.hpp
868
0644
edit
dl
rm
is_float.hpp
789
0644
edit
dl
rm
is_floating_point.hpp
1374
0644
edit
dl
rm
is_function.hpp
808
0644
edit
dl
rm
is_fundamental.hpp
996
0644
edit
dl
rm
is_integral.hpp
3845
0644
edit
dl
rm
is_list_constructible.hpp
1746
0644
edit
dl
rm
is_lvalue_reference.hpp
2012
0644
edit
dl
rm
is_member_function_pointer.hpp
825
0644
edit
dl
rm
is_member_object_pointer.hpp
839
0644
edit
dl
rm
is_member_pointer.hpp
1969
0644
edit
dl
rm
is_noncopyable.hpp
1067
0644
edit
dl
rm
is_nothrow_move_assignable.hpp
3964
0644
edit
dl
rm
is_nothrow_move_constructible.hpp
4043
0644
edit
dl
rm
is_nothrow_swappable.hpp
2405
0644
edit
dl
rm
is_object.hpp
907
0644
edit
dl
rm
is_pod.hpp
1809
0644
edit
dl
rm
is_pointer.hpp
1901
0644
edit
dl
rm
is_polymorphic.hpp
3187
0644
edit
dl
rm
is_reference.hpp
938
0644
edit
dl
rm
is_rvalue_reference.hpp
981
0644
edit
dl
rm
is_same.hpp
1511
0644
edit
dl
rm
is_scalar.hpp
966
0644
edit
dl
rm
is_scoped_enum.hpp
640
0644
edit
dl
rm
is_signed.hpp
6652
0644
edit
dl
rm
is_stateless.hpp
1127
0644
edit
dl
rm
is_trivially_copyable.hpp
713
0644
edit
dl
rm
is_unbounded_array.hpp
843
0644
edit
dl
rm
is_union.hpp
1075
0644
edit
dl
rm
is_unscoped_enum.hpp
593
0644
edit
dl
rm
is_unsigned.hpp
6772
0644
edit
dl
rm
is_virtual_base_of.hpp
6146
0644
edit
dl
rm
is_void.hpp
890
0644
edit
dl
rm
is_volatile.hpp
1665
0644
edit
dl
rm
make_signed.hpp
4621
0644
edit
dl
rm
make_unsigned.hpp
4691
0644
edit
dl
rm
make_void.hpp
1052
0644
edit
dl
rm
negation.hpp
472
0644
edit
dl
rm
nonesuch.hpp
702
0644
edit
dl
rm
object_traits.hpp
1441
0644
edit
dl
rm
promote.hpp
755
0644
edit
dl
rm
rank.hpp
2585
0644
edit
dl
rm
reference_traits.hpp
590
0644
edit
dl
rm
remove_all_extents.hpp
1885
0644
edit
dl
rm
remove_bounds.hpp
802
0644
edit
dl
rm
remove_const.hpp
1359
0644
edit
dl
rm
remove_cv.hpp
1794
0644
edit
dl
rm
remove_cv_ref.hpp
859
0644
edit
dl
rm
remove_extent.hpp
1791
0644
edit
dl
rm
remove_pointer.hpp
2203
0644
edit
dl
rm
remove_reference.hpp
1783
0644
edit
dl
rm
remove_volatile.hpp
1398
0644
edit
dl
rm
same_traits.hpp
586
0644
edit
dl
rm
transform_traits.hpp
893
0644
edit
dl
rm
type_identity.hpp
636
0644
edit
dl
rm
type_with_alignment.hpp
10037
0644
edit
dl
rm
Edit:
/usr/include/boost/type_traits/integral_promotion.hpp
(6268B)
// Copyright 2005 Alexander Nasonov. // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef FILE_boost_type_traits_integral_promotion_hpp_INCLUDED #define FILE_boost_type_traits_integral_promotion_hpp_INCLUDED #include <boost/config.hpp> #include <boost/type_traits/integral_constant.hpp> #include <boost/type_traits/is_const.hpp> #include <boost/type_traits/is_enum.hpp> #include <boost/type_traits/is_volatile.hpp> #include <boost/type_traits/remove_cv.hpp> namespace boost { namespace type_traits { namespace detail { // 4.5/2 template <class T> struct need_promotion : public boost::is_enum<T> {}; // 4.5/1 template<> struct need_promotion<char > : public true_type {}; template<> struct need_promotion<signed char > : public true_type {}; template<> struct need_promotion<unsigned char > : public true_type {}; template<> struct need_promotion<signed short int > : public true_type {}; template<> struct need_promotion<unsigned short int> : public true_type {}; // Specializations for non-standard types. // Type is promoted if it's smaller then int. #define BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(T) \ template<> struct need_promotion<T> \ : public integral_constant<bool, (sizeof(T) < sizeof(int))> {}; // Same set of integral types as in boost/type_traits/is_integral.hpp. // Please, keep in sync. #if (defined(BOOST_INTEL_CXX_VERSION) && defined(_MSC_VER) && (BOOST_INTEL_CXX_VERSION <= 600)) \ || (defined(BOOST_BORLANDC) && (BOOST_BORLANDC == 0x600) && (_MSC_VER < 1300)) // TODO: common macro for this #if. Or better yet, PP SEQ of non-standard types. BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(__int8 ) BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(unsigned __int8 ) BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(__int16 ) BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(unsigned __int16) BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(__int32 ) BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(unsigned __int32) #ifdef BOOST_BORLANDC BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(unsigned __int64) BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE( __int64) #endif #endif #if defined(BOOST_HAS_LONG_LONG) BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(boost::ulong_long_type) BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(boost::long_long_type ) #elif defined(BOOST_HAS_MS_INT64) BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(unsigned __int64) BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE( __int64) #endif #undef BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE #ifndef BOOST_NO_INTRINSIC_WCHAR_T // 4.5/2 template<> struct need_promotion<wchar_t> : public true_type {}; #endif // 4.5/3 (integral bit-field) is not supported. // 4.5/4 template<> struct need_promotion<bool> : public true_type {}; // Get promoted type by index and cv qualifiers. template<int Index, int IsConst, int IsVolatile> struct promote_from_index; #define BOOST_TT_AUX_PROMOTE_FROM_INDEX(N,T) \ template<> struct promote_from_index<N,0,0> { typedef T type; }; \ template<> struct promote_from_index<N,0,1> { typedef T volatile type; }; \ template<> struct promote_from_index<N,1,0> { typedef T const type; }; \ template<> struct promote_from_index<N,1,1> { typedef T const volatile type; }; BOOST_TT_AUX_PROMOTE_FROM_INDEX(1, int ) BOOST_TT_AUX_PROMOTE_FROM_INDEX(2, unsigned int ) BOOST_TT_AUX_PROMOTE_FROM_INDEX(3, long ) BOOST_TT_AUX_PROMOTE_FROM_INDEX(4, unsigned long) // WARNING: integral promotions to non-standard types // long long and __int64 are not defined by the standard. // Additional specialisations and overloads shouldn't // introduce ambiguity, though. #if defined(BOOST_HAS_LONG_LONG) BOOST_TT_AUX_PROMOTE_FROM_INDEX(5, boost::long_long_type ) BOOST_TT_AUX_PROMOTE_FROM_INDEX(6, boost::ulong_long_type) #elif defined(BOOST_HAS_MS_INT64) BOOST_TT_AUX_PROMOTE_FROM_INDEX(7, __int64 ) BOOST_TT_AUX_PROMOTE_FROM_INDEX(8, unsigned __int64) #endif #undef BOOST_TT_AUX_PROMOTE_FROM_INDEX // Define BOOST_TT_AUX_PROMOTED_INDEX_TESTER: #if !defined(BOOST_MSVC) template<int N> struct sized_type_for_promotion { typedef char (&type)[N]; }; #define BOOST_TT_AUX_PROMOTED_INDEX_TESTER(I,T) \ sized_type_for_promotion<I>::type promoted_index_tester(T); #else #define BOOST_TT_AUX_PROMOTED_INDEX_TESTER(I,T) \ char (&promoted_index_tester(T))[I]; #endif BOOST_TT_AUX_PROMOTED_INDEX_TESTER(1, int ) BOOST_TT_AUX_PROMOTED_INDEX_TESTER(2, unsigned int ) BOOST_TT_AUX_PROMOTED_INDEX_TESTER(3, long ) BOOST_TT_AUX_PROMOTED_INDEX_TESTER(4, unsigned long) #if defined(BOOST_HAS_LONG_LONG) BOOST_TT_AUX_PROMOTED_INDEX_TESTER(5, boost::long_long_type ) BOOST_TT_AUX_PROMOTED_INDEX_TESTER(6, boost::ulong_long_type) #elif defined(BOOST_HAS_MS_INT64) BOOST_TT_AUX_PROMOTED_INDEX_TESTER(7, __int64 ) BOOST_TT_AUX_PROMOTED_INDEX_TESTER(8, unsigned __int64) #endif #undef BOOST_TT_AUX_PROMOTED_INDEX_TESTER // Get an index of promoted type for type T. // Precondition: need_promotion<T> template<class T> struct promoted_index { static T testee; // undefined BOOST_STATIC_CONSTANT(int, value = sizeof(promoted_index_tester(+testee)) ); // Unary plus promotes testee LOOK HERE ---> ^ }; template<class T> struct integral_promotion_impl { typedef BOOST_DEDUCED_TYPENAME promote_from_index< (boost::type_traits::detail::promoted_index<T>::value) , (boost::is_const<T>::value) , (boost::is_volatile<T>::value) >::type type; }; template<class T, bool b> struct integral_promotion { typedef T type; }; template<class T> struct integral_promotion<T, true> : public integral_promotion_impl<T>{}; } } template <class T> struct integral_promotion { private: typedef boost::type_traits::detail::need_promotion<typename remove_cv<T>::type> tag_type; public: typedef typename boost::type_traits::detail::integral_promotion<T, tag_type::value>::type type; }; #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) template <class T> using integral_promotion_t = typename integral_promotion<T>::type; #endif } #endif // #ifndef FILE_boost_type_traits_integral_promotion_hpp_INCLUDED
Save
cmd:
run