<?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: Enforcing Inheritance Rules</title>
	<atom:link href="http://blog.mozilla.org/tglek/2009/09/18/enforcing-inheritance-rules/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mozilla.org/tglek/2009/09/18/enforcing-inheritance-rules/</link>
	<description>Taras&#039; blog on Snappy, Startup, Telemetry and other Firefox peroformance matters</description>
	<lastBuildDate>Tue, 27 Nov 2012 16:50:13 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Shriram</title>
		<link>http://blog.mozilla.org/tglek/2009/09/18/enforcing-inheritance-rules/comment-page-1/#comment-25902</link>
		<dc:creator>Shriram</dc:creator>
		<pubDate>Sun, 22 Nov 2009 12:57:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mozilla.org/tglek/?p=180#comment-25902</guid>
		<description><![CDATA[@ Mikael
In your previous code above, you are the defeating the whole point of having a pure virtual function in a class by overloading it. 
I am sure the compiler(s) will give you a compile error for your code.
Pure virtual function should do absolutely nothing in the base class( that is no code or lines , or no implementation at all )
when you mention it in a base class. 
Almost as if it acts as an interface, or base pointer for polymorphism purposes.

http://answers.google.com/answers/threadview?id=379269
gives good explanation too.
 ( in the case of  having a another member function with the same name of a pure virtual member function  )]]></description>
		<content:encoded><![CDATA[<p>@ Mikael<br />
In your previous code above, you are the defeating the whole point of having a pure virtual function in a class by overloading it.<br />
I am sure the compiler(s) will give you a compile error for your code.<br />
Pure virtual function should do absolutely nothing in the base class( that is no code or lines , or no implementation at all )<br />
when you mention it in a base class.<br />
Almost as if it acts as an interface, or base pointer for polymorphism purposes.</p>
<p><a href="http://answers.google.com/answers/threadview?id=379269" rel="nofollow">http://answers.google.com/answers/threadview?id=379269</a><br />
gives good explanation too.<br />
 ( in the case of  having a another member function with the same name of a pure virtual member function  )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mikael Olenfalk</title>
		<link>http://blog.mozilla.org/tglek/2009/09/18/enforcing-inheritance-rules/comment-page-1/#comment-23486</link>
		<dc:creator>Mikael Olenfalk</dc:creator>
		<pubDate>Fri, 25 Sep 2009 12:19:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mozilla.org/tglek/?p=180#comment-23486</guid>
		<description><![CDATA[Sorry, I found a typo in my last comment:

The body for B::must_implement() should of course call A::must_implement() and not A::do_common_stuff():

class B : public A {
public:
  virtual void must_implement()
  { A::must_implement(); do_more_stuff(); }
};]]></description>
		<content:encoded><![CDATA[<p>Sorry, I found a typo in my last comment:</p>
<p>The body for B::must_implement() should of course call A::must_implement() and not A::do_common_stuff():</p>
<p>class B : public A {<br />
public:<br />
  virtual void must_implement()<br />
  { A::must_implement(); do_more_stuff(); }<br />
};</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mikael Olenfalk</title>
		<link>http://blog.mozilla.org/tglek/2009/09/18/enforcing-inheritance-rules/comment-page-1/#comment-23485</link>
		<dc:creator>Mikael Olenfalk</dc:creator>
		<pubDate>Fri, 25 Sep 2009 12:17:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mozilla.org/tglek/?p=180#comment-23485</guid>
		<description><![CDATA[Wouldn&#039;t this solve the issue just as well?

class A {
public:
  virtual void must_implement() = 0;
};
void A::must_implement ()
{ do_common_stuff(); }

class B : public A {
public:
  virtual void must_implement()
  { A::do_common_stuff(); do_more_stuff(); }
};]]></description>
		<content:encoded><![CDATA[<p>Wouldn&#8217;t this solve the issue just as well?</p>
<p>class A {<br />
public:<br />
  virtual void must_implement() = 0;<br />
};<br />
void A::must_implement ()<br />
{ do_common_stuff(); }</p>
<p>class B : public A {<br />
public:<br />
  virtual void must_implement()<br />
  { A::do_common_stuff(); do_more_stuff(); }<br />
};</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tglek</title>
		<link>http://blog.mozilla.org/tglek/2009/09/18/enforcing-inheritance-rules/comment-page-1/#comment-23458</link>
		<dc:creator>tglek</dc:creator>
		<pubDate>Sat, 19 Sep 2009 17:56:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mozilla.org/tglek/?p=180#comment-23458</guid>
		<description><![CDATA[Overriding isn&#039;t only about replacing methods. OO design also involves calling the same method on the superclass to do involve functionality common to all of the method implementations]]></description>
		<content:encoded><![CDATA[<p>Overriding isn&#8217;t only about replacing methods. OO design also involves calling the same method on the superclass to do involve functionality common to all of the method implementations</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mikael Olenfalk</title>
		<link>http://blog.mozilla.org/tglek/2009/09/18/enforcing-inheritance-rules/comment-page-1/#comment-23457</link>
		<dc:creator>Mikael Olenfalk</dc:creator>
		<pubDate>Sat, 19 Sep 2009 09:01:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mozilla.org/tglek/?p=180#comment-23457</guid>
		<description><![CDATA[Hi,

Maybe I missed something but why did he not just make the member function pure-virtual? I mean the function is already virtual and because the new attribute requires the class to be modified I do not really see why one could not just add &#039;= 0&#039;.

Of course by making it pure-virtual the base class cannot be instantiated anymore, however instantiating a class with NS_MUST_OVERRIDE cannot (?) be well-defined anyway otherwise the &#039;_MUST_&#039; doesn&#039;t really make any sense.

Please enlighten me,

With kind regards,

Mikael Olenfalk]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Maybe I missed something but why did he not just make the member function pure-virtual? I mean the function is already virtual and because the new attribute requires the class to be modified I do not really see why one could not just add &#8216;= 0&#8242;.</p>
<p>Of course by making it pure-virtual the base class cannot be instantiated anymore, however instantiating a class with NS_MUST_OVERRIDE cannot (?) be well-defined anyway otherwise the &#8216;_MUST_&#8217; doesn&#8217;t really make any sense.</p>
<p>Please enlighten me,</p>
<p>With kind regards,</p>
<p>Mikael Olenfalk</p>
]]></content:encoded>
	</item>
</channel>
</rss>
