17 Nov
2004
17 Nov
'04
10:43 a.m.
Hi All, I've noticed a problem when trying to use ptime with, for example, STL containers and algorithms: the lack of a default constructor for ptime means a lot of the STL container methods just dont work. For example: std::vector<ptime> v; v.resize(10); // fails because there is no ptime::ptime() constructor! So, my questions are: 1. Is there an easy way to work around this? 2. What's the reason for the lack of a default c'tor? (Couldn't it just set the object to not_a_date_time?) 3. Am I missing something obvious and in fact the ptime class is perfectly compatible with the STL? Thanks, Stuart Allie