function Class

래퍼 개체를 호출할 수 있습니다.

template<class Fty>
   class function  // Fty of type Ret(T1, T2, ..., TN)
   : public unary_function<T1, Ret>       // when Fty is Ret(T1)
   : public binary_function<T1, T2, Ret>  // when Fty is Ret(T1, T2)
   {
public:
   typedef Ret result_type;

   function();
   function(nullptr_t);
   function(const function& _Right);
   template<class Fty2>
      function(Fty2 fn);
   template<class Fty2, class Alloc>
       function (reference_wrapper<Fty2>, const Alloc& _Ax);
   template<class Fty2, class Alloc>
       void assign (Fty2, const Alloc& _Ax);
   template<class Fty2, class Alloc>
       assign (reference_wrapper<Fty2>, const Alloc& _Ax);
   function& operator=(nullptr_t);
   function& operator=(const function&);
   template<class Fty2>
      function& operator=(Fty2);
   template<class Fty2>
      function& operator=(reference_wrapper<Fty2>);
   void swap(function&);

   explicit operator bool() const;
   result_type operator()(T1, T2, ....., TN) const;

   const std::type_info& target_type() const;
   template<class Fty2>
      Fty2 *target();
   template<class Fty2>
      const Fty2 *target() const;
   template<class Fty2>
      void operator==(const Fty2&) const = delete;
   template<class Fty2>
      void operator!=(const Fty2&) const = delete;
};

매개 변수

  • Fty
    줄 바꿈 함수 형식입니다.

  • _Ax
    할당자 함수입니다.

설명

템플릿 클래스에 시그니처가 호출 되는 호출 래퍼입니다 Ret(T1, T2, ..., TN).균일 한 래퍼에 다양 한 개체를 호출할 때 사용 합니다.

원하는 대상 개체의 이름을 나타내는 피연산자 일부 멤버 함수를 사용 합니다.피연산자가 같은 여러 가지 방법으로 지정할 수 있습니다.

fn-호출 가능 개체 fn. 호출 후에 function 개체의 복사본을 보유fn

fnref-호출 가능 개체 명명 fnref.get(). 호출 후에 function 개체에 대 한 참조를 보유fnref.get()

right-개체를 호출할 수 있는 경우, 소유 하는 function 개체right

npc-null 포인터입니다. 호출 후에 function 개체가 비어

모든 경우에 INVOKE(f, t1, t2, ..., tN)여기서 f 호출할 개체입니다 및 t1, t2, ..., tN 는 lvalue가 형식의 T1, T2, ..., TN 각각 올바른 형식의 xml 이어야 경우 Ret 되지 않은 void, 변환할 수 있는 Ret.

빈 function 호출 가능 개체나 호출 가능 개체에 대 한 참조 개체를 포함 하지 않습니다.

Bb982519.collapse_all(ko-kr,VS.110).gif생성자

function::function

또는 비어 있는 임의 형식의 고정 된 시그니처가 호출 가능 개체를 저장 하는 래퍼를 생성 합니다.

Bb982519.collapse_all(ko-kr,VS.110).gif형식 정의

function::result_type

반환 형식 저장된 호출할 개체입니다.

Bb982519.collapse_all(ko-kr,VS.110).gif멤버 함수

function::assign

이 함수 개체는 호출 가능한 개체를 할당합니다.

function::swap

두 호출 가능 개체를 바꿉니다.

function::target

지정한 대로 호출할 호출 가능 개체를 저장 하는 경우 테스트입니다.

function::target_type

가져옵니다 호출 가능 객체에 정보를 입력합니다.

Bb982519.collapse_all(ko-kr,VS.110).gif연산자

function::operator unspecified

호출할 수 있는 개체를 저장 하는 경우 테스트가 있습니다.

function::operator()

호출 하는 개체를 호출합니다.

function::operator=

호출할 수 있는 저장 된 개체를 대체합니다.

요구 사항

헤더: <functional>

네임 스페이스: std

참고 항목

참조

mem_fn Function

reference_wrapper Class