Mirror reflection library - Lagoon run-time layer 0.5.13

lagoon/range/contains.hpp

Go to the documentation of this file.
00001 
00010 #ifndef LAGOON_RANGE_CONTAINS_1011291729_HPP
00011 #define LAGOON_RANGE_CONTAINS_1011291729_HPP
00012 
00013 #include <lagoon/lagoon_fwd.hpp>
00014 
00015 LAGOON_NAMESPACE_BEGIN
00016 
00017 #ifdef MIRROR_DOCUMENTATION_ONLY
00018 
00019 
00028 template <class Range, typename Predicate>
00029 bool contains(Range range, Predicate predicate);
00030 #else
00031 template <class Range, typename Predicate>
00032 bool contains(Range range, Predicate predicate)
00033 {
00034     while(!range.empty())
00035     {
00036         if(predicate(range.front())) return true;
00037         else range.step_front();
00038     }
00039     return false;
00040 }
00041 #endif
00042 
00043 LAGOON_NAMESPACE_END
00044 
00045 #endif //include guard
00046 

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.