Patterns & Practices

cmakepp: Expression Syntax

“CMake’s syntax is not sexy.” Is a statement that probably everyone can understand. It does not allow the developer rudimentary constructs which almost all other languages have. But because CMake’s language is astonishingly flexible I was able to create a lexer and parser and interpreter for a custom 100 % compatible syntax which (once “JIT…

Renameable Namespaces using the Preprocessor

Motivation If you are starting to work on a library and do not know exactly how your namespaces are going end up these macro helper are for you. I have written helpers that simplify using namespaces and lets you build up your namespaces with preprocessor defines. This allows you to quickly rename your namespaces which…

An Alternative typedef Syntax using the C++ Preprocessor

Disclaimer: This post will be more interesting to you if you work with the preprocessor. Here you can find a preprocessor only solution for changing the typedef syntax from typedef int number_type; to int typedef_as number_type; – an alternative typedef Syntax. If your wondering where this might be useful let me tell you why I…

dynamically calling “any” thing in C++

Extending upon boost’s any class which stores a type and a void ptr to any type of value, I created a callable version were you can assign any function, lambda, memberfunction etc. to the any and call it dynamically. This is a basic and important step for runtime reflection which I’m currently working on. Tell…

is_callable type trait

I’ve developed a type_trait for checking if a type is callable, ie has defined a single operator(). Also on ideone Tell me if you like it or if you know of a better version 😀 /// function traits for member functions // gives you the class_type, return_type and arguments tuple for any member function (const…