System::Action typedef

Action typedef

Delegattyp, der Methoden referenziert, die keinen Rückgabewert haben.

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

Hinweise

#include <system/action.h>

using namespace System;

// Die Funktion, die den übergebenen String ausgibt.
void PrintString(const String &string)
{
  using namespace std;
  cout << string << endl;
}

int main()
{
  // Erstelle eine Instanz von Action.
  auto action = Action<String>(std::bind(&PrintString, std::placeholders::_1));

  // Rufe die Aktion auf.
  action(u"Hello, world!");

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

Siehe auch