<?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: Single, Double And Multiple Dispatch</title>
	<atom:link href="http://ifacethoughts.net/2006/07/29/single-double-and-multiple-dispatch/feed/" rel="self" type="application/rss+xml" />
	<link>http://ifacethoughts.net/2006/07/29/single-double-and-multiple-dispatch/</link>
	<description>Thoughts on software development and related, by Abhijit Nadgouda</description>
	<lastBuildDate>Sun, 21 Mar 2010 09:59:15 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Nicholas</title>
		<link>http://ifacethoughts.net/2006/07/29/single-double-and-multiple-dispatch/comment-page-1/#comment-220388</link>
		<dc:creator>Nicholas</dc:creator>
		<pubDate>Wed, 09 Apr 2008 10:32:52 +0000</pubDate>
		<guid isPermaLink="false">http://ifacethoughts.net/2006/07/29/single-double-and-multiple-dispatch/#comment-220388</guid>
		<description>#include 

class Human;
class Cat;

class Animal
{
public:
	virtual void face(Animal &amp; animal) = 0;
	virtual void face(Human  &amp; human)  = 0;
	virtual void face(Cat    &amp; cat)    = 0;
};

class Human : public Animal
{
public:
	virtual void face(Animal &amp; animal);
	virtual void face(Human  &amp; human);
	virtual void face(Cat    &amp; cat);
};

class Cat : public Animal
{
public:
	virtual void face(Animal&amp; animal);
	virtual void face(Human  &amp; human);
	virtual void face(Cat    &amp; cat);
};

///////////////////////////////////////////

void Human::face(Animal &amp; animal)
{
	animal.face(*this);
}

void Human::face(Human &amp; human)
{
	std::cout &lt;&lt; &quot;Human faces Human: Shakehand\n&quot;;
}

void Human::face(Cat &amp; cat)
{
	std::cout &lt;&lt; &quot;Cat faces Human : eat?\n&quot;;
}

void Cat::face(Animal &amp; animal)
{
	animal.face(*this);
}

void Cat::face(Human &amp; human)
{
	std::cout &lt;&lt; &quot;Human faces Cat: run?\n&quot;;
}

void Cat::face(Cat &amp; cat)
{
	std::cout &lt;&lt; &quot;Cat faces Cat: shakehand\n&quot;;
}

///////////////////////////////////////////

int main()
{
	Animal &amp; acat   = * new Cat();
	Animal &amp; ahuman = * new Human();
	ahuman.face(acat);
	return 0;
}</description>
		<content:encoded><![CDATA[<p>#include </p>
<p>class Human;<br />
class Cat;</p>
<p>class Animal<br />
{<br />
public:<br />
	virtual void face(Animal &amp; animal) = 0;<br />
	virtual void face(Human  &amp; human)  = 0;<br />
	virtual void face(Cat    &amp; cat)    = 0;<br />
};</p>
<p>class Human : public Animal<br />
{<br />
public:<br />
	virtual void face(Animal &amp; animal);<br />
	virtual void face(Human  &amp; human);<br />
	virtual void face(Cat    &amp; cat);<br />
};</p>
<p>class Cat : public Animal<br />
{<br />
public:<br />
	virtual void face(Animal&amp; animal);<br />
	virtual void face(Human  &amp; human);<br />
	virtual void face(Cat    &amp; cat);<br />
};</p>
<p>///////////////////////////////////////////</p>
<p>void Human::face(Animal &amp; animal)<br />
{<br />
	animal.face(*this);<br />
}</p>
<p>void Human::face(Human &amp; human)<br />
{<br />
	std::cout &lt;&lt; &#8220;Human faces Human: Shakehand\n&#8221;;<br />
}</p>
<p>void Human::face(Cat &amp; cat)<br />
{<br />
	std::cout &lt;&lt; &#8220;Cat faces Human : eat?\n&#8221;;<br />
}</p>
<p>void Cat::face(Animal &amp; animal)<br />
{<br />
	animal.face(*this);<br />
}</p>
<p>void Cat::face(Human &amp; human)<br />
{<br />
	std::cout &lt;&lt; &#8220;Human faces Cat: run?\n&#8221;;<br />
}</p>
<p>void Cat::face(Cat &amp; cat)<br />
{<br />
	std::cout &lt;&lt; &#8220;Cat faces Cat: shakehand\n&#8221;;<br />
}</p>
<p>///////////////////////////////////////////</p>
<p>int main()<br />
{<br />
	Animal &amp; acat   = * new Cat();<br />
	Animal &amp; ahuman = * new Human();<br />
	ahuman.face(acat);<br />
	return 0;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Deciding On Programming Languages &#124; iface thoughts</title>
		<link>http://ifacethoughts.net/2006/07/29/single-double-and-multiple-dispatch/comment-page-1/#comment-118153</link>
		<dc:creator>Deciding On Programming Languages &#124; iface thoughts</dc:creator>
		<pubDate>Tue, 23 Oct 2007 14:20:54 +0000</pubDate>
		<guid isPermaLink="false">http://ifacethoughts.net/2006/07/29/single-double-and-multiple-dispatch/#comment-118153</guid>
		<description>[...] requirements can demand a specific programming style. A feature of functional programming is the multiple dispatch ability, which can make software development easier in some cases. An example that made rounds recently was [...]</description>
		<content:encoded><![CDATA[<p>[...] requirements can demand a specific programming style. A feature of functional programming is the multiple dispatch ability, which can make software development easier in some cases. An example that made rounds recently was [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abhijit Nadgouda</title>
		<link>http://ifacethoughts.net/2006/07/29/single-double-and-multiple-dispatch/comment-page-1/#comment-14155</link>
		<dc:creator>Abhijit Nadgouda</dc:creator>
		<pubDate>Wed, 28 Feb 2007 02:45:47 +0000</pubDate>
		<guid isPermaLink="false">http://ifacethoughts.net/2006/07/29/single-double-and-multiple-dispatch/#comment-14155</guid>
		<description>Zaman, it probably is. I had tested it long back and probably not the exact code here. The aim of the code here was for illustration. Anyway, I will try to follow it up and come up with a piece that works.</description>
		<content:encoded><![CDATA[<p>Zaman, it probably is. I had tested it long back and probably not the exact code here. The aim of the code here was for illustration. Anyway, I will try to follow it up and come up with a piece that works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zaman bakshi</title>
		<link>http://ifacethoughts.net/2006/07/29/single-double-and-multiple-dispatch/comment-page-1/#comment-14154</link>
		<dc:creator>zaman bakshi</dc:creator>
		<pubDate>Wed, 28 Feb 2007 01:52:32 +0000</pubDate>
		<guid isPermaLink="false">http://ifacethoughts.net/2006/07/29/single-double-and-multiple-dispatch/#comment-14154</guid>
		<description>The code is ridiculous and error-prone. Even if all the syntax errors are removed, it will not work.</description>
		<content:encoded><![CDATA[<p>The code is ridiculous and error-prone. Even if all the syntax errors are removed, it will not work.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
