|
Boost Users : |
From: Alejandro Escalante Medina
Date: 2003-02-26 19:55:40
The following simple code doesn't compile:
----------------------------------------------
#define DATE_TIME_INLINE
#include <boost/date_time/gregorian/gregorian.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
using namespace boost;
using namespace boost::posix_time;
using namespace boost::gregorian;
...
time_period p(ptime(date(2003, 03, 25)), ptime(date(2003, 04,
25)));
date_duration duration(days(1));
p.shift(duration);
----------------------------------------------------
the compiler (VC++ 7.0) gives the following:
error C2664: 'boost::date_time::period<class
boost::posix_time::ptime,class
boost::posix_time::time_duration>::shift' : cannot convert parameter
1 from 'boost::gregorian::date_duration' to 'const
boost::posix_time::time_duration &'
Reason: cannot convert from 'boost::gregorian::date_duration'
to 'const boost::posix_time::time_duration'
No constructor could take the source type, or constructor
overload resolution was ambiguous
I think this should work out of the box, since I've been doing lots
of other things with date_time and they work fine.
Any ideas?
Thanks in advance,
Alex
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