mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2024-12-23 21:25:49 +00:00
sprout/detail/if.hpp 削除
This commit is contained in:
parent
01e458886a
commit
240c2bee1d
8 changed files with 15 additions and 52 deletions
|
@ -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
|
|
|
@ -4,7 +4,6 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/fixed_container/traits.hpp>
|
#include <sprout/fixed_container/traits.hpp>
|
||||||
#include <sprout/detail/if.hpp>
|
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
//
|
//
|
||||||
|
@ -13,7 +12,7 @@ namespace sprout {
|
||||||
template<typename Container>
|
template<typename Container>
|
||||||
struct fixed_iterator {
|
struct fixed_iterator {
|
||||||
public:
|
public:
|
||||||
typedef typename sprout::detail::if_c<
|
typedef typename std::conditional<
|
||||||
std::is_const<Container>::value,
|
std::is_const<Container>::value,
|
||||||
typename sprout::fixed_container_traits<Container>::const_iterator,
|
typename sprout::fixed_container_traits<Container>::const_iterator,
|
||||||
typename sprout::fixed_container_traits<Container>::iterator
|
typename sprout::fixed_container_traits<Container>::iterator
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/fixed_container/traits.hpp>
|
#include <sprout/fixed_container/traits.hpp>
|
||||||
#include <sprout/detail/if.hpp>
|
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
//
|
//
|
||||||
|
@ -13,7 +12,7 @@ namespace sprout {
|
||||||
template<typename Container>
|
template<typename Container>
|
||||||
struct fixed_pointer {
|
struct fixed_pointer {
|
||||||
public:
|
public:
|
||||||
typedef typename sprout::detail::if_c<
|
typedef typename std::conditional<
|
||||||
std::is_const<Container>::value,
|
std::is_const<Container>::value,
|
||||||
typename sprout::fixed_container_traits<Container>::const_pointer,
|
typename sprout::fixed_container_traits<Container>::const_pointer,
|
||||||
typename sprout::fixed_container_traits<Container>::pointer
|
typename sprout::fixed_container_traits<Container>::pointer
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/fixed_container/traits.hpp>
|
#include <sprout/fixed_container/traits.hpp>
|
||||||
#include <sprout/detail/if.hpp>
|
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
//
|
//
|
||||||
|
@ -13,7 +12,7 @@ namespace sprout {
|
||||||
template<typename Container>
|
template<typename Container>
|
||||||
struct fixed_reference {
|
struct fixed_reference {
|
||||||
public:
|
public:
|
||||||
typedef typename sprout::detail::if_c<
|
typedef typename std::conditional<
|
||||||
std::is_const<Container>::value,
|
std::is_const<Container>::value,
|
||||||
typename sprout::fixed_container_traits<Container>::const_reference,
|
typename sprout::fixed_container_traits<Container>::const_reference,
|
||||||
typename sprout::fixed_container_traits<Container>::reference
|
typename sprout::fixed_container_traits<Container>::reference
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
#include <sprout/iterator/next.hpp>
|
#include <sprout/iterator/next.hpp>
|
||||||
#include <sprout/iterator/prev.hpp>
|
#include <sprout/iterator/prev.hpp>
|
||||||
#include <sprout/utility/value_holder.hpp>
|
#include <sprout/utility/value_holder.hpp>
|
||||||
#include <sprout/detail/if.hpp>
|
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
//
|
//
|
||||||
|
@ -21,12 +20,12 @@ namespace sprout {
|
||||||
std::random_access_iterator_tag,
|
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>::value_type,
|
||||||
typename sprout::fixed_container_traits<typename std::decay<Container>::type>::difference_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,
|
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>::const_pointer,
|
||||||
typename sprout::fixed_container_traits<typename std::decay<Container>::type>::pointer
|
typename sprout::fixed_container_traits<typename std::decay<Container>::type>::pointer
|
||||||
>::type,
|
>::type,
|
||||||
typename sprout::detail::if_c<
|
typename std::conditional<
|
||||||
std::is_const<typename std::remove_reference<Container>::type>::value,
|
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>::const_reference,
|
||||||
typename sprout::fixed_container_traits<typename std::decay<Container>::type>::reference
|
typename sprout::fixed_container_traits<typename std::decay<Container>::type>::reference
|
||||||
|
@ -36,7 +35,7 @@ namespace sprout {
|
||||||
public:
|
public:
|
||||||
typedef Container container_type;
|
typedef Container container_type;
|
||||||
typedef typename sprout::fixed_container_traits<typename std::decay<container_type>::type> traits_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,
|
std::is_reference<container_type>::value,
|
||||||
typename std::decay<container_type>::type const&,
|
typename std::decay<container_type>::type const&,
|
||||||
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,
|
std::random_access_iterator_tag,
|
||||||
typename traits_type::value_type,
|
typename traits_type::value_type,
|
||||||
typename traits_type::difference_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,
|
std::is_const<typename std::remove_reference<container_type>::type>::value,
|
||||||
typename traits_type::const_pointer,
|
typename traits_type::const_pointer,
|
||||||
typename traits_type::pointer
|
typename traits_type::pointer
|
||||||
>::type,
|
>::type,
|
||||||
typename sprout::detail::if_c<
|
typename std::conditional<
|
||||||
std::is_const<typename std::remove_reference<container_type>::type>::value,
|
std::is_const<typename std::remove_reference<container_type>::type>::value,
|
||||||
typename traits_type::const_reference,
|
typename traits_type::const_reference,
|
||||||
typename traits_type::reference
|
typename traits_type::reference
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
#include <sprout/iterator/next.hpp>
|
#include <sprout/iterator/next.hpp>
|
||||||
#include <sprout/iterator/prev.hpp>
|
#include <sprout/iterator/prev.hpp>
|
||||||
#include <sprout/utility/value_holder.hpp>
|
#include <sprout/utility/value_holder.hpp>
|
||||||
#include <sprout/detail/if.hpp>
|
|
||||||
|
|
||||||
namespace sprout {
|
namespace sprout {
|
||||||
//
|
//
|
||||||
|
@ -28,7 +27,7 @@ namespace sprout {
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef T type;
|
typedef T type;
|
||||||
typedef typename sprout::detail::if_c<
|
typedef typename std::conditional<
|
||||||
std::is_reference<type>::value,
|
std::is_reference<type>::value,
|
||||||
typename std::decay<type>::type const&,
|
typename std::decay<type>::type const&,
|
||||||
typename std::decay<type>::type const
|
typename std::decay<type>::type const
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/detail/if.hpp>
|
|
||||||
#include <sprout/random/detail/ptr_helper.hpp>
|
#include <sprout/random/detail/ptr_helper.hpp>
|
||||||
#include <sprout/random/random_result.hpp>
|
#include <sprout/random/random_result.hpp>
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
#include <sprout/fixed_container/functions.hpp>
|
#include <sprout/fixed_container/functions.hpp>
|
||||||
#include <sprout/iterator/operation.hpp>
|
#include <sprout/iterator/operation.hpp>
|
||||||
#include <sprout/utility/forward.hpp>
|
#include <sprout/utility/forward.hpp>
|
||||||
#include <sprout/detail/if.hpp>
|
|
||||||
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
|
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT_DETAIL
|
||||||
#include HDR_ITERATOR_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;
|
SPROUT_STATIC_CONSTEXPR bool is_const = std::is_const<fixed_container_type>::value;
|
||||||
protected:
|
protected:
|
||||||
typedef typename sprout::fixed_container_traits<fixed_container_type>::value_type value_type;
|
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,
|
is_const,
|
||||||
typename sprout::fixed_container_traits<fixed_container_type>::const_iterator,
|
typename sprout::fixed_container_traits<fixed_container_type>::const_iterator,
|
||||||
typename sprout::fixed_container_traits<fixed_container_type>::iterator
|
typename sprout::fixed_container_traits<fixed_container_type>::iterator
|
||||||
>::type iterator;
|
>::type iterator;
|
||||||
typedef typename sprout::fixed_container_traits<fixed_container_type>::const_iterator const_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,
|
is_const,
|
||||||
typename sprout::fixed_container_traits<fixed_container_type>::const_reference,
|
typename sprout::fixed_container_traits<fixed_container_type>::const_reference,
|
||||||
typename sprout::fixed_container_traits<fixed_container_type>::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>::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>::size_type size_type;
|
||||||
typedef typename sprout::fixed_container_traits<fixed_container_type>::difference_type difference_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,
|
is_const,
|
||||||
typename sprout::fixed_container_traits<fixed_container_type>::const_pointer,
|
typename sprout::fixed_container_traits<fixed_container_type>::const_pointer,
|
||||||
typename sprout::fixed_container_traits<fixed_container_type>::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 static_size = sprout::fixed_container_traits<fixed_container_type>::fixed_size;
|
||||||
SPROUT_STATIC_CONSTEXPR size_type fixed_size = static_size;
|
SPROUT_STATIC_CONSTEXPR size_type fixed_size = static_size;
|
||||||
protected:
|
protected:
|
||||||
typedef typename sprout::detail::if_c<
|
typedef typename std::conditional<
|
||||||
is_reference,
|
is_reference,
|
||||||
fixed_container_type*,
|
fixed_container_type*,
|
||||||
typename std::remove_const<fixed_container_type>::type
|
typename std::remove_const<fixed_container_type>::type
|
||||||
>::type holder_type;
|
>::type holder_type;
|
||||||
typedef typename sprout::detail::if_c<
|
typedef typename std::conditional<
|
||||||
is_reference,
|
is_reference,
|
||||||
fixed_container_type&,
|
fixed_container_type&,
|
||||||
fixed_container_type const&
|
fixed_container_type const&
|
||||||
>::type param_type;
|
>::type param_type;
|
||||||
typedef fixed_container_type const& const_param_type;
|
typedef fixed_container_type const& const_param_type;
|
||||||
protected:
|
protected:
|
||||||
typedef typename sprout::detail::if_c<
|
typedef typename std::conditional<
|
||||||
std::is_array<holder_type>::value,
|
std::is_array<holder_type>::value,
|
||||||
sprout::detail::is_non_reference_array_tag,
|
sprout::detail::is_non_reference_array_tag,
|
||||||
sprout::detail::is_not_non_reference_array_tag
|
sprout::detail::is_not_non_reference_array_tag
|
||||||
|
|
Loading…
Reference in a new issue