Boost logo

Boost :

From: Reid Sweatman (reids_at_[hidden])
Date: 1999-08-17 15:54:59


> > * As an implementation artifact unrelated to the specification,
> > <boost/stdint.h> and thus <boost/cstdint.hpp> #include <limits.h>.
> > This allows an implementation portable to many (most?) modern
> > computer systems, but has the side effect of defining a bunch of
> > macros (xxx_MAX/xxx_MIN/etc). Should these be #undef'ed at the end
> > of boost/stdint.h?
>
> Certainly not ! Never ever do that ! These have reserved names.
>
> Anyway, DO_THEY_REALLY_HURT ?

Depends on your compiler and what the legacy code you're stuck with does.
I'm currently on a project where I can't rely on the standard MIN/MAX
macros, because someone in the long lost past wrote templatized overrides
that break them. And everything else, including the STL, unless you take
extraordinary measures to fix things (which, reluctantly, I have <g>).

But I realize that remaining compatible with legacy code isn't the object
here. I just mention it to provide context for why I'm personally leery of
C-style macros any more. I use them when I can, but I document the hell out
of them in a place where other coders can't miss it. Dependencies,
side-effects, linkage order, and so on. I guess I'd say, use them where
necessary, but *document* that beast!


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