const_mem_fun1_t 클래스

포인터 인수를 사용하여 const 초기화할 때 단일 인수를 사용하는 멤버 함수를 이진 함수 개체로 호출할 수 있도록 하는 어댑터 클래스입니다. C++11에서 사용되지 않으며 C++17에서 제거되었습니다.

구문

template <class Result, class Type, class Arg>
class const_mem_fun1_t : public binary_function<const Type *, Arg, Result>
{
    explicit const_mem_fun1_t(Result (Type::* member_ptr)(Arg) const);
    Result operator()(const Type* left, Arg right) const;
};

매개 변수

member_ptr
함수 개체로 변환할 Type 클래스의 멤버 함수 포인터입니다.

left
const member_ptr 멤버 함수가 호출되는 개체입니다.

right
member_ptr 지정되는 인수입니다.

Return Value

조정 가능한 이항 함수입니다.

설명

클래스 템플릿은 클래스의 멤버 함수Type에 대한 포인터여야 하는 member_ptr 복사본을 프라이빗 멤버 개체에 저장합니다. 해당 멤버 함수 operator() 를 반환으로 정의합니다 (left->member_ptr)(right) const.

예시

const_mem_fun1_t의 생성자는 직접 사용되는 경우가 거의 없습니다. mem_fn 는 멤버 함수를 조정하는 데 사용됩니다. 멤버 함수 어댑터를 사용하는 방법에 대한 예제는 mem_fn 참조하세요.