libcppa  Version 0.1
Functions
Implicit type conversions.

Functions

template<typename... Types>
tuple< Types...> make_tuple (const Types &...args)

Detailed Description

The message passing of libcppa prohibits pointers in messages because it enforces network transparent messaging. Unfortunately, string literals in C++ have the type const char*, resp. const char[]. Since libcppa is a user-friendly library, it silently converts string literals and C-strings to std::string objects. It also converts unicode literals to the corresponding STL container.

A few examples:

 // sends an std::string containing "hello actor!" to itself
 send(self(), "hello actor!");

 const char* cstring = "cstring";
 // sends an std::string containing "cstring" to itself
 send(self(), cstring);

 // sends an std::u16string containing the UTF16 string "hello unicode world!"
 send(self(), u"hello unicode world!");

 // x has the type cppa::tuple<std::string, std::string>
 auto x = make_tuple("hello", "tuple");

 receive
 (
     // equal to: on(std::string("hello actor!"))
     on("hello actor!") >> []() { }
 );

Function Documentation

template<typename... Types>
tuple< Types...> make_tuple ( const Types &...  args) [related]

Creates a new tuple from args.

Parameters:
argsValues for the tuple elements.
Returns:
A tuple object containing the values args.