cds  2.3.2
cds::opt::equal_to< Functor > Struct Template Reference

[type-option] Option setter for opt::equal_to predicate More...

#include <cds/opt/compare.h>

Detailed Description

template<typename Functor>
struct cds::opt::equal_to< Functor >

[type-option] Option setter for opt::equal_to predicate

The option sets a binary predicate that tests whether a value of a specified type is equal to another value of that type. Functor interface is similar to std::equal_to predicate interface. The standard predicate std::equal_to can act as Functor:

In addition, the option setter may sets non-standard 2-type (or even N-type) predicate (std::binary_function):

struct foo {
int n;
};
template <typename T, typename Q>
struct pred_equal_to {
bool operator ()( const T& t, const Q& q )
{ return t.n == q ; }
bool operator ()( const Q& q, const T& t )
{ return q == t.n ; }
bool operator ()( const T& t1, const T& t2 )
{ return t1.n == t2.n ; }
bool operator ()( const Q& q1, const Q& q2 )
{ return q1 == q2 ; }
};

Generally, the default type for Functor is std::equal_to but it depends on the container used.


The documentation for this struct was generated from the following file:

cds 2.3.2 Developed by Maxim Khizhinsky aka khizmax and other contributors 2007 - 2017
Autogenerated Sun Dec 31 2017 12:10:49 by Doxygen 1.8.13