Skip to content

Commit

Permalink
refs #16 Более элегантный код
Browse files Browse the repository at this point in the history
  • Loading branch information
izvolov committed Dec 24, 2015
1 parent 7293609 commit b7f51a8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions burst/iterator/detail/join_iterator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <boost/bind.hpp>
#include <boost/iterator/iterator_facade.hpp>
#include <boost/range/adaptor/reversed.hpp>
#include <boost/range/adaptor/transformed.hpp>
#include <boost/range/numeric.hpp>
#include <boost/static_assert.hpp>
#include <boost/type_traits/is_same.hpp>
Expand Down Expand Up @@ -218,12 +219,11 @@ namespace burst
m_inner_range_index(0),
m_items_passed(0)
{
m_items_passed = boost::accumulate
(
*m_ranges,
0u,
boost::bind(std::plus<typename range_type::size_type>(), _1, boost::bind(&range_type::size, _2))
);
const auto to_size = [] (const auto & r) { return r.size(); };

using boost::adaptors::transformed;
m_items_passed = boost::accumulate(*m_ranges | transformed(to_size), 0u);

m_outer_range_index = m_ranges->size();
}

Expand Down

0 comments on commit b7f51a8

Please sign in to comment.