Boost logo

Boost :

From: Beman Dawes (beman_at_[hidden])
Date: 1999-09-29 08:44:29


John Maddock wrote:

>>On the system where the library isn't in std (and
>only those), if you #define std /*nothing*/, then
>std::printf works fine.<
>
>Thats fine, but what if the C++ library is in std, and the C libary is in
>::
>std::printf will be fine but now try and use std::list and your stuffed,
>this is problem that I'm trying to work around - unfortunately this is the
>problem which occurs in a compiler that has a very large market share -
>MSVC.

Yes, that is the problem that worries me too. I think we shouldn't support
compilers which don't place the C++ lib in namespace std, but the C lib not
being in namespace std is a problem some boost libraries will wish to deal
with.

Is this a viable approach? Say you need to use size_t:

#include <cstdlib>
#include <boost/config.hpp>

#ifndef BOOST_C_LIB_NOT_NAMESPACE_STD
using std::size_type;
#endif

... size_t blah, blah, blah

>Perhaps I can pick your brains on a another related issue as well?
>
>The problem is that some implementations of std::locale are distictly
>non-standard (MSVC again) or absent altogether (SGI/gcc), now I can either
>target only those implementaions that are standard (which means Rogue
>Wave's standard libary + a decent compiler) or I can work around the
>problem with a couple of macros for use_facet and has_facet, or use the C
>localisation/string API's which takes us back to C header problems....
>Before posting suggestions remember that this is all template code - which
>means it's all in headers until someone starts supporting template
>export....
>... all of which means its starting to feel kind of rocky (as in hard
>place) again :-)

I don't know what to say. But whatever you do, make sure it will
transition easily to conforming compilers. The policy is to make
non-conforming compilers the special cases, with the default being standard
conformance.

--Beman


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