[gecode-users] new IntArgs fails

Christian Schulte cschulte at kth.se
Mon Oct 19 10:27:00 CEST 2009


Hi Denys,

Yep, it is! The reason is that argument arrays are much much bigger than one
would expect: they always include a static area for a small number of
elements (16) in order to avoid heap allocation for the most cases. So for
that reason, new is disabled so that people don't shot themselves in the
foot (we shoot them right away ;-) ). I think even MwG tries to stress that
point!

Argument arrays are really meant to just pass arguments, they are bad as
general data structures. Why not use vector instead?

Cheers
Christian

--
Christian Schulte, www.ict.kth.se/~cschulte/


-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Denys Duchier
Sent: Saturday, October 17, 2009 5:18 PM
To: users at gecode.org
Subject: [gecode-users] new IntArgs fails

The following code does not compile:

    IntArgs* v = new IntArgs(5);

is that on purpose?

Cheers,

--Denys

_______________________________________________
Gecode users mailing list
users at gecode.org
https://www.gecode.org/mailman/listinfo/gecode-users





More information about the gecode-users mailing list