[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Why does this program segfault?




On Wednesday, January 16, 2002, at 05:33 PM, Glenn Maynard wrote:

The implicit copy ctor shouldn't be getting defined (there's a non-default
ctor), so I'm not sure exactly how that's being constructed.

If you don't want an implicit copy ctor, you have to do:

class C {
	...
	private:
		C(const C &);

}

and then never define that ctor. Otherwise, the compiler makes one for you. Same with operator=(const C&).



Reply to: