equal_to_value.hpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // (C) Copyright Ion Gaztanaga 2014-2014
  4. //
  5. // Distributed under the Boost Software License, Version 1.0.
  6. // (See accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. //
  9. // See http://www.boost.org/libs/intrusive for documentation.
  10. //
  11. /////////////////////////////////////////////////////////////////////////////
  12. #ifndef BOOST_INTRUSIVE_DETAIL_EQUAL_TO_VALUE_HPP
  13. #define BOOST_INTRUSIVE_DETAIL_EQUAL_TO_VALUE_HPP
  14. #ifndef BOOST_CONFIG_HPP
  15. # include <boost/config.hpp>
  16. #endif
  17. #if defined(BOOST_HAS_PRAGMA_ONCE)
  18. # pragma once
  19. #endif
  20. #include <boost/intrusive/detail/workaround.hpp>
  21. namespace boost {
  22. namespace intrusive {
  23. namespace detail {
  24. //This functor compares a stored value
  25. //and the one passed as an argument
  26. template<class ConstReference>
  27. class equal_to_value
  28. {
  29. ConstReference t_;
  30. public:
  31. equal_to_value(ConstReference t)
  32. : t_(t)
  33. {}
  34. BOOST_INTRUSIVE_FORCEINLINE bool operator()(ConstReference t)const
  35. { return t_ == t; }
  36. };
  37. } //namespace detail{
  38. } //namespace intrusive{
  39. } //namespace boost{
  40. #endif //BOOST_INTRUSIVE_DETAIL_EQUAL_TO_VALUE_HPP