<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sudarshan Gaikaiwari &#187; Software</title>
	<atom:link href="http://www.sudarshan.org/blog/tag/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sudarshan.org/blog</link>
	<description>There will be some changes made</description>
	<lastBuildDate>Wed, 18 Nov 2009 18:21:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>C++ function resolution</title>
		<link>http://www.sudarshan.org/blog/2007/05/cplusplu-function-resolution/</link>
		<comments>http://www.sudarshan.org/blog/2007/05/cplusplu-function-resolution/#comments</comments>
		<pubDate>Thu, 24 May 2007 13:37:53 +0000</pubDate>
		<dc:creator>Sudarshan</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://www.sudarshan.org/blog/2007/05/24/c-function-resolution/</guid>
		<description><![CDATA[I earn my living writing C++ code these days. Everyday I learn something new and interesting about this language. Many languages have a simple core, if you understand a few basic principles you can understand how most of the language works. C++ has a lot of esoteric features and no guiding principles that to borrow [...]]]></description>
			<content:encoded><![CDATA[<p>I earn my living writing C++ code these days. Everyday I learn something new and interesting about this language. Many languages have a simple core, if you understand a few basic principles you can understand how most of the language works. C++ has a lot of esoteric features and no guiding principles that to borrow a term from human computer interaction allow the programmer to develop expectations. I think the reasons for this are historical.<br />
Reading Lippman&#8217;s Inside the C++ Object model and Stroustrup&#8217;s Design and Evolution of the C++ Programming language I am amazed by how much attention was paid to match C in performance</p>
<pre class="prettyprint">
f()
{
   a.f()      // resolved at compile time (not polymorphic)
   p->f()     // resolved at runtime
}
</pre>
<p>
The static resolution is a feature. The C++ compiler writers were trying to avoid the single instruction cost of vptr dereferencing. For a programmer this means that just marking a function as virtual does not mean that the most overriden version will be invoked. To ensure that every invocation must also be polymorphic. Also there is a principle at work here. You do not have to pay for what you do not use.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sudarshan.org/blog/2007/05/cplusplu-function-resolution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
