<?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: C++ Functors</title>
	<atom:link href="http://www.scurrilous.com/blog/archives/2007/01/23/cpp-functors/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.scurrilous.com/blog/archives/2007/01/23/cpp-functors/</link>
	<description>What does it mean to be scurrilous? I'll try to demonstrate...</description>
	<lastBuildDate>Tue, 08 Nov 2011 00:12:13 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
	<item>
		<title>By: Oldag</title>
		<link>http://www.scurrilous.com/blog/archives/2007/01/23/cpp-functors/comment-page-1/#comment-1438</link>
		<dc:creator>Oldag</dc:creator>
		<pubDate>Tue, 12 Jun 2007 13:09:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.scurrilous.com/blog/archives/2007/01/23/c-functors/#comment-1438</guid>
		<description>Well, it is obvious you stole from Java from the start, but as your last paragraph shows, it is your preferred mechanism anyway.

I like the pure-virtual methods as well.  If, for the only reason, it seems easier to read to me than a bunch of memcpy/ptr magic-nonsense.  It doesn&#039;t feel like you are peeking under the covers, as memcpy and ptr wizardry does.

And, why not consider some merge of the solution?  Nothing prevents one from using pure-interfaces to define the callbacks, and then implementing them via templates (if that makes sense for the implementation).  Or, providing common support code as an Abstract base class that does some &#039;common&#039; work.  Again, ideas stolen from Java...

Concerning the lifetime... consider boost shared_ptr.  Well, there&#039;s a family of ptr managers in boost, and one could pick the appropriate one for their needs, but i&#039;ve found shared_ptr to be the right thing in just about all cases.

all-in-all, death to c++.</description>
		<content:encoded><![CDATA[<p>Well, it is obvious you stole from Java from the start, but as your last paragraph shows, it is your preferred mechanism anyway.</p>
<p>I like the pure-virtual methods as well.  If, for the only reason, it seems easier to read to me than a bunch of memcpy/ptr magic-nonsense.  It doesn&#8217;t feel like you are peeking under the covers, as memcpy and ptr wizardry does.</p>
<p>And, why not consider some merge of the solution?  Nothing prevents one from using pure-interfaces to define the callbacks, and then implementing them via templates (if that makes sense for the implementation).  Or, providing common support code as an Abstract base class that does some &#8216;common&#8217; work.  Again, ideas stolen from Java&#8230;</p>
<p>Concerning the lifetime&#8230; consider boost shared_ptr.  Well, there&#8217;s a family of ptr managers in boost, and one could pick the appropriate one for their needs, but i&#8217;ve found shared_ptr to be the right thing in just about all cases.</p>
<p>all-in-all, death to c++.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

