Date time Library: ptime and special_values
The documentation for the date_time library states that a ptime can be constructed from a special value e.g. ptime(special_values sv) ptime t1(neg_infin); ptime t2(pos_infin); ptime t3(not_a_date_time); However when I try this with the Cygwin GNU compiler I get a no matching function for call error (see errors below) Am I missing something here or is the documentation wrong? Thanks Matt ../../logview.cpp:1843: error: no matching function for call to ` boost::posix_time::ptime::ptime(boost::date_time::special_values)' c:/cygwin/usr/local/include/boost-1_31/boost/date_time/posix_time/ptime.hpp: 32: error: candidates are: boost::posix_time::ptime::ptime(const boost::posix_time::ptime&) c:/cygwin/usr/local/include/boost-1_31/boost/date_time/posix_time/ptime.hpp: 45: error: boost::posix_time::ptime::ptime(const boost::posix_time::int64_time_rep&) c:/cygwin/usr/local/include/boost-1_31/boost/date_time/posix_time/ptime.hpp: 42: error: boost::posix_time::ptime::ptime(boost::gregorian::date) c:/cygwin/usr/local/include/boost-1_31/boost/date_time/posix_time/ptime.hpp: 39: error: boost::posix_time::ptime::ptime(boost::gregorian::date, boost::posix_time::time_duration)
On Thu, 3 Jun 2004 15:35:48 -0700, Matthew_Schuckmann wrote
The documentation for the date_time library states that a ptime can be constructed from a special value e.g. ptime(special_values sv) ptime t1(neg_infin); ptime t2(pos_infin); ptime t3(not_a_date_time);
However when I try this with the Cygwin GNU compiler I get a no matching function for call error (see errors below) Am I missing something here or is the documentation wrong?
The documentation was wrong -- this was a bug in 1.31 release. The fix is already in CVS. I believe you should only need to download and patch in the latest version of boost/date_time/posix_time/ptime.hpp. You can get it from: http://cvs.sourceforge.net/viewcvs.py/boost/boost/boost/date_time/posix_time... Note the log entry on change: ptime.hpp 1.4 fix the posix_time constructor to accept special values Jeff
participants (2)
-
Jeff Garland
-
Matthew_Schuckmann@amat.com