Examples

Hello, languages

Three messages in English and Turkish: a greeting, an inbox line with a formatted number, and a multi-line usage text. WelcomeStr( "Ada", locale ) picks the language from the locale; std::cout << UsageStreamable( "hello" ) from the stream's.

Hello, languages
Read walkthrough
$STRING$STREAMABLE[TR]FORMATS
Errors that explain

ThrowConfigMissing( path ) throws a ConfigMissingException derived from std::exception whose what() is the message; FatalError( 7 ) prints to std::cerr and exits with 2; LogStarted( pid ) goes to syslog as LOG_DAEMON | LOG_NOTICE.

Errors that explain
Read walkthrough
$EXCEPTION$THROW$ERROR$SYSLOG
A real library: dsold

plugin's DSO loader generates its exceptions from two message files at build time: FileNotFound and SignatureRejected derive from the library's own Exception, implement its whatStr() and carry PLUGIN_EXPORT — the shared library is built with that macro as its visibility switch.

A real library: dsold
Read walkthrough
$EXPORTOVERRIDESHARED LIBRARY
Header-only modules

$MODULE alpha INLINE puts every definition into the header. Two INLINE modules and an ordinary one share a translation unit, two translation units include the same INLINE header, and it all links — plus what the generated string functions cost per call.

Header-only modules
Read walkthrough
INLINEHeader-onlyPERFORMANCE