functional_mem_fun_ref_t

functional_mem_fun_ref_t (멤버 함수 참조 래퍼)

이 페이지는 C++ 표준 라이브러리의 mem_fun_ref_t와 관련 클래스 템플릿에 대해 설명해요. 이들은 멤버 함수 포인터를 래핑해서, 객체 참조를 인자로 받는 함수 객체로 만들어 주는 역할을 해요. C++11에서 deprecated 되고 C++17에서 제거되었어요.

출처: cppreference

본문

정의

<functional> 헤더에 정의되어 있어요.

(1) mem_fun_ref_t:

template < class S , class T > class mem_fun_ref_t : public unary_function < T , S > { public : explicit mem_fun_ref_t ( S ( T ::* p )()); S operator ()( T & p ) const ; };

(2) const_mem_fun_ref_t:

template < class S , class T > class const_mem_fun_ref_t : public unary_function < T , S > { public : explicit const_mem_fun_ref_t ( S ( T ::* p )() const ); S operator ()( const T & p ) const ; };

(3) mem_fun1_ref_t:

template < class S , class T , class A > class mem_fun1_ref_t : public binary_function < T , A , S > { public : explicit mem_fun1_ref_t ( S ( T ::* p )( A )); S operator ()( T & p , A x ) const ; };

(4) const_mem_fun1_ref_t:

template < class S , class T , class A > class const_mem_fun1_ref_t : public binary_function < T , A , S > { public : explicit const_mem_fun1_ref_t ( S ( T ::* p )( A ) const ); S operator ()( const T & p , A x ) const ; };

이 네 가지 클래스 템플릿 모두 C++11에서 deprecated 처리되었고, C++17에서 제거되었어요.

설명

멤버 함수 포인터를 감싸는 래퍼예요. 호출할 멤버 함수를 가진 클래스 인스턴스는 operator()에 참조로 전달돼요.

같이 보기

  • mem_fun_ref (C++11에서 deprecated, C++17에서 제거) — 멤버 함수 포인터로부터 객체 참조로 호출 가능한 래퍼를 만들어 주는 함수 템플릿
  • mem_fun_t, mem_fun1_t, const_mem_fun_t, const_mem_fun1_t (C++11에서 deprecated, C++17에서 제거) — 객체 포인터로 호출 가능한 nullary 또는 unary 멤버 함수 포인터용 래퍼 (클래스 템플릿)

더 알아보기 (Learn more)

cppreference