diff --git a/sprout/detail/if.hpp b/sprout/detail/if.hpp deleted file mode 100644 index 0c6725ea..00000000 --- a/sprout/detail/if.hpp +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef SPROUT_DETAIL_IF_HPP -#define SPROUT_DETAIL_IF_HPP - -#include - -namespace sprout { - namespace detail { - // - // if_c - // - template - struct if_c { - typedef T1 type; - }; - template - struct if_c { - typedef T2 type; - }; - - // - // if_ - // - template - struct if_ - : public sprout::detail::if_c - {}; - } // namespace detail -} // namespace sprout - -#endif // #ifndef SPROUT_DETAIL_IF_HPP diff --git a/sprout/fixed_container/iterator.hpp b/sprout/fixed_container/iterator.hpp index 91ba76a5..4af9f06d 100644 --- a/sprout/fixed_container/iterator.hpp +++ b/sprout/fixed_container/iterator.hpp @@ -4,7 +4,6 @@ #include #include #include -#include namespace sprout { // @@ -13,7 +12,7 @@ namespace sprout { template struct fixed_iterator { public: - typedef typename sprout::detail::if_c< + typedef typename std::conditional< std::is_const::value, typename sprout::fixed_container_traits::const_iterator, typename sprout::fixed_container_traits::iterator diff --git a/sprout/fixed_container/pointer.hpp b/sprout/fixed_container/pointer.hpp index 66c36fff..5d765645 100644 --- a/sprout/fixed_container/pointer.hpp +++ b/sprout/fixed_container/pointer.hpp @@ -4,7 +4,6 @@ #include #include #include -#include namespace sprout { // @@ -13,7 +12,7 @@ namespace sprout { template struct fixed_pointer { public: - typedef typename sprout::detail::if_c< + typedef typename std::conditional< std::is_const::value, typename sprout::fixed_container_traits::const_pointer, typename sprout::fixed_container_traits::pointer diff --git a/sprout/fixed_container/reference.hpp b/sprout/fixed_container/reference.hpp index 0a475755..c7d3bd22 100644 --- a/sprout/fixed_container/reference.hpp +++ b/sprout/fixed_container/reference.hpp @@ -4,7 +4,6 @@ #include #include #include -#include namespace sprout { // @@ -13,7 +12,7 @@ namespace sprout { template struct fixed_reference { public: - typedef typename sprout::detail::if_c< + typedef typename std::conditional< std::is_const::value, typename sprout::fixed_container_traits::const_reference, typename sprout::fixed_container_traits::reference diff --git a/sprout/iterator/index_iterator.hpp b/sprout/iterator/index_iterator.hpp index 40515446..919526ce 100644 --- a/sprout/iterator/index_iterator.hpp +++ b/sprout/iterator/index_iterator.hpp @@ -9,7 +9,6 @@ #include #include #include -#include namespace sprout { // @@ -21,12 +20,12 @@ namespace sprout { std::random_access_iterator_tag, typename sprout::fixed_container_traits::type>::value_type, typename sprout::fixed_container_traits::type>::difference_type, - typename sprout::detail::if_c< + typename std::conditional< std::is_const::type>::value, typename sprout::fixed_container_traits::type>::const_pointer, typename sprout::fixed_container_traits::type>::pointer >::type, - typename sprout::detail::if_c< + typename std::conditional< std::is_const::type>::value, typename sprout::fixed_container_traits::type>::const_reference, typename sprout::fixed_container_traits::type>::reference @@ -36,7 +35,7 @@ namespace sprout { public: typedef Container container_type; typedef typename sprout::fixed_container_traits::type> traits_type; - typedef typename sprout::detail::if_c< + typedef typename std::conditional< std::is_reference::value, typename std::decay::type const&, typename std::decay::type const @@ -46,12 +45,12 @@ namespace sprout { std::random_access_iterator_tag, typename traits_type::value_type, typename traits_type::difference_type, - typename sprout::detail::if_c< + typename std::conditional< std::is_const::type>::value, typename traits_type::const_pointer, typename traits_type::pointer >::type, - typename sprout::detail::if_c< + typename std::conditional< std::is_const::type>::value, typename traits_type::const_reference, typename traits_type::reference diff --git a/sprout/iterator/value_iterator.hpp b/sprout/iterator/value_iterator.hpp index aa4858fe..4ca1c194 100644 --- a/sprout/iterator/value_iterator.hpp +++ b/sprout/iterator/value_iterator.hpp @@ -10,7 +10,6 @@ #include #include #include -#include namespace sprout { // @@ -28,7 +27,7 @@ namespace sprout { { public: typedef T type; - typedef typename sprout::detail::if_c< + typedef typename std::conditional< std::is_reference::value, typename std::decay::type const&, typename std::decay::type const diff --git a/sprout/random/variate_generator.hpp b/sprout/random/variate_generator.hpp index de76d1d3..8929486c 100644 --- a/sprout/random/variate_generator.hpp +++ b/sprout/random/variate_generator.hpp @@ -3,7 +3,6 @@ #include #include -#include #include #include diff --git a/sprout/sub_array.hpp b/sprout/sub_array.hpp index c4d7a6fb..1950d9cf 100644 --- a/sprout/sub_array.hpp +++ b/sprout/sub_array.hpp @@ -11,7 +11,6 @@ #include #include #include -#include #include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL #include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT_DETAIL @@ -31,13 +30,13 @@ namespace sprout { SPROUT_STATIC_CONSTEXPR bool is_const = std::is_const::value; protected: typedef typename sprout::fixed_container_traits::value_type value_type; - typedef typename sprout::detail::if_c< + typedef typename std::conditional< is_const, typename sprout::fixed_container_traits::const_iterator, typename sprout::fixed_container_traits::iterator >::type iterator; typedef typename sprout::fixed_container_traits::const_iterator const_iterator; - typedef typename sprout::detail::if_c< + typedef typename std::conditional< is_const, typename sprout::fixed_container_traits::const_reference, typename sprout::fixed_container_traits::reference @@ -45,7 +44,7 @@ namespace sprout { typedef typename sprout::fixed_container_traits::const_reference const_reference; typedef typename sprout::fixed_container_traits::size_type size_type; typedef typename sprout::fixed_container_traits::difference_type difference_type; - typedef typename sprout::detail::if_c< + typedef typename std::conditional< is_const, typename sprout::fixed_container_traits::const_pointer, typename sprout::fixed_container_traits::pointer @@ -55,19 +54,19 @@ namespace sprout { SPROUT_STATIC_CONSTEXPR size_type static_size = sprout::fixed_container_traits::fixed_size; SPROUT_STATIC_CONSTEXPR size_type fixed_size = static_size; protected: - typedef typename sprout::detail::if_c< + typedef typename std::conditional< is_reference, fixed_container_type*, typename std::remove_const::type >::type holder_type; - typedef typename sprout::detail::if_c< + typedef typename std::conditional< is_reference, fixed_container_type&, fixed_container_type const& >::type param_type; typedef fixed_container_type const& const_param_type; protected: - typedef typename sprout::detail::if_c< + typedef typename std::conditional< std::is_array::value, sprout::detail::is_non_reference_array_tag, sprout::detail::is_not_non_reference_array_tag