CASM
1.1.0
A Clusters Approach to Statistical Mechanics
|
#include <definitions.hh>
For any binary functor class that accepts two arguments, such as an equals or compare functor, create a unary functor that stores a reference to the LHS value, and a reference to the binary functor, which then only needs to be provided the RHS value. This is useful for cases where one wants to use a binary functor in the context of something like std::find_if
Example: UnaryCompare_f<BinaryCompare_f> equals_target_element(target_element,args,for,binary,comapre); std::find_if(v.begin(),v.end(),equals_target_element);
Definition at line 59 of file definitions.hh.
Public Types | |
using | argument_type = notstd::first_argument_type< BinaryCompare > |
Public Member Functions | |
template<typename... CompareArgs> | |
UnaryCompare_f (const argument_type &lhs, const CompareArgs &... args) | |
bool | operator() (const argument_type &rhs) |
Private Attributes | |
const argument_type & | m_lhs |
const BinaryCompare | m_compare_method |
using CASM::UnaryCompare_f< BinaryCompare >::argument_type = notstd::first_argument_type<BinaryCompare> |
Definition at line 61 of file definitions.hh.
|
inline |
Definition at line 64 of file definitions.hh.
|
inline |
Definition at line 67 of file definitions.hh.
|
private |
Definition at line 75 of file definitions.hh.
|
private |
Definition at line 74 of file definitions.hh.