Opened 12 years ago
Last modified 11 years ago
#4856 new Bugs
compilation error: boost::local_time::local_microsec_clock::local_time()
Reported by: | Owned by: | az_sw_dude | |
---|---|---|---|
Milestone: | To Be Determined | Component: | date_time |
Version: | Boost 1.42.0 | Severity: | Problem |
Keywords: | local_time | Cc: | manish.mulimani@… |
Description
just simple call: boost::local_time::local_microsec_clock::local_time()
produces compilation error:
/usr/include/boost/date_time/microsec_time_clock.hpp:116:
error: no matching function for call to
'boost::local_time::local_date_time_base<boost::posix_time::ptime, boost::date_time::time_zone_base<boost::posix_time::ptime, char>
::local_date_time_base(boost::gregorian::date&, boost::posix_time::time_duration&)'
platform ubuntu linux 10.10 x64 compiler: gcc 4.4.5 boost ver: 1.42
I have information from other party that the same problem occurs under MS Windows, with visual studio and boost 1.44
Change History (3)
comment:1 by , 12 years ago
comment:2 by , 11 years ago
It works with posix time:
#include <boost/date_time/posix_time/ptime.hpp>
#include <boost/date_time/microsec_time_clock.hpp>
#include <boost/date_time/local_time/local_time.hpp>
int main(int argc, char *argv[]) {
std::cout << boost::date_time::microsec_clock<boost::posix_time::ptime>::local_time() << std::endl; return 0;
}
However as reported in bug, it does not work with local time. There is no overloaded constructor of boost::local_time::local_date_time_base, with following prototype: local_date_time_base(date_type,time_duration_type).
There are 3 parameterized constructors defined: i> local_date_time_base(utc_time_type, boost::shared_ptr<tz_type>) ii> local_date_time_base(date_type, time_duration_type, boost::shared_ptr<tz_type>, bool) iii> local_date_time_base(date_type, time_duration_type, boost::shared_ptr<tz_type>, DST_CALC_OPTIONS)
comment:3 by , 11 years ago
Cc: | added |
---|
Yes, this is a problem with Visual Studio as well.
Note that the same bug occur when calling: