<?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: Const Constructors</title>
	<atom:link href="http://mark.santaniello.com/archives/113/feed" rel="self" type="application/rss+xml" />
	<link>http://mark.santaniello.com/archives/113</link>
	<description>the body of a very slow loop</description>
	<pubDate>Wed, 07 Jan 2009 02:59:47 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Mark</title>
		<link>http://mark.santaniello.com/archives/113#comment-425</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Sat, 29 Oct 2005 01:06:13 +0000</pubDate>
		<guid isPermaLink="false">http://mark.santaniello.net/?p=113#comment-425</guid>
		<description>For me, separate classes give off a strong code-smell.  With your solution, client code could do confusing stuff like:
   const ReadWriteFoo crwf;
   mutable ReadOnlyFoo mrof;

If you haven't read Kevlin's proposal, I highly recommend it, because he gives several "real world" use cases for const constructors.</description>
		<content:encoded><![CDATA[<p>For me, separate classes give off a strong code-smell.  With your solution, client code could do confusing stuff like:<br />
   const ReadWriteFoo crwf;<br />
   mutable ReadOnlyFoo mrof;</p>
<p>If you haven&#8217;t read Kevlin&#8217;s proposal, I highly recommend it, because he gives several &#8220;real world&#8221; use cases for const constructors.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bheeshmar</title>
		<link>http://mark.santaniello.com/archives/113#comment-417</link>
		<dc:creator>Bheeshmar</dc:creator>
		<pubDate>Fri, 28 Oct 2005 20:18:22 +0000</pubDate>
		<guid isPermaLink="false">http://mark.santaniello.net/?p=113#comment-417</guid>
		<description>Why are two classes untenable? You have two distinct behaviors.  One could even be implemented in terms of the other:

class ReadOnlyFoo
{
  public:
    ReadOnlyFoo( const T ... ) {}
    void fubarize() const { ... }
};

class ReadWriteFoo
{
  public:
    ReadWriteFoo() rofPtr(0) {}
    ~ReadWriteFoo() { delete rofPtr; }
    void set(const T value) { rofPtr= new RoadOnlyFoo(value); }
    void fubarize() { if( rofPtr ) rofPtr-&#62;fubarize(); else throw ... ; }
  private:
    ReadOnlyFoo * rofPtr;
};</description>
		<content:encoded><![CDATA[<p>Why are two classes untenable? You have two distinct behaviors.  One could even be implemented in terms of the other:</p>
<p>class ReadOnlyFoo<br />
{<br />
  public:<br />
    ReadOnlyFoo( const T &#8230; ) {}<br />
    void fubarize() const { &#8230; }<br />
};</p>
<p>class ReadWriteFoo<br />
{<br />
  public:<br />
    ReadWriteFoo() rofPtr(0) {}<br />
    ~ReadWriteFoo() { delete rofPtr; }<br />
    void set(const T value) { rofPtr= new RoadOnlyFoo(value); }<br />
    void fubarize() { if( rofPtr ) rofPtr-&gt;fubarize(); else throw &#8230; ; }<br />
  private:<br />
    ReadOnlyFoo * rofPtr;<br />
};</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hillary</title>
		<link>http://mark.santaniello.com/archives/113#comment-333</link>
		<dc:creator>Hillary</dc:creator>
		<pubDate>Thu, 27 Oct 2005 02:08:22 +0000</pubDate>
		<guid isPermaLink="false">http://mark.santaniello.net/?p=113#comment-333</guid>
		<description>Ok Mark.  I am commenting on your entry.  I feel it was a little bit on the boring side.  I recommend throwing in a comparison now and then, such as, C++ and Oprah, or C++ and chocolate cake.  I would really like if you could do that from now on.  Thank you.</description>
		<content:encoded><![CDATA[<p>Ok Mark.  I am commenting on your entry.  I feel it was a little bit on the boring side.  I recommend throwing in a comparison now and then, such as, C++ and Oprah, or C++ and chocolate cake.  I would really like if you could do that from now on.  Thank you.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
