Boost logo

Boost :

From: Ed Brey (brey_at_[hidden])
Date: 1999-09-29 08:57:11


Beman Dawes wrote:
>
> 2) is my preference for .cpp files. But also check the C header is needed
> at all. I have caught myself using <climits> for problems better solved
> via <limits>.

Perhaps there is a saving grace here. There probably are only a few C
header functions that the boost libraries will need to access until
compilers come up to speed (~Y3K for M$). Given this, a workaround
could look like this:

// config.hpp
 ...
# elif defined( _MSC_VER ) && !defined( __ICL )
# if _MSC_VER <= 1200 // 1200 == VC++ 6.0
# define BOOST_NO_MEMBER_TEMPLATES
# define BOOST_NO_NAMESPACE_FOR_STDC
# endif
# endif // Microsoft (excluding Intel/EDG frontend)

 ...

#ifdef BOOST_NO_NAMESPACE_FOR_STDC
#include <cmath>
namespace std {
        inline int abs(int x) {return ::abs(x);}
        inline long abs(long x) {return ::labs(x);}
         ...
        }
#endif

The key is that the list of redefinitions need not be exhaustive, but
rather only what we need. And since C++ essentially deprecates many
C-isms, "what we need" should be reasonably small.


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