Global QuantLib macros


Detailed Description

Global definitions and quite a few macros which help porting the code to different compilers


Defines

#define QL_HEX_VERSION   0x000303f0
 version hexadecimal number

#define QL_VERSION   "0.3.3"
 version string

#define QL_TRACE_LEVEL   0
 global trace level (may be superseded locally by a greater value)

#define QL_DUMMY_RETURN(x)
 Is a dummy return statement required?

#define QL_IO_INIT   std::cout << std::string();
 I/O initialization.


Define Documentation

#define QL_DUMMY_RETURN  ) 
 

Is a dummy return statement required?

Some compilers will issue a warning if it is missing even though it could never be reached during execution, e.g., after a block like

    if (condition)
        return validResult;
    else
        throw HideousError();
On the other hand, other compilers will issue a warning if it is present because it cannot be reached. For the code to be portable this macro should be used after the block.

#define QL_IO_INIT   std::cout << std::string();
 

I/O initialization.

Sometimes, programs compiled with the free Borland compiler will crash miserably upon attempting to write on std::cout. Strangely enough, issuing the instruction

    std::cout << std::string();
at the beginning of the program will prevent other accesses to std::cout from crashing the program. This macro, to be called at the beginning of main(), encapsulates the above enchantment for Borland and is defined as empty for the other compilers.


QuantLib.org
QuantLib
Hosted by
SourceForge.net Logo
Documentation generated by
doxygen