Imported Upstream version 1.57.0
[platform/upstream/boost.git] / boost / intrusive / detail / equal_to_value.hpp
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
13 #ifndef BOOST_INTRUSIVE_DETAIL_EQUAL_TO_VALUE_HPP
14 #define BOOST_INTRUSIVE_DETAIL_EQUAL_TO_VALUE_HPP
15
16 #if defined(_MSC_VER)
17 #  pragma once
18 #endif
19
20 namespace boost {
21 namespace intrusive {
22 namespace detail {
23
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
31    public:
32    equal_to_value(ConstReference t)
33       :  t_(t)
34    {}
35
36    bool operator()(ConstReference t)const
37    {  return t_ == t;   }
38 };
39
40 }  //namespace detail{
41 }  //namespace intrusive{
42 }  //namespace boost{
43
44 #endif //BOOST_INTRUSIVE_DETAIL_EQUAL_TO_VALUE_HPP