ptime constructor
Hi all, I have a small question about ptime class usage. I am currently working on an old project that uses Boost library; unfortunately, when I build and run the project executable some exceptions are thrown. I found out that some parts of the project are trying to create ptime objects like this: *ptime(time_from_string(string(sz)))* That line throws an exception, when sz is empty. So my question is: Is there any version (Boost version) of ptime class that accepts an empty string as argument? The problem is that I need to investigate which version of Boost, is being really used in the project makefile and with all versions of Boost that line throws the exception. On the other hand I have a precompiled binary of the project, and under the same data input conditions, it works perfectly, that is, even with empty dates no exceptions are thrown. Kind Regards, Miguel Lopes
Miguel Lopes wrote:
Hi all,
I have a small question about ptime class usage. I am currently working on an old project that uses Boost library; unfortunately, when I build and run the project executable some exceptions are thrown. I found out that some parts of the project are trying to create ptime objects like this:
*ptime(time_from_string(string(sz))) *
That line throws an exception, when sz is empty.
So my question is: Is there any version (Boost version) of ptime class that accepts an empty string as argument? The problem is that I need to
Not that I can remember...but memory is fragile.
investigate which version of Boost, is being really used in the project makefile and with all versions of Boost that line throws the exception. On the other hand I have a precompiled binary of the project, and under the same data input conditions, it works perfectly, that is, even with empty dates no exceptions are thrown.
It's also possible that they made some modification of the source to make it return not-a-date-time or something. HTH, Jeff
participants (2)
-
Jeff Garland
-
Miguel Lopes