mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2024-12-23 21:25:49 +00:00
fixed_container_traits をデフォルトで const に対応
This commit is contained in:
parent
10c46d9b85
commit
7abc568a53
2 changed files with 21 additions and 21 deletions
|
@ -36,26 +36,8 @@ namespace sprout {
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef sscrisk::cel::array<T, N> fixed_container_type;
|
typedef sscrisk::cel::array<T, N> fixed_container_type;
|
||||||
typedef fixed_container_type internal_type;
|
typedef sscrisk::cel::array<T, N> internal_type;
|
||||||
typedef internal_type clone_type;
|
typedef sscrisk::cel::array<T, N> clone_type;
|
||||||
typedef sprout::index_iterator<fixed_container_type&> iterator;
|
|
||||||
typedef sprout::index_iterator<fixed_container_type const&> const_iterator;
|
|
||||||
public:
|
|
||||||
SPROUT_STATIC_CONSTEXPR typename sprout::detail::fixed_container_traits_base<fixed_container_type>::size_type fixed_size
|
|
||||||
= std::tuple_size<typename std::remove_const<internal_type>::type>::value
|
|
||||||
;
|
|
||||||
};
|
|
||||||
//
|
|
||||||
// fixed_container_traits
|
|
||||||
//
|
|
||||||
template<typename T, std::size_t N>
|
|
||||||
struct fixed_container_traits<sscrisk::cel::array<T, N> const>
|
|
||||||
: public sprout::detail::fixed_container_traits_base<sscrisk::cel::array<T, N> const>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
typedef sscrisk::cel::array<T, N> const fixed_container_type;
|
|
||||||
typedef typename std::remove_const<fixed_container_type>::type internal_type;
|
|
||||||
typedef internal_type clone_type;
|
|
||||||
typedef sprout::index_iterator<fixed_container_type&> iterator;
|
typedef sprout::index_iterator<fixed_container_type&> iterator;
|
||||||
typedef sprout::index_iterator<fixed_container_type const&> const_iterator;
|
typedef sprout::index_iterator<fixed_container_type const&> const_iterator;
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -48,7 +48,7 @@ namespace sprout {
|
||||||
typedef Container internal_type;
|
typedef Container internal_type;
|
||||||
typedef Container clone_type;
|
typedef Container clone_type;
|
||||||
public:
|
public:
|
||||||
SPROUT_STATIC_CONSTEXPR typename sprout::detail::fixed_container_traits_base<Container>::size_type fixed_size
|
SPROUT_STATIC_CONSTEXPR typename sprout::detail::fixed_container_traits_base<fixed_container_type>::size_type fixed_size
|
||||||
= std::tuple_size<typename std::remove_const<internal_type>::type>::value
|
= std::tuple_size<typename std::remove_const<internal_type>::type>::value
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
|
@ -63,6 +63,24 @@ namespace sprout {
|
||||||
public:
|
public:
|
||||||
SPROUT_STATIC_CONSTEXPR typename sprout::detail::fixed_container_traits_base<T[N]>::size_type fixed_size = N;
|
SPROUT_STATIC_CONSTEXPR typename sprout::detail::fixed_container_traits_base<T[N]>::size_type fixed_size = N;
|
||||||
};
|
};
|
||||||
|
template<typename Container>
|
||||||
|
struct fixed_container_traits<Container const>
|
||||||
|
: public sprout::fixed_container_traits<Container>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef typename sprout::fixed_container_traits<Container>::const_iterator iterator;
|
||||||
|
typedef typename sprout::fixed_container_traits<Container>::const_reference reference;
|
||||||
|
typedef typename sprout::fixed_container_traits<Container>::const_pointer pointer;
|
||||||
|
};
|
||||||
|
template<typename T, std::size_t N>
|
||||||
|
struct fixed_container_traits<T const[N]>
|
||||||
|
: public sprout::fixed_container_traits<T[N]>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
typedef typename sprout::fixed_container_traits<T[N]>::const_iterator iterator;
|
||||||
|
typedef typename sprout::fixed_container_traits<T[N]>::const_reference reference;
|
||||||
|
typedef typename sprout::fixed_container_traits<T[N]>::const_pointer pointer;
|
||||||
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
// rebind_fixed_size
|
// rebind_fixed_size
|
||||||
|
|
Loading…
Reference in a new issue