System::Action typedef

Action typedef

Τύπος delegate που αναφέρεται σε μεθόδους που δεν έχουν τιμή επιστροφής.

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.
  action(u"Hello, world!");

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

Δείτε επίσης