CAF 0.17.6
Implicit Type Conversions

The message passing of libcaf prohibits pointers in messages because it enforces network transparent messaging.

The message passing of libcaf prohibits pointers in messages because it enforces network transparent messaging.

Unfortunately, string literals in C++ have the type const char*, resp.const char[]. Since libcaf 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 a string containing "hello actor!" to itself send(self, "hello actor!");

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

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