In order to run code before main, the PARAM_BEGIN_REG/PARAM_END_REG macros set up code that looks approximately like this:
class GlobalCode { public: GlobalCode(void) { // insert code to be executed here. } } global_code;This creates a global object and therefore runs its constructor where the code to be executed is placed.
In order to avoid conflicts with other registration blocks in this file and others, the entire code is placed inside an anonymous namespace and then inside a namespace containing the line number.
The actual XParam code also guards against exceptions.