mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2024-11-12 21:09:01 +00:00
fix: sub_array - support STL container
This commit is contained in:
parent
d99a7d1436
commit
ace6acad69
2 changed files with 16 additions and 14 deletions
|
@ -19,21 +19,23 @@ namespace sprout {
|
|||
class pit
|
||||
: public sprout::container_traits_facade<Container>
|
||||
{
|
||||
private:
|
||||
typedef sprout::container_traits_facade<typename std::remove_reference<Container>::type> facade_type;
|
||||
public:
|
||||
typedef Container container_type;
|
||||
typedef typename sprout::container_traits_facade<Container>::value_type value_type;
|
||||
typedef typename sprout::container_traits_facade<Container>::reference reference;
|
||||
typedef typename sprout::container_traits_facade<Container>::const_reference const_reference;
|
||||
typedef typename facade_type::value_type value_type;
|
||||
typedef typename facade_type::reference reference;
|
||||
typedef typename facade_type::const_reference const_reference;
|
||||
typedef typename sprout::value_iterator<reference> iterator;
|
||||
typedef typename sprout::value_iterator<const_reference> const_iterator;
|
||||
typedef typename sprout::container_traits_facade<Container>::size_type size_type;
|
||||
typedef typename sprout::container_traits_facade<Container>::difference_type difference_type;
|
||||
typedef typename sprout::container_traits_facade<Container>::pointer pointer;
|
||||
typedef typename sprout::container_traits_facade<Container>::const_pointer const_pointer;
|
||||
typedef typename facade_type::size_type size_type;
|
||||
typedef typename facade_type::difference_type difference_type;
|
||||
typedef typename facade_type::pointer pointer;
|
||||
typedef typename facade_type::const_pointer const_pointer;
|
||||
typedef typename sprout::reverse_iterator<iterator> reverse_iterator;
|
||||
typedef typename sprout::reverse_iterator<const_iterator> const_reverse_iterator;
|
||||
public:
|
||||
SPROUT_STATIC_CONSTEXPR size_type enumerable_size = sprout::detail::static_size_or_zero<sprout::container_traits_facade<Container> >::value;
|
||||
SPROUT_STATIC_CONSTEXPR size_type enumerable_size = sprout::detail::static_size_or_zero<facade_type>::value;
|
||||
public:
|
||||
value_type elem;
|
||||
public:
|
||||
|
|
|
@ -185,7 +185,7 @@ namespace sprout {
|
|||
typedef typename facade_type::pointer pointer;
|
||||
typedef typename facade_type::const_pointer const_pointer;
|
||||
public:
|
||||
SPROUT_STATIC_CONSTEXPR size_type static_size = facade_type::static_size;
|
||||
SPROUT_STATIC_CONSTEXPR size_type enumerable_size = sprout::detail::static_size_or_zero<facade_type>::value;
|
||||
public:
|
||||
typedef typename impl_type::holder_type holder_type;
|
||||
typedef typename impl_type::param_type param_type;
|
||||
|
@ -203,7 +203,7 @@ namespace sprout {
|
|||
: impl_type(
|
||||
array_tag(),
|
||||
arr,
|
||||
sprout::index_range<0, static_size>::make(),
|
||||
sprout::index_range<0, enumerable_size>::make(),
|
||||
first,
|
||||
last
|
||||
)
|
||||
|
@ -212,7 +212,7 @@ namespace sprout {
|
|||
: impl_type(
|
||||
array_tag(),
|
||||
arr,
|
||||
sprout::index_range<0, static_size>::make(),
|
||||
sprout::index_range<0, enumerable_size>::make(),
|
||||
first,
|
||||
last
|
||||
)
|
||||
|
@ -221,7 +221,7 @@ namespace sprout {
|
|||
: impl_type(
|
||||
array_tag(),
|
||||
impl_type::template to_param<Container>(other.array_),
|
||||
sprout::index_range<0, static_size>::make(),
|
||||
sprout::index_range<0, enumerable_size>::make(),
|
||||
sprout::distance(sprout::begin(other.get_array()), first),
|
||||
sprout::distance(sprout::begin(other.get_array()), last)
|
||||
)
|
||||
|
@ -230,7 +230,7 @@ namespace sprout {
|
|||
: impl_type(
|
||||
array_tag(),
|
||||
impl_type::template to_param<Container>(other.array_),
|
||||
sprout::index_range<0, static_size>::make(),
|
||||
sprout::index_range<0, enumerable_size>::make(),
|
||||
first + other.first_,
|
||||
last + other.first_
|
||||
)
|
||||
|
@ -355,7 +355,7 @@ namespace sprout {
|
|||
}
|
||||
};
|
||||
template<typename Container>
|
||||
SPROUT_CONSTEXPR_OR_CONST typename sprout::sub_array<Container>::size_type sprout::sub_array<Container>::static_size;
|
||||
SPROUT_CONSTEXPR_OR_CONST typename sprout::sub_array<Container>::size_type sprout::sub_array<Container>::enumerable_size;
|
||||
|
||||
//
|
||||
// swap
|
||||
|
|
Loading…
Reference in a new issue