greater_than_x.hpp 915 B

1234567891011121314151617181920212223242526272829303132
  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_FUNCTION_GREATER_THAN_X_HPP_INCLUDED
  12. #define BOOST_RANGE_TEST_FUNCTION_GREATER_THAN_X_HPP_INCLUDED
  13. namespace boost
  14. {
  15. namespace range_test_function
  16. {
  17. template< class Number >
  18. struct greater_than_x
  19. {
  20. typedef bool result_type;
  21. typedef Number argument_type;
  22. explicit greater_than_x(Number x) : m_x(x) {}
  23. bool operator()(Number x) const { return x > m_x; }
  24. private:
  25. Number m_x;
  26. };
  27. } // namespace range_test_function
  28. } // namespace boost
  29. #endif // include guard