3 // Copyright Neil Groves 2009. Use, modification and
4 // distribution is subject to the Boost Software License, Version
5 // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
9 // For more information, see http://www.boost.org/libs/range/
11 #ifndef BOOST_RANGE_TEST_FUNCTIONS_CHECK_EQUAL_FN_HPP_INCLUDED
12 #define BOOST_RANGE_TEST_FUNCTIONS_CHECK_EQUAL_FN_HPP_INCLUDED
14 #include "counted_function.hpp"
18 namespace range_test_function
20 template< class Collection >
21 class check_equal_fn : private counted_function
23 typedef BOOST_DEDUCED_TYPENAME Collection::const_iterator iter_t;
25 explicit check_equal_fn( const Collection& c )
26 : m_it(boost::begin(c)), m_last(boost::end(c)) {}
28 using counted_function::invocation_count;
30 void operator()(int x) const
33 BOOST_CHECK( m_it != m_last );
36 BOOST_CHECK_EQUAL( *m_it, x );
46 } // namespace range_test_function
49 #endif // include guard