Do all your arrays have size 4 (as in your loop)? ;-) Christian
-- Christian Schulte, Professor of Computer Science, KTH, www.ict.kth.se/~cschulte/ -----Original Message----- From: users-boun...@gecode.org [mailto:users-boun...@gecode.org] On Behalf Of Pascal Francq (Mailing lists) Sent: Wednesday, March 13, 2013 4:58 PM To: users@gecode.org Subject: [gecode-users] initialize ViewArray<IntView> from IntVarArray Hi, I am developing a propagator which constructors takes an IntVarArray as parameter, and I want to initialize a ViewArray on this parameter. My current code looks like : class MyPropagator : public Propagator { ViewArray<IntView> C; MyPropagator(Home home,IntVarArray& c) : Propagator(home), C(home,c.size()) { for(size_t j=0;j<4;j++) C[j]=IntView(c[j]); C.subscribe(home,*this,PC_GEN_ASSIGNED); } }; When I run the code, I have segmentation fault. I suppose that my constructor is not correct. Thanks. -- Dr. Pascal Francq Belgium _______________________________________________ Gecode users mailing list users@gecode.org https://www.gecode.org/mailman/listinfo/gecode-users _______________________________________________ Gecode users mailing list users@gecode.org https://www.gecode.org/mailman/listinfo/gecode-users