Boost logo

Boost :

From: Dave Abrahams (abrahams_at_[hidden])
Date: 1999-10-09 17:06:35


> The point is to make non-conforming C standard libraries behave as if they
> were conforming - I guess an alternative would be something like:
>
> #include <cstdlib>
>
> namespace boost{
>
> #ifdef BOOST_NO_STDC_NAMESPACE
> using ::size_t;
> #else
> using std::size_t;
> #endif
>
> /* code goes here */
>
> } // namespace boost

Precisely what I had in mind.

> The downside is that if the user then adds:
>
> using namespace boost;
>
> they get most of namspace std as well as boost.

'most?'
This only looks like one name.

> On the other hand we could use:
>
> #include <cstdlib>
>
> namespace boost{
> namespace undocumented{
>
> #ifdef BOOST_NO_STDC_NAMESPACE
> using ::size_t;
> #else
> using std::size_t;
> #endif
>
> /* code goes here */
>
> } // namespace undocumented
> using boost::undocumented::some_public_symbol;

Why bother with this using declaration at all?
With it you still have the same drawback you described above if the user
writes 'using namespace boost' (which, by the way, I don't believe we should
go out of our way to make safe -- since that's well nigh impossible).

> } // namespace boost

> which allows some degree of implementation hiding even when the code
> consists of "all headers", the down side is that it requires more work for
> some of the simpler headers. BTW this approach is not mutually exclusive
> with Beman's (1) or (2).

The above paragraph is unintelligible to me. Perhaps I've missed the
background material?

-Dave


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