<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Generic containers</title>
	<atom:link href="http://www.mycplus.com/tutorials/cplusplus-programming-tutorials/generic-containers/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mycplus.com/tutorials/cplusplus-programming-tutorials/generic-containers/</link>
	<description>C and C++ Programming Tutorials and Source code</description>
	<lastBuildDate>Sat, 30 Mar 2013 10:31:50 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.1</generator>
	<item>
		<title>By: Jimson</title>
		<link>http://www.mycplus.com/tutorials/cplusplus-programming-tutorials/generic-containers/comment-page-1/#comment-15872</link>
		<dc:creator>Jimson</dc:creator>
		<pubDate>Wed, 11 Jul 2007 18:35:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.mycplus.com/?p=378#comment-15872</guid>
		<description>Sorry to disappoint you, but this is actually bull. STL containers are not meant to be used as base classes. There are no virtual functions to overwrite, so you can&#039;t alter the functionality. Data members are private, so no luck there either - these two points are make container inheritance questionable, but the fact that no virtual destructor is offered makes it just plain wrong. Deleting a derived class via a pointer to the container base class will result in undefined behaviour.

If you want to add data members, just use composition. If you want to add functionality, write a new algorithm, but don&#039;t inherit from STL containers.

You might want to look this issue up, the internet is actually full of advice on this, as many novice STL users make this mistake...</description>
		<content:encoded><![CDATA[<p>Sorry to disappoint you, but this is actually bull. STL containers are not meant to be used as base classes. There are no virtual functions to overwrite, so you can&#8217;t alter the functionality. Data members are private, so no luck there either &#8211; these two points are make container inheritance questionable, but the fact that no virtual destructor is offered makes it just plain wrong. Deleting a derived class via a pointer to the container base class will result in undefined behaviour.</p>
<p>If you want to add data members, just use composition. If you want to add functionality, write a new algorithm, but don&#8217;t inherit from STL containers.</p>
<p>You might want to look this issue up, the internet is actually full of advice on this, as many novice STL users make this mistake&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
