<?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"
	>
<channel>
	<title>Comments on: What&#8217;s New in the Delphi Compiler?</title>
	<atom:link href="http://blog.excastle.com/2005/11/08/whats-new-in-the-delphi-compiler/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.excastle.com/2005/11/08/whats-new-in-the-delphi-compiler/</link>
	<description>Life, .NET, and Cats</description>
	<pubDate>Sat, 11 Oct 2008 18:40:10 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
		<item>
		<title>By: Joe White</title>
		<link>http://blog.excastle.com/2005/11/08/whats-new-in-the-delphi-compiler/#comment-5431</link>
		<dc:creator>Joe White</dc:creator>
		<pubDate>Wed, 09 Nov 2005 14:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.excastle.com/2005/11/08/whats-new-in-the-delphi-compiler/#comment-5431</guid>
		<description>Why would you want it on classes? When you're overloading things like +, you really want value semantics anyway.&lt;br&gt;&lt;br&gt;The primary reason you can't use it on classes is that, when you do A + B, it should return a new instance, C. Now who's responsible for freeing it? The semantics get really murky there.&lt;br&gt;&lt;br&gt;There's also the fact that Microsoft's guidelines for operator overloading pretty much say, &#34;Don't do it for classes.&#34; See:&lt;br&gt;&lt;a target="_new" href="http://www.gotdotnet.com/team/fxcop/Docs/Rules/Design/DoNotOverrideOperatorEqualsOnReferenceTypes.html" rel="nofollow"&gt;http://www.gotdotnet.com/team/fxcop/Docs/Rules/Design/DoNotOverrideOperatorEqualsOnReferenceTypes.html&lt;/a&gt;&lt;br&gt;&lt;a target="_new" href="http://www.gotdotnet.com/team/fxcop/Docs/Rules/DesignRules/AddAndSubNoEqualsOp.html" rel="nofollow"&gt;http://www.gotdotnet.com/team/fxcop/Docs/Rules/DesignRules/AddAndSubNoEqualsOp.html&lt;/a&gt;&lt;br&gt;...and then apply the transitive property to those two rules. If you overload + and -, you should also overload =, which you shouldn't do on reference types.&lt;br&gt;&lt;br&gt;If you *really* want both operator overloading and classes for some reason, you could probably accomplish that by making a record type (with operator overloading) that wraps an interface reference (so you can do class-type stuff like inheritance).
</description>
		<content:encoded><![CDATA[<p>Why would you want it on classes? When you&#8217;re overloading things like +, you really want value semantics anyway.</p>
<p>The primary reason you can&#8217;t use it on classes is that, when you do A + B, it should return a new instance, C. Now who&#8217;s responsible for freeing it? The semantics get really murky there.</p>
<p>There&#8217;s also the fact that Microsoft&#8217;s guidelines for operator overloading pretty much say, &quot;Don&#8217;t do it for classes.&quot; See:<br />
<br /><a target="_new" href="http://www.gotdotnet.com/team/fxcop/Docs/Rules/Design/DoNotOverrideOperatorEqualsOnReferenceTypes.html" rel="nofollow">http://www.gotdotnet.com/team/fxcop/Docs/Rules/Design/DoNotOverrideOperatorEqualsOnReferenceTypes.html</a><br />
<br /><a target="_new" href="http://www.gotdotnet.com/team/fxcop/Docs/Rules/DesignRules/AddAndSubNoEqualsOp.html" rel="nofollow">http://www.gotdotnet.com/team/fxcop/Docs/Rules/DesignRules/AddAndSubNoEqualsOp.html</a><br />
<br />&#8230;and then apply the transitive property to those two rules. If you overload + and -, you should also overload =, which you shouldn&#8217;t do on reference types.</p>
<p>If you *really* want both operator overloading and classes for some reason, you could probably accomplish that by making a record type (with operator overloading) that wraps an interface reference (so you can do class-type stuff like inheritance).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://blog.excastle.com/2005/11/08/whats-new-in-the-delphi-compiler/#comment-5430</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Wed, 09 Nov 2005 07:22:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.excastle.com/2005/11/08/whats-new-in-the-delphi-compiler/#comment-5430</guid>
		<description>Operator Overloading (Win32)&lt;br&gt;&lt;br&gt;Supported on record types only (see previous point) &lt;br&gt;&lt;br&gt;:-((((((((((((((((((((((((((&lt;br&gt;&lt;br&gt;...and classes????&lt;br&gt;
</description>
		<content:encoded><![CDATA[<p>Operator Overloading (Win32)</p>
<p>Supported on record types only (see previous point) </p>
<p>:-((((((((((((((((((((((((((</p>
<p>&#8230;and classes????<br />
</p>
]]></content:encoded>
	</item>
</channel>
</rss>
