Boost logo

Boost :

From: Valentin Bonnard (Bonnard.V_at_[hidden])
Date: 1999-08-18 08:30:28


Reid Sweatman wrote:
>
> > > * 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,

There are no MIN/MAX in the standard, but there are two template
function min and max from <algorithm>.

> But I realize that remaining compatible with legacy code isn't the object
> here.

The object is correct code. Altering standard names is just wrong.

> I just mention it to provide context for why I'm personally leery of
> C-style macros any more.

I don't suggest that we should use them.

-- 
Valentin Bonnard

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