Playing with C++11. A typechecked printf, among other things.
C++ Scheme
Latest commit 82e887d Feb 29, 2012 @krig in before destruction
Permalink
Failed to load latest commit information.
src in before destruction Feb 29, 2012
.gitignore Initial commit Feb 12, 2012
Readme.md Initial commit Feb 12, 2012
main.aap Started splitting the cell/cellgc code into separate files Feb 28, 2012

Readme.md

k11 - playing with C++11

Where I play with fancy new C++11 features, and also make a library of (hopefully) useful things.

What's there now

  • src/tests/* - various small tests of C++11 features.

  • print.hpp - A typechecked printf/fprintf. Adapted from a lecture by Andrei Alexandrescu.

Examples of use:

using namespace print;

pr("Hello, world!\n"); // same as printf
pn("Hello, world!"); // printf + \n
string world = "World";
pr("Hello, %s!\n", world); // print std::strings directly
pn("Hello, %s!", false); // print bools into %s (prints true or false)

// most regular format strings should pass
pn("Char: %c %c", 'a', 65);
pn("Numbers: %#x %i %03d %u", 300, 50, -30, 18U);
pn("Pointer: %08p", (char*)nullptr);