A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.com/reference/functional/const_mem_fun1_t/ below:

class template

<functional>

std::const_mem_fun1_t
template <class S, class T, class A> class const_mem_fun1_t;

Generate function object class from single-parameter const member (pointer version)

Generates a binary function object class from a constant member of class

T

that takes an argument of type

A

and returns a value of type

S

.

const_mem_fun1_t is generally used as a type. The function mem_fun (also defined in header <functional>) can be used to directly construct an object of this type.

This class is derived from binary_function and is typically defined as:

1
2
3
4
5
6
7
8
9
template <class S, class T, class A>
  class mem_fun1_t : public binary_function <T*,A,S>
{
  S (T::*pmem)(A) const;
public:
  explicit mem_fun1_t ( S (T::*p)(A) const ) : pmem (p) {}
  S operator() (T* p, A x) const
    { return (p->*pmem)(x); }
};


Members
constructor
Constructs a binary function object class from const member function p of class T. The return type of this member function shall be type compatible with type S.
S operator() (T* p, A x)
Member function taking two parameters: p is a pointer to an object of type T whose const member is to be called with x as argument.

See also
mem_fun
Convert member function to function object (pointer version) (function template)
mem_fun1_t
Generate function object class from single-parameter member (pointer version) (class template)
const_mem_fun_t
Generate function object class from const parameterless member (pointer version) (class template)
binary_function
Binary function object base class (class template)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4