Write instead:
BoolVar tmp =post(*this, ~(a[j]==(i+1)),ICL_DEF); What you did is posting the constraint that (a[j] == (i+1)) (and hence the return type of post is void as the compiler tells you). What you apparently wanted to do is to post a reified constraint which you get with ~ (and hence the return type is BoolVar). Cheers Christian -- Christian Schulte, www.ict.kth.se/~cschulte/ From: users-boun...@gecode.org [mailto:users-boun...@gecode.org] On Behalf Of Yong Sent: Monday, October 19, 2009 3:26 PM To: us...@gecode.org Subject: [gecode-users] About posting Boolean expression Hi group, A question about posting Boolean expression here. Any hint will be appreciated! My compiler will give "cannot convert from 'void' to 'Gecode::BoolVar'" error on below code: BoolVar tmp =post(*this,(a[j]==(i+1)),ICL_DEF); Yong ps: I'm using Gecode3.2.0 + VC++ 2008 Express Edition
_______________________________________________ Gecode users mailing list us...@gecode.org https://www.gecode.org/mailman/listinfo/gecode-users