<?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 for stevedoria.net</title>
	<atom:link href="http://blog.stevedoria.net/comments/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.stevedoria.net</link>
	<description>Real-World Computing Experience Distilled</description>
	<lastBuildDate>Mon, 30 Jan 2012 20:04:31 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>Comment on Differences between C++ Classes and Structs by Bill H.</title>
		<link>http://blog.stevedoria.net/20050913/differences-between-cpp-classes-and-structs/comment-page-2#comment-8020</link>
		<dc:creator>Bill H.</dc:creator>
		<pubDate>Mon, 30 Jan 2012 20:04:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevedoria.net/?p=21#comment-8020</guid>
		<description>By the way, just to clarify my last post and to correct one point above, padding of data members for memory alignment will generally be done in both classes and structs.  The difference is that a struct will have no memory added by the compilers beyond the regular alignment padding, and that alignment padding is also used in C, as well as C++.

Depending on compiler switches and/or certain pragma definitions, padding for alignment can be modified or disabled.</description>
		<content:encoded><![CDATA[<p>By the way, just to clarify my last post and to correct one point above, padding of data members for memory alignment will generally be done in both classes and structs.  The difference is that a struct will have no memory added by the compilers beyond the regular alignment padding, and that alignment padding is also used in C, as well as C++.</p>
<p>Depending on compiler switches and/or certain pragma definitions, padding for alignment can be modified or disabled.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Differences between C++ Classes and Structs by Bill H.</title>
		<link>http://blog.stevedoria.net/20050913/differences-between-cpp-classes-and-structs/comment-page-2#comment-8019</link>
		<dc:creator>Bill H.</dc:creator>
		<pubDate>Mon, 30 Jan 2012 20:00:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevedoria.net/?p=21#comment-8019</guid>
		<description>There is a significant difference between a class and a structure that has not been mentioned beyond the default access level.

The C++ language specification allows compiler writers to add abitrary internal data to a class instance, and this data can be either before or after the regular class data in memory.  Some compilers do this.  Almost all compilers do this if Run Time Type Information (RTTI) is enabled at compiler time.

More importantly, any future compiler can increase the size of class instances in any future compiler without violating the language specification.

The C++ language specification prohibits adding any data to a structure that contains only non-virtual members.  A pointer to a vtable will be added if the struct contains virtual members.

A structure with &#039;no&#039; virtual members is guaranteed to be the size of it&#039;s data elements plus an padding bytes necessary to aligh data members for the current memory alignment.  

Thus, unlike a class, the address of a structure with no virtual members is guaranteed to be the same as the address of the first data element in the structure.  As mentioned earlier by MG, the struct exists in C++ to allow compatibility with C code. 

However, a struct can be occasionally preferable in C++ code.  AI a C++ container class with thousands of instances, as adding padding data &#039;can&#039; greatly increase memory utilization.  This is because some memory allocators, in order to reduce memory fragmentation, only allocate sizes that are powers of two up to some maximum power of two.  Thus, adding a single byte to a size that is already a small power of two can double memory utilization.</description>
		<content:encoded><![CDATA[<p>There is a significant difference between a class and a structure that has not been mentioned beyond the default access level.</p>
<p>The C++ language specification allows compiler writers to add abitrary internal data to a class instance, and this data can be either before or after the regular class data in memory.  Some compilers do this.  Almost all compilers do this if Run Time Type Information (RTTI) is enabled at compiler time.</p>
<p>More importantly, any future compiler can increase the size of class instances in any future compiler without violating the language specification.</p>
<p>The C++ language specification prohibits adding any data to a structure that contains only non-virtual members.  A pointer to a vtable will be added if the struct contains virtual members.</p>
<p>A structure with &#8216;no&#8217; virtual members is guaranteed to be the size of it&#8217;s data elements plus an padding bytes necessary to aligh data members for the current memory alignment.  </p>
<p>Thus, unlike a class, the address of a structure with no virtual members is guaranteed to be the same as the address of the first data element in the structure.  As mentioned earlier by MG, the struct exists in C++ to allow compatibility with C code. </p>
<p>However, a struct can be occasionally preferable in C++ code.  AI a C++ container class with thousands of instances, as adding padding data &#8216;can&#8217; greatly increase memory utilization.  This is because some memory allocators, in order to reduce memory fragmentation, only allocate sizes that are powers of two up to some maximum power of two.  Thus, adding a single byte to a size that is already a small power of two can double memory utilization.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Differences between C++ Classes and Structs by NeoCambell</title>
		<link>http://blog.stevedoria.net/20050913/differences-between-cpp-classes-and-structs/comment-page-2#comment-8018</link>
		<dc:creator>NeoCambell</dc:creator>
		<pubDate>Sun, 22 Jan 2012 02:53:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevedoria.net/?p=21#comment-8018</guid>
		<description>Another nice explanation to the same problem can be found at http://www.expertcore.org/viewtopic.php?f=8&amp;p=9281</description>
		<content:encoded><![CDATA[<p>Another nice explanation to the same problem can be found at <a href="http://www.expertcore.org/viewtopic.php?f=8&#038;p=9281" rel="nofollow">http://www.expertcore.org/viewtopic.php?f=8&#038;p=9281</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Optimization by tony</title>
		<link>http://blog.stevedoria.net/20111216/optimization/comment-page-1#comment-8009</link>
		<dc:creator>tony</dc:creator>
		<pubDate>Wed, 21 Dec 2011 22:50:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevedoria.net/?p=700#comment-8009</guid>
		<description>amazing ...~!</description>
		<content:encoded><![CDATA[<p>amazing &#8230;~!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Observer Pattern in C by Andree</title>
		<link>http://blog.stevedoria.net/20080518/observer-pattern-in-c/comment-page-1#comment-8007</link>
		<dc:creator>Andree</dc:creator>
		<pubDate>Mon, 19 Dec 2011 03:37:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevedoria.net/20080518/observer-pattern-in-c#comment-8007</guid>
		<description>Hi there,

Thanks for the great article!

I&#039;m still curious about the flagging mechanism you mentioned in the last paragraph.
For this mechanism to work, I guess we need the &quot;observer&quot; component to continuously pool this local flag and execute some action upon flag change? So, it is only possible to implemented in a multi-threaded app?</description>
		<content:encoded><![CDATA[<p>Hi there,</p>
<p>Thanks for the great article!</p>
<p>I&#8217;m still curious about the flagging mechanism you mentioned in the last paragraph.<br />
For this mechanism to work, I guess we need the &#8220;observer&#8221; component to continuously pool this local flag and execute some action upon flag change? So, it is only possible to implemented in a multi-threaded app?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Differences between C++ Classes and Structs by Dhiraj</title>
		<link>http://blog.stevedoria.net/20050913/differences-between-cpp-classes-and-structs/comment-page-2#comment-8002</link>
		<dc:creator>Dhiraj</dc:creator>
		<pubDate>Thu, 08 Dec 2011 17:03:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevedoria.net/?p=21#comment-8002</guid>
		<description>i am asking you the correct answer. and instead of it you are providing me silly comments. hoples</description>
		<content:encoded><![CDATA[<p>i am asking you the correct answer. and instead of it you are providing me silly comments. hoples</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Creating COM Components using Visual C#.NET by Sagar</title>
		<link>http://blog.stevedoria.net/20051008/creating-com-components-using-visual-csharp-dot-net/comment-page-1#comment-7997</link>
		<dc:creator>Sagar</dc:creator>
		<pubDate>Tue, 22 Nov 2011 13:00:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevedoria.net/?p=27#comment-7997</guid>
		<description>I tried this example using Visual Studio 2010. But getting error 
 “ActiveX component can’t create object: COMTest.COMObject”</description>
		<content:encoded><![CDATA[<p>I tried this example using Visual Studio 2010. But getting error<br />
 “ActiveX component can’t create object: COMTest.COMObject”</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Polymorphism in PHP by abdul</title>
		<link>http://blog.stevedoria.net/20051208/polymorphism-in-php/comment-page-1#comment-7979</link>
		<dc:creator>abdul</dc:creator>
		<pubDate>Sat, 22 Oct 2011 14:29:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevedoria.net/?p=12#comment-7979</guid>
		<description>and now you have to add access functions for each required data type? so this would be a solution to what exactly? it def. not simulating the polymorphism mate...</description>
		<content:encoded><![CDATA[<p>and now you have to add access functions for each required data type? so this would be a solution to what exactly? it def. not simulating the polymorphism mate&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Observer Pattern in C by Fredrik Svärd</title>
		<link>http://blog.stevedoria.net/20080518/observer-pattern-in-c/comment-page-1#comment-7960</link>
		<dc:creator>Fredrik Svärd</dc:creator>
		<pubDate>Wed, 21 Sep 2011 12:35:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevedoria.net/20080518/observer-pattern-in-c#comment-7960</guid>
		<description>Hi,

Missing:

#include  

:-)</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Missing:</p>
<p>#include  </p>
<p>:-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Creating COM Components using Visual C#.NET by Vinícius</title>
		<link>http://blog.stevedoria.net/20051008/creating-com-components-using-visual-csharp-dot-net/comment-page-1#comment-7957</link>
		<dc:creator>Vinícius</dc:creator>
		<pubDate>Fri, 16 Sep 2011 13:48:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.stevedoria.net/?p=27#comment-7957</guid>
		<description>TKS A LOT! Worked perfectly!</description>
		<content:encoded><![CDATA[<p>TKS A LOT! Worked perfectly!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

