Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!ateng!chip From: chip@ateng.com (Chip Salzenberg) Newsgroups: comp.lang.c++ Subject: Re: inheriting an object with a strange constructor... Message-ID: <25854A95.1251@ateng.com> Date: 12 Dec 89 18:59:32 GMT References: Organization: A T Engineering, Tampa, FL Lines: 67 According to andersnb@lab.nyu.edu (Brian Anderson): >class A { >private: > char* thing; >public: > A(int i...) { > // parse arguments > } >}; > >class B: A { >public: > B(int i...): A(i...) { > // other stuff > } >}; I don't think you can do what I think you want. But if you provide a version of A's constructur that's fast and does nothing, you can then call A::init() with a va_list argument: class A { public: A(int i ...); protected: init(int, va_list); // does all the construction work private: char *thing; }; class B: public A { public: B(int i ...); }; A::init(int i, va_list ap) { if (i) { // allocate thing, etc. } else thing = NULL; } A::A(int i ...) { va_list ap; va_start(ap, i); init(i, ap); va_end(ap); } B::B(int i ...) : A(0) // note that init(0) does nothing important { va_list ap; va_start(ap, i); init(i, ap); va_end(ap); } It could get more complicated, but this will work. -- You may redistribute this article only to those who may freely do likewise. Chip Salzenberg at A T Engineering; or "The Usenet, in a very real sense, does not exist."