Skip to content
Modern c ++17 library containing delegate which is a data structure that refers to a static method or to a class instance and an instance method of that class.
C++ CMake Shell Batchfile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs/pictures
examples
scripts
src
tests
.appveyor.yml
.codecov.yml
.codedocs
.doxygen.txt
.gitignore
.gitmodules
.travis.yml
CMakeLists.txt
LICENSE.md
README.md

README.md

delegates

Build Status Build status codecov Documentation Website license SourceForge Download delegates GitHub top language Windows macOS Linux

Features

For more information see Documentation.

Examples

The classic first application 'Hello World'.

src/delegates_hello_world.cpp:

#include <xtd/xtd.delegates>
#include <iostream>
#include <string>

using namespace std;
using namespace xtd;

// The main entry point for the application.
int main() {
  delegate<void(string str)> write_line;
  
  write_line += [&](string str)  {
    cout << str << endl;
  };
  
  write_line += [&](string str)  {
    cerr << str << endl;
  };
  
  write_line("Hello, world!");
}

CMakeLists.txt:

cmake_minimum_required(VERSION 3.3)

project(delegates_hello_world)
find_package(xtd.delegates REQUIRED)
add_executable(${PROJECT_NAME} src/delegates_hello_world.cpp)
target_link_libraries(${PROJECT_NAME} xtd.delegates)

For more examples see examples

Download and install

Before running examples you must download and install delegates. To download and install it read Downloads file.

You can’t perform that action at this time.