Boost logo

Boost :

From: Vesa Karvonen (vesa.karvonen_at_[hidden])
Date: 2001-08-27 08:34:09


The type traits library defines several macros that are supposed to be
redefined by library users. Unfortunately the macros are not defined so that
they could be redefined without modifying the type traits code directly. For
example, the BOOST_IS_UNION is unconditionally defined like this:

    #define BOOST_IS_UNION(T) false

Modifying the type traits code directly is not a good approach, because it
would result in extra work for each users each time a new version of type
traits is released (or possibly extra work each time a new version of Boost is
released).

Therefore type traits should support redefining the compiler support macros
without having to modify the type traits code. Furthermore, many users may be
using type traits on multiple compilers already, so modifying the type traits
headers directly can become a maintenance nightmare.

A simple technique for supporting external redefinition is to define the macro
defaults conditionally:

    #ifndef BOOST_IS_UNION
    #define BOOST_IS_UNION(T) false
    #endif

[Of course, all of this can be rather safely ignored, because the number of
compilers with the special support is negligibly small.]


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk