typedef System::Action

Action typedef

Type de délégué qui référence des méthodes qui n’ont pas de valeur de retour.

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

Remarques

#include <system/action.h>

using namespace System;

// La fonction qui affiche la chaîne passée.
void PrintString(const String &string)
{
  using namespace std;
  cout << string << endl;
}

int main()
{
  // Créez une instance de Action.
  auto action = Action<String>(std::bind(&PrintString, std::placeholders::_1));

  // Appelez l'action.
  action(u"Hello, world!");

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

Voir aussi