Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-09-04 19:36:25


"Jeff Garland" <jeff_at_[hidden]> writes:

> 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;

Don't make the users of conforming platforms do the extra work.

The right solution for users of nonconforming platforms is:

  #undef time

but if they really don't want to do that, yes, they can use time_
instead.

>> > 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.

no, but those won't live in namespace "boost::posix" (or
boost::posix_time if you're stubborn).

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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