Boost logo

Boost :

From: Beman Dawes (beman_at_[hidden])
Date: 1999-07-13 07:41:09


If this was a perfect world, or a standards committee, I wouldn't
have to be writing this message. But in the real world, where
compilers don't all conform to standards, we need a way to specify
compiler configuration information.

While few like doing so, the most practical way of coping with small
platform dependencies is via macros. Both program maintenance and
porting costs are minimized by defining the macros in a single
configuration file.

For example, boost/smart_ptr.h uses member templates if available,
controlled by the definition or lack of a macro
BOOST_NMEMBER_TEMPLATES. So that most users to not need to even know
about this possible compiler shortcoming, smart_ptr.h should #include
<boost/config.h> (or whatever name).

Here is a first cut at config.h. Comments appreciated.

--Beman

--------

// Boost configuration header file
-----------------------------------------//

// (C) Copyright Boost.org 1999. Permission to copy, use, modify,
sell and
// distribute this software is granted provided this copyright
notice appears
// in all copies. This software is provided "as is" without express
or implied
// warranty, and with no claim as to its suitability for any
purpose.

// See http://www.boost.org for most recent version including
documentation.

// This header is used to pass configuration information to other
boost files,
// to allow them to cope with platform dependencies such as compiler
// shortcomings.
//
// Centralized configuration reduces the number of files which must
be modified
// when porting libraries to new platforms, or when compilers are
updated.
//
#ifndef BOOST_CONFIG_H
#define BOOST_CONFIG_H

// Flag macros should identify the absence of C++ Standard
conformance rather
// than its presence. This ensures that standard conforming
compilers do not
// require a lot of configuration flag macros. It places the burden
where it
// should be, on non-conforming compilers. It means, hopefully,
that in the
// future less rather than more conformance flags will have to be
defined.

// Flag Macros
-------------------------------------------------------------//
//
// BOOST_NMEMBER_TEMPLATES: define if compiler doesn't support
member templates

// Compilers are listed in alphabetic order
--------------------------------//

// Microsoft (excluding Intel/EDG front end)
-------------------------------//

# if defined( _MSC_VER ) && (!defined( __ICL )
# if _MSC_VER <= 1200 // 1200 == VC++ 6.0
# define BOOST_NMEMBER_TEMPLATES
# endif
# endif // Microsoft (excluding Intel/EDG frontend)

#endif // BOOST_CONFIG_H

------------------------------------------------------------------------

eGroups.com home: http://www.egroups.com/group/boost
http://www.egroups.com - Simplifying group communications


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