[gecode-users] IntVar copy constructor

Mikael Zayenz Lagerkvist zayenz at gmail.com
Mon Nov 24 08:01:46 CET 2008


On Mon, Nov 24, 2008 at 7:30 AM, Malcolm Ryan <malcolmr at cse.unsw.edu.au> wrote:
> What do the standard C++ copy constructor and operator=() do on Vars?
> If I do,
>
> IntVar x(space, 0, 10);
> IntVar y = x;
> IntVar z(x);
>
> are x, y and z dependent on each other? Or independent variables?

IntVars x, y, and z will refer to the same variable. An IntVar is
actually only a simple handle to the real variable, and the copy
constructor and assignment operator for IntVar will simply copy the
handle.

Cheers,
Mikael

-- 
Mikael Zayenz Lagerkvist, http://www.ict.kth.se/~zayenz/




More information about the gecode-users mailing list