Boost logo

Boost :

From: Matthias Schabel (boost_at_[hidden])
Date: 2006-11-10 21:56:53

>> This is on Xcode 2.4 (gcc 4.0.1). I assume that there is a definition
>> of "time" somewhere in the standard headers that is polluting the
>> global namespace. Has anyone run into this before? Any suggestions?
> Yeah, I'm pretty sure I ran into this years ago, but it's foggy now
> what
> platform/compiler. It's at least partially the reason that
> date_time has
> 'ptime' instead of just 'time'.

I guess I shouldn't say I'm "glad" to hear that I'm not the only one
to run into
this issue. I'm curious, though, if the standard has anything to say
- is the standard
  library formally allowed to have symbols in the global scope?

> Anyway, Dave's answer is right unless you want to rename the class to
> something besides time. I'd guessing that what you are actually
> representing
> is a 'time_duration' as defined by ISO 8601, boost date_time, and
> others.
> That's a different concept than a 'time' which is a dimensionless
> point in the
> time continuum.

I agree that namespace aliases are the obvious solution, if a little
You're right, of course - to be completely accurate, it is really a
duration. I'm
thinking of submitting the library for review after I get a little
more feedback -
at that point, it will probably be appropriate to consider the
nomenclature at
more length. As it is currently set up, time durations would be
declared as


which, I think, more or less implies that it is a duration...


Boost list run by bdawes at, gregod at, cpdaniel at, john at