Hi!

Now I need to create a SetView from my SetVar, in order
to access its lub with LubRanges.

You do not have to use pointers to views, just use the views directly. They are themselves just thin wrappers around a pointer to the actual variable implementation. Allocating a view on the stack costs exactly the same as allocating a pointer variable. If you really want to use pointers, you could consider using the pointer returned by SetView::variable(void).

// this function could be called something like
// LubRanges_from_SetVar
{
...
SetVar* set;
SetView view(*set);
return new LubRanges ranges(view); // (this would not work I suppose....)
}

This will work!

What do you suggest? Can I somehow override that new is private?

No, please don't.

Cheers,
        Guido



_______________________________________________
Gecode users mailing list
[EMAIL PROTECTED]
https://www.gecode.org/mailman/listinfo/gecode-users

Reply via email to