Boost logo

Boost :

Subject: Re: [boost] [date time] std::out_of_range thrown on date 2012-5-29
From: Matthijs Möhlmann (matthijs_at_[hidden])
Date: 2013-08-09 02:26:22


On 08-08-13 09:47, Pekka Seppänen wrote:
> Hi,
>
> time_from_string() expects the string contain both date *and* time. So
> you're simply feeding it with a bad data.
>
Well this worked before with boost 1.53, it is faulty behaviour on our
side and we fixed it.

> I must say that the source for this exception (basic_string::at) is a
> bit misleading. By looking at code it is probably thrown from
> str_from_delimited_time_duration() as it doesn't check if its fed with
> an empty basic_string (as quite likely happens in this case) and always
> calls at(0).
>
> Maybe somebody (you?) could write a patch that does a little bit more
> checking or add a note to documentation about this behavior.
>
> -- Pekka
>

I can try to add a note or patch it, but I do not have much experience
with C++ and template programming.

And I also haven't got my head around programming using 'Value
Semantics' [1]. Do you have some information about that, like an url I
can read or a good book...

Regards,

Matthijs Möhlmann

[1]
http://www.cplusplus-soup.com/2012/10/value-semantics-and-polymorphism.html


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