Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.linkpendium.com!news.linkpendium.com!panix!not-for-mail From: jgk@panix.com (Joe keane) Newsgroups: comp.lang.c++ Subject: Re: Is this bad? (How can this be avoided?) Date: Wed, 30 Nov 2011 17:43:18 +0000 (UTC) Organization: Public Access Networks Corp. Lines: 23 Message-ID: References: <52997172-c9ca-4e1b-aad0-98fc277268a8@g1g2000pri.googlegroups.com> NNTP-Posting-Host: panix5.panix.com X-Trace: reader1.panix.com 1322674998 26484 166.84.1.5 (30 Nov 2011 17:43:18 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Wed, 30 Nov 2011 17:43:18 +0000 (UTC) X-Newsreader: trn 4.0-test76 (Apr 2, 2001) Xref: x330-a1.tempe.blueboxinc.net comp.lang.c++:11988 In article <52997172-c9ca-4e1b-aad0-98fc277268a8@g1g2000pri.googlegroups.com>, mike3 wrote: >class Drawing { > private: > ... blah ... > std::vector shapeList; > ... blah ... > public: > ... blah ... > void addShape(Shape *s) > { > shapeList.push_back(s); > } > ... blah ... > void doSmth(); // uses the objects in shapeList somehow > ... blah ... >}; Maybe you want std::vector shapeList; instead?