A trivial example program.
#include <string>
#include <iostream>
#include "caf/all.hpp"
using std::endl;
using std::string;
return {
[=](const string& what) -> string {
aout(self) << what << endl;
self->quit();
return string(what.rbegin(), what.rend());
}
};
}
self->sync_send(buddy, "Hello World!").then(
[=](const string& what) {
aout(self) << what << endl;
}
);
}
int main() {
auto mirror_actor =
spawn(mirror);
spawn(hello_world, mirror_actor);
}