System::Action typedef

Action typedef

Delegatietype dat methoden verwijst die geen retourwaarde hebben.

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

Opmerkingen

#include <system/action.h>

using namespace System;

// De functie die de meegegeven string afdrukt.
void PrintString(const String &string)
{
  using namespace std;
  cout << string << endl;
}

int main()
{
  // Maak een instantie van Action.
  auto action = Action<String>(std::bind(&PrintString, std::placeholders::_1));

  // Roep de actie aan.
  action(u"Hello, world!");

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

Zie ook