Boost logo

Boost Users :

From: Stuart Allie (Stuart.Allie_at_[hidden])
Date: 2004-11-17 05:43:45


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


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