<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>The Phase of the Moon [Bug]</title><link>http://blogs.msdn.com/b/coolbeans/archive/2007/11/28/the-phase-of-the-moon-bug.aspx</link><description>Here’s a bug I came across that earns the “phase of the moon prize”. See if you can pick it up: 
 class Storage 
 { 
 public : 
 Storage() : valx(0), valy(0) 
 { 
 } 
 
 Storage( int x, int y ) : valx(x), valy(y) 
 { 
 fValid = x != 0 &amp;amp;&amp;amp;</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: The Phase of the Moon [Bug]</title><link>http://blogs.msdn.com/b/coolbeans/archive/2007/11/28/the-phase-of-the-moon-bug.aspx#6589637</link><pubDate>Thu, 29 Nov 2007 05:11:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6589637</guid><dc:creator>doug</dc:creator><description>&lt;p&gt;what is its talking about i was looking up moon on ask and i got here?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6589637" width="1" height="1"&gt;</description></item><item><title>re: The Phase of the Moon [Bug]</title><link>http://blogs.msdn.com/b/coolbeans/archive/2007/11/28/the-phase-of-the-moon-bug.aspx#6571811</link><pubDate>Wed, 28 Nov 2007 10:32:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6571811</guid><dc:creator>Ben</dc:creator><description>&lt;p&gt;This type of bug would not have occurred if fValid was made const. The compiler would have insisted that it be assigned in the initializer list. One of the constructors would become...&lt;/p&gt;
&lt;p&gt;Storage( int x, int y ) : valx(x), valy(y), fValid(x != 0 &amp;amp;&amp;amp; y != 0) { }&lt;/p&gt;
&lt;p&gt;And the other would be something similar, depending on your intention.&lt;/p&gt;
&lt;p&gt;It's too bad that C++ does not have C#'s readonly or Java's final keywords.&lt;/p&gt;
&lt;p&gt;Also, FGetValues needs a return value as it is not a constructor.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6571811" width="1" height="1"&gt;</description></item><item><title>Free People Searches &amp;raquo; The Phase of the Moon [Bug]</title><link>http://blogs.msdn.com/b/coolbeans/archive/2007/11/28/the-phase-of-the-moon-bug.aspx#6570857</link><pubDate>Wed, 28 Nov 2007 09:50:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6570857</guid><dc:creator>Free People Searches » The Phase of the Moon [Bug]</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.absolutely-people-search.info/?p=457"&gt;http://www.absolutely-people-search.info/?p=457&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6570857" width="1" height="1"&gt;</description></item></channel></rss>