1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2025-08-03 12:49:50 +00:00

fix unfold

fix pair tuple support
This commit is contained in:
bolero-MURAKAMI 2012-09-28 16:05:09 +09:00
parent b1b7a9fefc
commit 06f1933220
3 changed files with 7 additions and 10 deletions

View file

@ -65,9 +65,7 @@ namespace sprout {
)
{
return size > 0
? size > 1
? sprout::fixed::detail::unfold_impl_1(cont, gen, gen(init), size, init)
: sprout::detail::container_complate(cont, init)
? sprout::fixed::detail::unfold_impl_1(cont, gen, gen(init), size)
: sprout::detail::container_complate(cont)
;
}

View file

@ -214,21 +214,20 @@ namespace sprout {
template<typename T1, typename T2>
struct get_impl<0, sprout::pair<T1, T2> > {
public:
T1& operator()(sprout::pair<T1, T2>& t) const {
SPROUT_CONSTEXPR T1& operator()(sprout::pair<T1, T2>& t) const {
return t.first;
}
T1 const& operator()(sprout::pair<T1, T2> const& t) const {
SPROUT_CONSTEXPR T1 const& operator()(sprout::pair<T1, T2> const& t) const {
return t.first;
}
};
template<typename T1, typename T2>
struct get_impl<1, sprout::pair<T1, T2> > {
public:
public:
T2& operator()(sprout::pair<T1, T2>& t) const {
SPROUT_CONSTEXPR T2& operator()(sprout::pair<T1, T2>& t) const {
return t.second;
}
T2 const& operator()(sprout::pair<T1, T2> const& t) const {
SPROUT_CONSTEXPR T2 const& operator()(sprout::pair<T1, T2> const& t) const {
return t.second;
}
};