|
Boost Users : |
From: Stuart Siegel (ssiegel95_at_[hidden])
Date: 2005-01-25 22:58:32
Can anyone tell me why the line:
time_period t4(t2);
in the attached cpp file doesn't compile but the line:
time_period t3(t1);
does? it seems like i should be calling the same copy constructor in
both cases but g++ 3.3.4 complains:
error: no matching function for call to `
boost::date_time::period<boost::posix_time::ptime,
boost::posix_time::time_duration>::period(boost::posix_time::time_period
(&)(boost::posix_time::ptime, boost::posix_time::ptime))'
/usr/include/boost/date_time/period.hpp:64: error: candidates are:
boost::date_time::period<boost::posix_time::ptime,
boost::posix_time::time_duration>::period(const
boost::date_time::period<boost::posix_time::ptime,
boost::posix_time::time_duration>&)
/usr/include/boost/date_time/period.hpp:109: error:
boost::date_time::period<point_rep,
duration_rep>::period(point_rep,
duration_rep) [with point_rep = boost::posix_time::ptime,
duration_rep =
boost::posix_time::time_duration]
/usr/include/boost/date_time/period.hpp:99: error:
boost::date_time::period<point_rep,
duration_rep>::period(point_rep,
point_rep) [with point_rep = boost::posix_time::ptime,
duration_rep =
boost::posix_time::time_duration]
//--------------------------------cut here-------------------
#include "boost/date_time/posix_time/posix_time_types.hpp"
#include "boost/date_time/gregorian/gregorian_types.hpp"
int main()
{
using namespace boost::posix_time;
using namespace boost::gregorian;
//----------------------------------------------
date dmin( min_date_time) ; ptime tmin( dmin );
date dmax( max_date_time) ; ptime tmax( dmax );
time_period t1( tmin, tmax );
//---------------------------------------------
time_period t2( ptime(min_date_time), ptime(max_date_time) );
//why does this compile (on g++ 3.3.4)
time_period t3(t1);
//but this doesn't? i.e., why isn't a time_period a time_period a
time_period?
time_period t4(t2);
return 0;
}
__________________________________
Do you Yahoo!?
All your favorites on one personal page – Try My Yahoo!
http://my.yahoo.com
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