System::Action typedef

Action typedef

반환 값이 없는 메서드를 참조하는 대리자 유형.

using System::Action =  MulticastDelegate<void(Args...)>

비고

#include <system/action.h>

using namespace System;

// 전달된 문자열을 출력하는 함수.
void PrintString(const String &string)
{
  using namespace std;
  cout << string << endl;
}

int main()
{
  // Action의 인스턴스를 생성합니다.
  auto action = Action<String>(std::bind(&PrintString, std::placeholders::_1));

  // 액션을 호출합니다.
  action(u"Hello, world!");

  return 0;
}
/*
This code example produces the following output:
Hello, world!
*/

또 보기