Mirror reflection library - Lagoon run-time layer 0.5.13

lagoon/range/utils.hpp

Go to the documentation of this file.
00001 
00010 #ifndef LAGOON_RANGE_UTILS_1011291729_HPP
00011 #define LAGOON_RANGE_UTILS_1011291729_HPP
00012 
00013 #include <lagoon/lagoon_fwd.hpp>
00014 #include <cassert>
00015 
00016 LAGOON_NAMESPACE_BEGIN
00017 namespace aux {
00018 
00019 class leaping_base
00020 {
00021 protected:
00022     template <typename Range>
00023     static inline size_t do_leap_front(Range& range, size_t leap)
00024     {
00025         size_t done = 0;
00026         while(done != leap)
00027         {
00028             if(range.empty()) break;
00029             range.step_front();
00030             ++done;
00031         }
00032         return done;
00033     }
00034 };
00035 
00036 } // namespace aux
00037 LAGOON_NAMESPACE_END
00038 
00039 #endif //include guard
00040 

Copyright © 2006-2011 Matus Chochlik, University of Zilina, Zilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Fri Dec 16 2011 by Doxygen (version 1.7.3).
Important note: Although the 'boostified' version of Mirror uses the Boost C++ libraries Coding Guidelines and is implemented inside of the boost namespace, it IS NOT an officially reviewed and accepted Boost library. Mirror is being developed with the intention to be submitted for review for inclusion to the Boost C++ libraries.