[date_time] posix_time::ptime assignability

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? -- [ Gennaro Prota, C++ developer for hire ] [ resume: available on request ]

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

On Fri, 14 Jul 2006 15:38:03 -0700, Jeff Garland <jeff@crystalclearsoftware.com> wrote:
Gennaro Prota wrote:
[...]
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);
Indeed, the absence would have been too odd. But I was deceived by using a CVS head working copy with which I couldn't do any assignment (checked out a couple of weeks ago). When I switched to release 1.31.0 everything worked. Thanks for your prompt reply, anyway :) PS: I have noticed some minor typos in comments and docs, here and there; if they are still present in the CVS head can I fix them without posting to the list? They are quite trivial issues and passing through here first looks like a waste of time for everyone (I guess you also keep an eye on lib.boost.cvs, so everything will be under control for you anyhow :)). -- [ Gennaro Prota, C++ developer for hire ] [ resume: available on request ]

On Sat, 15 Jul 2006 01:59:22 +0200, Gennaro Prota <gennaro_prota@yahoo.com> wrote:
[...] When I switched to release 1.31.0...
Yeah, some years ago...! I meant 1.33.1, of course. Looks like I shouldn't be posting at 2 am :) -- [ Gennaro Prota, C++ developer for hire ] [ resume: available on request ]
participants (2)
-
Gennaro Prota
-
Jeff Garland