
14 Jul
2006
14 Jul
'06
10:38 p.m.
Gennaro Prota wrote:
Hi,
the date_time library docs (posix_time.html) state:
"The class boost::posix_time::ptime is the primary interface for time point manipulation. In general, the ptime class is immutable once constructed although it does allow assignment."
Looking at the code it doesn't seem to me it allows assignment. Am I missing something?
Apparently. Have a look at the tests or examples. Just to pick one example/time_math.cpp ptime t1(d, hours(5)+minutes(4)+seconds(2)+milliseconds(1)); //construct a new time by subtracting some times ptime t2 = t1 - hours(5)- minutes(4)- seconds(2)- milliseconds(1); Jeff