|
Boost Users : |
From: Ben Hutchings (ben.hutchings_at_[hidden])
Date: 2005-01-26 15:04:57
Jeff Garland wrote:
> On Wed, 26 Jan 2005 11:08:31 +0000, Stephen Jackson wrote
>
>>On Wed, 2005-01-26 at 03:58, Stuart Siegel wrote:
>>
>>>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:
>>>
>>
>>The difference between the two lines above is this:
>>
>> time_period t2( ptime(min_date_time), ptime(max_date_time) );
>>
>>g++ is taking this as a function declaration. (I don't know whether
>>it should be doing so but it is.) Therefore
>
>
> Yeah, you are correct it is treating it as a function declaration. This feel
> like a gcc bug to me, but there could be some obscure reason why it's that way
> that I'm unaware of.
<snip>
This is correct behaviour. The above declaration declares t2 as a
function taking two parameters of type ptime (irrelevantly named
min_date_time and max_date_time). Any compiler that doesn't parse it as
that is broken.
Ben.
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