From f5b8b91255ee2c96b27aaaadb28430893bc7cf79 Mon Sep 17 00:00:00 2001 From: bolero-MURAKAMI Date: Sat, 23 Mar 2013 23:46:03 +0900 Subject: [PATCH] add template aliases type_traits --- sprout/array/make_array.hpp | 4 ++-- sprout/iterator/type_traits/common.hpp | 4 ++-- sprout/type_traits/arithmetic_promote.hpp | 5 +++++ sprout/type_traits/common_decay.hpp | 5 +++++ sprout/type_traits/float_promote.hpp | 5 +++++ sprout/type_traits/identity.hpp | 5 +++++ sprout/type_traits/is_c_str.hpp | 5 +++++ sprout/type_traits/is_char_type.hpp | 5 +++++ sprout/type_traits/is_int.hpp | 5 +++++ sprout/type_traits/is_uint.hpp | 5 +++++ 10 files changed, 44 insertions(+), 4 deletions(-) diff --git a/sprout/array/make_array.hpp b/sprout/array/make_array.hpp index b7bb4496..d5208ecd 100644 --- a/sprout/array/make_array.hpp +++ b/sprout/array/make_array.hpp @@ -24,12 +24,12 @@ namespace sprout { // template inline SPROUT_CONSTEXPR sprout::array< - typename sprout::common_decay::type...>::type, + typename sprout::common_decay::type, sizeof...(Types) > make_common_array(Types&&... args) { typedef sprout::array< - typename sprout::common_decay::type...>::type, + typename sprout::common_decay::type, sizeof...(Types) > type; return type{{sprout::forward(args)...}}; diff --git a/sprout/iterator/type_traits/common.hpp b/sprout/iterator/type_traits/common.hpp index 38d1e3b0..2564bcff 100644 --- a/sprout/iterator/type_traits/common.hpp +++ b/sprout/iterator/type_traits/common.hpp @@ -108,10 +108,10 @@ namespace sprout { ) , T, - typename sprout::common_decay::type, typename std::decay::type>::type + typename sprout::common_decay::type >::type >::type, - typename sprout::common_decay::type, typename std::decay::type>::type + typename sprout::common_decay::type > {}; template diff --git a/sprout/type_traits/arithmetic_promote.hpp b/sprout/type_traits/arithmetic_promote.hpp index 7bbbd2e8..3cb79b07 100644 --- a/sprout/type_traits/arithmetic_promote.hpp +++ b/sprout/type_traits/arithmetic_promote.hpp @@ -52,6 +52,11 @@ namespace sprout { typename std::remove_cv::type... > {}; + +#if SPROUT_USE_TEMPLATE_ALIASES + template + using arithmetic_promote_ = typename sprout::arithmetic_promote::type; +#endif // #if SPROUT_USE_TEMPLATE_ALIASES } // namespace sprout #endif // #ifndef SPROUT_TYPE_TRAITS_ARITHMETIC_PROMOTE_HPP diff --git a/sprout/type_traits/common_decay.hpp b/sprout/type_traits/common_decay.hpp index 4b22ade9..7a61f8f5 100644 --- a/sprout/type_traits/common_decay.hpp +++ b/sprout/type_traits/common_decay.hpp @@ -12,6 +12,11 @@ namespace sprout { struct common_decay : public std::decay::type> {}; + +#if SPROUT_USE_TEMPLATE_ALIASES + template + using common_decay_ = typename sprout::common_decay::type; +#endif // #if SPROUT_USE_TEMPLATE_ALIASES } // namespace sprout #endif // #ifndef SPROUT_TYPE_TRAITS_COMMON_DECAY_HPP diff --git a/sprout/type_traits/float_promote.hpp b/sprout/type_traits/float_promote.hpp index ca1c5735..dbb2742a 100644 --- a/sprout/type_traits/float_promote.hpp +++ b/sprout/type_traits/float_promote.hpp @@ -63,6 +63,11 @@ namespace sprout { typename std::remove_cv::type... > {}; + +#if SPROUT_USE_TEMPLATE_ALIASES + template + using float_promote_ = typename sprout::float_promote::type; +#endif // #if SPROUT_USE_TEMPLATE_ALIASES } // namespace sprout #endif // #ifndef SPROUT_TYPE_TRAITS_FLOAT_PROMOTE_HPP diff --git a/sprout/type_traits/identity.hpp b/sprout/type_traits/identity.hpp index 1f1a6210..b5b68639 100644 --- a/sprout/type_traits/identity.hpp +++ b/sprout/type_traits/identity.hpp @@ -12,6 +12,11 @@ namespace sprout { public: typedef T type; }; + +#if SPROUT_USE_TEMPLATE_ALIASES + template + using identity_ = typename sprout::identity::type; +#endif // #if SPROUT_USE_TEMPLATE_ALIASES } // namespace sprout #endif // #ifndef SPROUT_TYPE_TRAITS_IDENTITY_HPP diff --git a/sprout/type_traits/is_c_str.hpp b/sprout/type_traits/is_c_str.hpp index cb7859cf..757e52ac 100644 --- a/sprout/type_traits/is_c_str.hpp +++ b/sprout/type_traits/is_c_str.hpp @@ -56,6 +56,11 @@ namespace sprout { struct is_c_str : public std::true_type {}; + +#if SPROUT_USE_TEMPLATE_ALIASES + template + using is_c_str_ = typename sprout::is_c_str::type; +#endif // #if SPROUT_USE_TEMPLATE_ALIASES } // namespace sprout #endif // #ifndef SPROUT_TYPE_TRAITS_IS_C_STR_HPP diff --git a/sprout/type_traits/is_char_type.hpp b/sprout/type_traits/is_char_type.hpp index 7c9e3486..950560b6 100644 --- a/sprout/type_traits/is_char_type.hpp +++ b/sprout/type_traits/is_char_type.hpp @@ -40,6 +40,11 @@ namespace sprout { struct is_char_type : public std::true_type {}; + +#if SPROUT_USE_TEMPLATE_ALIASES + template + using is_char_type_ = typename sprout::is_char_type::type; +#endif // #if SPROUT_USE_TEMPLATE_ALIASES } // namespace sprout #endif // #ifndef SPROUT_TYPE_TRAITS_IS_CHAR_TYPE_HPP diff --git a/sprout/type_traits/is_int.hpp b/sprout/type_traits/is_int.hpp index 145ac547..73566abd 100644 --- a/sprout/type_traits/is_int.hpp +++ b/sprout/type_traits/is_int.hpp @@ -15,6 +15,11 @@ namespace sprout { std::is_integral::value && std::is_signed::value > {}; + +#if SPROUT_USE_TEMPLATE_ALIASES + template + using is_int_ = typename sprout::is_int::type; +#endif // #if SPROUT_USE_TEMPLATE_ALIASES } // namespace sprout #endif // #ifndef SPROUT_TYPE_TRAITS_IS_INT_HPP diff --git a/sprout/type_traits/is_uint.hpp b/sprout/type_traits/is_uint.hpp index 7924000a..4b0e12ba 100644 --- a/sprout/type_traits/is_uint.hpp +++ b/sprout/type_traits/is_uint.hpp @@ -15,6 +15,11 @@ namespace sprout { std::is_integral::value && std::is_unsigned::value > {}; + +#if SPROUT_USE_TEMPLATE_ALIASES + template + using is_uint_ = typename sprout::is_uint::type; +#endif // #if SPROUT_USE_TEMPLATE_ALIASES } // namespace sprout #endif // #ifndef SPROUT_TYPE_TRAITS_IS_UINT_HPP