equal_to_x.hpp 842 B

123456789101112131415161718192021222324252627282930313233
  1. // Boost.Range library
  2. //
  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)
  7. //
  8. //
  9. // For more information, see http://www.boost.org/libs/range/
  10. //
  11. #ifndef BOOST_RANGE_TEST_TEST_FUNCTION_EQUAL_TO_X_HPP_INCLUDED
  12. #define BOOST_RANGE_TEST_TEST_FUNCTION_EQUAL_TO_X_HPP_INCLUDED
  13. namespace boost
  14. {
  15. namespace range_test_function
  16. {
  17. template<class Arg>
  18. struct equal_to_x
  19. {
  20. typedef bool result_type;
  21. typedef Arg argument_type;
  22. explicit equal_to_x(Arg x) : m_x(x) {}
  23. bool operator()(Arg x) const { return x == m_x; }
  24. private:
  25. Arg m_x;
  26. };
  27. }
  28. }
  29. #endif // include guard