Boost logo

Boost Users :

From: Sean Rohead (sean.rohead_at_[hidden])
Date: 2005-07-21 19:37:32


I am using VS.NET 2003 and attempting to create a time_duration using hours,
minutes, seconds, and milliseconds.

However, I get an error message regarding the 4th parameter (milliseconds).

Here is my code and the error message:

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
// main.cpp

#include "boost/date_time/posix_time/posix_time.hpp"

using namespace boost::posix_time;

void main()
{
    time_duration t(8, 45, 00, milliseconds(100));
}

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

------ Build started: Project: boost, Configuration: Debug Win32 ------

Compiling...
main.cpp
c:\Documents and Settings\sean.rohead\My Documents\Visual Studio
Projects\boost\main.cpp(13) : error C2664:
'boost::posix_time::time_duration::time_duration(boost::posix_time::time_duration::hour_type,boost::posix_time::time_duration::min_type,boost::posix_time::time_duration::sec_type,boost::posix_time::time_duration::fractional_seconds_type)'
: cannot convert parameter 4 from
'boost::date_time::subsecond_duration<base_duration,frac_of_second>' to
'boost::posix_time::time_duration::fractional_seconds_type'
        with
        [
            base_duration=boost::posix_time::time_duration,
            frac_of_second=1000
        ]
        No user-defined-conversion operator available that can perform this
conversion, or the operator cannot be called


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