Boost logo

Boost :

From: Yitzhak Sapir (yitzhaks_at_[hidden])
Date: 2003-01-22 08:17:17


> -----Original Message-----
> From: Jeff Garland [mailto:jeff_at_[hidden]]
>
> > However, to implement format "General Date" (format letter "c"), I
> > need to know if the given input contains a date, a time, or a
> > datetime. Since the functions pretty much perform the same
> > thing, I have a core that implements functionality for datetime and
> > then I use this in the function that implements date/time
> separately.
> >
> > However, to implement the no time I have to query whether the time
> > is 0:0:0.000. This is obviously problematic, since this is a
> > perfectly valid time. For the date, I don't even have a
> "start date" to
> > use. So I pass the core function a bool that tells it
> whether to ignore
> > the date, and pass in an arbitrary date when I want just the time.
> >
> > It would be nicer, though, if I could just pass "not_a_date" or
> > "not_a_time". I could even expect the datetime function to throw
> > an exception if the requested format is for "month" and the
> > "not_a_date" was passed.
>
> Seems like there will be cases where you will want to print
> the 'not_a_date' value instead of throwing an exception.
> Without a bit more detail, however, it is unclear to me
> how this bears on a default constructor. You can already
> test a date to find out if it is not_a_date_time?

Well, I want to construct a datetime structure with "not a date" for the
date, but a valid time. And similarly, for a date value, but not a valid
time. I'm not sure what "not_a_date_time" means. Does it mean the
entire datetime is invalid? Just the date? The time?


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