sprout/detail/if.hpp 削除

This commit is contained in:
bolero-MURAKAMI 2011-12-22 23:28:14 +09:00
parent 01e458886a
commit 240c2bee1d
8 changed files with 15 additions and 52 deletions

View file

@ -1,30 +0,0 @@
#ifndef SPROUT_DETAIL_IF_HPP
#define SPROUT_DETAIL_IF_HPP
#include <sprout/config.hpp>
namespace sprout {
namespace detail {
//
// if_c
//
template<bool C, typename T1, typename T2>
struct if_c {
typedef T1 type;
};
template<typename T1, typename T2>
struct if_c<false, T1, T2> {
typedef T2 type;
};
//
// if_
//
template<typename Cond, typename T1, typename T2>
struct if_
: public sprout::detail::if_c<Cond::value, T1, T2>
{};
} // namespace detail
} // namespace sprout
#endif // #ifndef SPROUT_DETAIL_IF_HPP

View file

@ -4,7 +4,6 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/fixed_container/traits.hpp>
#include <sprout/detail/if.hpp>
namespace sprout {
//
@ -13,7 +12,7 @@ namespace sprout {
template<typename Container>
struct fixed_iterator {
public:
typedef typename sprout::detail::if_c<
typedef typename std::conditional<
std::is_const<Container>::value,
typename sprout::fixed_container_traits<Container>::const_iterator,
typename sprout::fixed_container_traits<Container>::iterator

View file

@ -4,7 +4,6 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/fixed_container/traits.hpp>
#include <sprout/detail/if.hpp>
namespace sprout {
//
@ -13,7 +12,7 @@ namespace sprout {
template<typename Container>
struct fixed_pointer {
public:
typedef typename sprout::detail::if_c<
typedef typename std::conditional<
std::is_const<Container>::value,
typename sprout::fixed_container_traits<Container>::const_pointer,
typename sprout::fixed_container_traits<Container>::pointer

View file

@ -4,7 +4,6 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/fixed_container/traits.hpp>
#include <sprout/detail/if.hpp>
namespace sprout {
//
@ -13,7 +12,7 @@ namespace sprout {
template<typename Container>
struct fixed_reference {
public:
typedef typename sprout::detail::if_c<
typedef typename std::conditional<
std::is_const<Container>::value,
typename sprout::fixed_container_traits<Container>::const_reference,
typename sprout::fixed_container_traits<Container>::reference

View file

@ -9,7 +9,6 @@
#include <sprout/iterator/next.hpp>
#include <sprout/iterator/prev.hpp>
#include <sprout/utility/value_holder.hpp>
#include <sprout/detail/if.hpp>
namespace sprout {
//
@ -21,12 +20,12 @@ namespace sprout {
std::random_access_iterator_tag,
typename sprout::fixed_container_traits<typename std::decay<Container>::type>::value_type,
typename sprout::fixed_container_traits<typename std::decay<Container>::type>::difference_type,
typename sprout::detail::if_c<
typename std::conditional<
std::is_const<typename std::remove_reference<Container>::type>::value,
typename sprout::fixed_container_traits<typename std::decay<Container>::type>::const_pointer,
typename sprout::fixed_container_traits<typename std::decay<Container>::type>::pointer
>::type,
typename sprout::detail::if_c<
typename std::conditional<
std::is_const<typename std::remove_reference<Container>::type>::value,
typename sprout::fixed_container_traits<typename std::decay<Container>::type>::const_reference,
typename sprout::fixed_container_traits<typename std::decay<Container>::type>::reference
@ -36,7 +35,7 @@ namespace sprout {
public:
typedef Container container_type;
typedef typename sprout::fixed_container_traits<typename std::decay<container_type>::type> traits_type;
typedef typename sprout::detail::if_c<
typedef typename std::conditional<
std::is_reference<container_type>::value,
typename std::decay<container_type>::type const&,
typename std::decay<container_type>::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<typename std::remove_reference<container_type>::type>::value,
typename traits_type::const_pointer,
typename traits_type::pointer
>::type,
typename sprout::detail::if_c<
typename std::conditional<
std::is_const<typename std::remove_reference<container_type>::type>::value,
typename traits_type::const_reference,
typename traits_type::reference

View file

@ -10,7 +10,6 @@
#include <sprout/iterator/next.hpp>
#include <sprout/iterator/prev.hpp>
#include <sprout/utility/value_holder.hpp>
#include <sprout/detail/if.hpp>
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<type>::value,
typename std::decay<type>::type const&,
typename std::decay<type>::type const

View file

@ -3,7 +3,6 @@
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/detail/if.hpp>
#include <sprout/random/detail/ptr_helper.hpp>
#include <sprout/random/random_result.hpp>

View file

@ -11,7 +11,6 @@
#include <sprout/fixed_container/functions.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/utility/forward.hpp>
#include <sprout/detail/if.hpp>
#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<fixed_container_type>::value;
protected:
typedef typename sprout::fixed_container_traits<fixed_container_type>::value_type value_type;
typedef typename sprout::detail::if_c<
typedef typename std::conditional<
is_const,
typename sprout::fixed_container_traits<fixed_container_type>::const_iterator,
typename sprout::fixed_container_traits<fixed_container_type>::iterator
>::type iterator;
typedef typename sprout::fixed_container_traits<fixed_container_type>::const_iterator const_iterator;
typedef typename sprout::detail::if_c<
typedef typename std::conditional<
is_const,
typename sprout::fixed_container_traits<fixed_container_type>::const_reference,
typename sprout::fixed_container_traits<fixed_container_type>::reference
@ -45,7 +44,7 @@ namespace sprout {
typedef typename sprout::fixed_container_traits<fixed_container_type>::const_reference const_reference;
typedef typename sprout::fixed_container_traits<fixed_container_type>::size_type size_type;
typedef typename sprout::fixed_container_traits<fixed_container_type>::difference_type difference_type;
typedef typename sprout::detail::if_c<
typedef typename std::conditional<
is_const,
typename sprout::fixed_container_traits<fixed_container_type>::const_pointer,
typename sprout::fixed_container_traits<fixed_container_type>::pointer
@ -55,19 +54,19 @@ namespace sprout {
SPROUT_STATIC_CONSTEXPR size_type static_size = sprout::fixed_container_traits<fixed_container_type>::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<fixed_container_type>::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<holder_type>::value,
sprout::detail::is_non_reference_array_tag,
sprout::detail::is_not_non_reference_array_tag