Boost logo

Boost :

Subject: Re: [boost] [Shifted Pointer] Review Request
From: Phil Bouchard (philippe_at_[hidden])
Date: 2011-04-22 11:43:57


On 4/22/2011 1:00 AM, Ilya Sokolov wrote:
>
> Then the following code is not exception-safe:
>
> void foo(shifted_ptr<int> a, shifted_ptr<int> b);
>
> void bar()
> {
> foo(new shifted<int>(42), new shifted<int>(43));
> }
>
> due to unspecified order of arguments' evaluation.

I don't see how explicit constructors would change anything:

void foo(shifted_ptr<int> a, shifted_ptr<int> b);

void bar()
{
foo(shifted_ptr<int>(new shifted<int>(42)), shifted_ptr<int>(new
shifted<int>(43)));
}

-Phil


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk