|
Boost : |
From: Jeff Garland (jeff_at_[hidden])
Date: 2003-09-04 08:04:10
On Wed, 03 Sep 2003 15:20:50 -0400, David Abrahams wrote
> >> Disable the macros where neccessary? You can do it temporarily and
> >> provide an alias typedef.
> >
> > But what other code would that break if you disable the macro?
>
> None. When you find the nonconforming platform, you find the
> definition of time, and
>
> #ifdef time
> # undef time
> #endif
>
> ... // boost date_time contents
>
> typedef time time_;
>
> #ifdef WHATEVER_PLATFORM && !defined(BOOST_DATE_TIME_UNDEF_TIME)
> # define time ... // old definition of time
> #endif
So on the non-conforming platform users have to write time_? This seems like
an awful lot of work when you can just say
typedef boost::posix_time::ptime time;
> > It's been so long that I can't even remember which platform, but
> > these seems like opening a Can-O-Big-Worms....
>
> It's a principle of Boost to avoid compromising interfaces just to
> accomodate a broken compiler.
Sure I agree with that. Especially for anything that is going to be
standardized. OTH, there will be other time types in the future (ex:
local_time, gps_time) so everything can't be named 'time' anyway.
Jeff
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk