Class const_mem_fun_t

Synopsis

#include <include/EASTL/functional.h>

template <typename Result, typename T>
class const_mem_fun_t : public unary_function<const T*, Result>

Description

const_mem_fun_t

Const member function with no arguments. Note that we inherit from unary_function<const T*, Result> instead of what the C++ standard specifies: unary_function<T*, Result>. The C++ standard is in error and this has been recognized by the defect group.

Inheritance

Ancestors: unary_function

Methods

const_mem_fun_t
operator()

Source

Lines 715-734 in include/EASTL/functional.h.

template <typename Result, typename T>
class const_mem_fun_t : public unary_function<const T*, Result>
{
public:
    typedef Result (T::*MemberFunction)() const;
    inline explicit const_mem_fun_t(MemberFunction pMemberFunction)
        : mpMemberFunction(pMemberFunction)
    {
        // Empty
    }
    inline Result operator()(const T* pT) const
    {
        return (pT->*mpMemberFunction)();
    }
protected:
    MemberFunction mpMemberFunction;
};





Add Discussion as Guest

Log in