Boost logo

Boost Users :

From: Bart (bartmann.nsd_at_[hidden])
Date: 2005-10-24 19:00:07


On Mon, 24 Oct 2005 12:51:20 -0400, __PPS__ wrote:

> Jeff Garland wrote:
>
...snip...
>
> Ok, I was wrong that they produce the same results, but I was wrong
> cause I didn't expect that date(2005,02,31) checks date correctness
> similar to from_undelimited_string("20050231"); which does not. Did you
> try to run these two examples? I got this output (v 1.33):
> 2005-Mar-03
> exception: Day of month is not valid for year
>

Try it with a fresh cvs version. We've recently fixed a few bugs and I
believe this was one of them.
 
>>>Another thing I noted, some conversion functions accept const
>>>std::string &, but most of them accept plain std::string, isn't better
>>>to convert all of them to constant references???
>>
>>
>> Sure unless they copy the string anyway, which I don't think they do.
>
> from_undelimited_string(std::string) does exactly the same as
> date_from_iso_string(const std::string &)
>

The date_from_iso_string function was written in Apr 2004 by myself.
The from_undelimited_string was written in Aug 2002 by Jeff (I believe).

Originally they strings were passed in by-value. The later function(s)
were by-reference. The remaining discrepancy is nothing more that a lot of
time between work done by two different people.

Your point is noted and the task of reviewing by-value/by-reference will
be put on the todo list.

Bart


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net