<?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: X-Macros</title>
	<atom:link href="http://op.closedformodification.com/2006/06/18/x-macros/feed/" rel="self" type="application/rss+xml" />
	<link>http://op.closedformodification.com/2006/06/18/x-macros/</link>
	<description>A practical view on programming, software development in general, and anything that is related in sometimes surprising ways</description>
	<pubDate>Wed, 08 Sep 2010 08:18:42 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ape</title>
		<link>http://op.closedformodification.com/2006/06/18/x-macros/comment-page-1/#comment-5520</link>
		<dc:creator>Ape</dc:creator>
		<pubDate>Tue, 11 Aug 2009 01:35:31 +0000</pubDate>
		<guid isPermaLink="false">http://op.closedformodification.com/2006/06/18/x-macros/#comment-5520</guid>
		<description>&lt;p&gt;It looks like there's a typo in the second  "Enum Example".  const char* iDStrings[] is declared but idStrings[] is used. I have not actually compiled this code, so it may be that I'm just not familiar with how X-Macros work. On another note: thank you for posting this information about X-Macros! I appreciate how this blog has contributed to my furthering knowledge of programming.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>It looks like there&#8217;s a typo in the second  &#8220;Enum Example&#8221;.  const char* iDStrings[] is declared but idStrings[] is used. I have not actually compiled this code, so it may be that I&#8217;m just not familiar with how X-Macros work. On another note: thank you for posting this information about X-Macros! I appreciate how this blog has contributed to my furthering knowledge of programming.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wolfgang</title>
		<link>http://op.closedformodification.com/2006/06/18/x-macros/comment-page-1/#comment-2916</link>
		<dc:creator>Wolfgang</dc:creator>
		<pubDate>Thu, 10 Jan 2008 13:23:12 +0000</pubDate>
		<guid isPermaLink="false">http://op.closedformodification.com/2006/06/18/x-macros/#comment-2916</guid>
		<description>&lt;p&gt;Sure, I just compressed the code into one file to make it easier to present. There is nothing that keeps from splitting up the code into more files, if you are so inclined. You just redefine the big X accordingly, to generate a class declaration in the header, and the implementation in the cpp file ;)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Sure, I just compressed the code into one file to make it easier to present. There is nothing that keeps from splitting up the code into more files, if you are so inclined. You just redefine the big X accordingly, to generate a class declaration in the header, and the implementation in the cpp file <img src='http://op.closedformodification.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: quizzical</title>
		<link>http://op.closedformodification.com/2006/06/18/x-macros/comment-page-1/#comment-2912</link>
		<dc:creator>quizzical</dc:creator>
		<pubDate>Thu, 10 Jan 2008 03:47:04 +0000</pubDate>
		<guid isPermaLink="false">http://op.closedformodification.com/2006/06/18/x-macros/#comment-2912</guid>
		<description>&lt;p&gt;Traditionally, the class prototype is defined in a header file, while the class implementation is defined in a .cpp file.  Using XMacro-Properties.cpp as our example, is there a way to write the prototype for Properties in a header, while implementing elsewhere:&lt;/p&gt;

&lt;p&gt;define X(tp, name)&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;const tp&#38; Properties::get##name() const {return m_##name;}  \
void Properties:: set##name(const tp&#38; in##name)  \
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;???????&lt;/p&gt;

&lt;p&gt;Many thanks!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Traditionally, the class prototype is defined in a header file, while the class implementation is defined in a .cpp file.  Using XMacro-Properties.cpp as our example, is there a way to write the prototype for Properties in a header, while implementing elsewhere:</p>
<p>define X(tp, name)</p>
<pre><code>const tp&amp; Properties::get##name() const {return m_##name;}  \
void Properties:: set##name(const tp&amp; in##name)  \
</code></pre>
<p>???????</p>
<p>Many thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SeB</title>
		<link>http://op.closedformodification.com/2006/06/18/x-macros/comment-page-1/#comment-333</link>
		<dc:creator>SeB</dc:creator>
		<pubDate>Tue, 09 Jan 2007 18:04:09 +0000</pubDate>
		<guid isPermaLink="false">http://op.closedformodification.com/2006/06/18/x-macros/#comment-333</guid>
		<description>&lt;p&gt;Thanks for your reply, Wolfgang. 
Unfortunately I need to use the X.def and Y.def files which are used by others parts of the code.&lt;/p&gt;

&lt;p&gt;I am trying to find out a way for sourcing a .def file multiple times from another .def file. 
That might be done with variable arguments length macros, but these are not supported by all compilers and are not so familiar to me.&lt;/p&gt;

&lt;p&gt;I'll let know here if I find a reasonable solution.&lt;/p&gt;

&lt;p&gt;SeB.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks for your reply, Wolfgang.<br />
Unfortunately I need to use the X.def and Y.def files which are used by others parts of the code.</p>
<p>I am trying to find out a way for sourcing a .def file multiple times from another .def file.<br />
That might be done with variable arguments length macros, but these are not supported by all compilers and are not so familiar to me.</p>
<p>I&#8217;ll let know here if I find a reasonable solution.</p>
<p>SeB.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wolfgang</title>
		<link>http://op.closedformodification.com/2006/06/18/x-macros/comment-page-1/#comment-332</link>
		<dc:creator>Wolfgang</dc:creator>
		<pubDate>Tue, 09 Jan 2007 17:16:13 +0000</pubDate>
		<guid isPermaLink="false">http://op.closedformodification.com/2006/06/18/x-macros/#comment-332</guid>
		<description>&lt;p&gt;You could use two parameters, by defining something like&lt;/p&gt;

&lt;pre&gt;
#define GENERATE_IDS    \
    X(x1, "x1")Y(y1, "y1")    \
    X(x2, "x2")Y(y2, "y2")   \
    X(x3, "x3")Y(y3, "y3")
&lt;/pre&gt;

&lt;p&gt;And then do&lt;/p&gt;

&lt;pre&gt;
#define X(id, idString) id
#define Y(id, idString) _id,
&lt;/pre&gt;

&lt;p&gt;before expanding the macro for the enum.
But that would just give you x1_y1, x2_y2, x3_y3 etc.&lt;/p&gt;

&lt;p&gt;So, in short, beats me :)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>You could use two parameters, by defining something like</p>
<pre>
#define GENERATE_IDS    \
    X(x1, "x1")Y(y1, "y1")    \
    X(x2, "x2")Y(y2, "y2")   \
    X(x3, "x3")Y(y3, "y3")
</pre>
<p>And then do</p>
<pre>
#define X(id, idString) id
#define Y(id, idString) _id,
</pre>
<p>before expanding the macro for the enum.<br />
But that would just give you x1_y1, x2_y2, x3_y3 etc.</p>
<p>So, in short, beats me <img src='http://op.closedformodification.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SeB</title>
		<link>http://op.closedformodification.com/2006/06/18/x-macros/comment-page-1/#comment-331</link>
		<dc:creator>SeB</dc:creator>
		<pubDate>Tue, 09 Jan 2007 16:49:38 +0000</pubDate>
		<guid isPermaLink="false">http://op.closedformodification.com/2006/06/18/x-macros/#comment-331</guid>
		<description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;Is it possible to use X-macros with two dimensions ? If I have two tables :
X.def :   X(x1) , X(x2), ...., X(xm)
Y.def :   Y(y1) , Y(y2), ...., Y(yn) 
can I automatically build an enum {x1_y1, x1_y2,..., x1_yn, x2_y1, x2_y2, ..........., xm_yn} ?&lt;/p&gt;

&lt;p&gt;Thanks,
SeB&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>Is it possible to use X-macros with two dimensions ? If I have two tables :<br />
X.def :   X(x1) , X(x2), &#8230;., X(xm)<br />
Y.def :   Y(y1) , Y(y2), &#8230;., Y(yn)<br />
can I automatically build an enum {x1_y1, x1_y2,&#8230;, x1_yn, x2_y1, x2_y2, &#8230;&#8230;&#8230;.., xm_yn} ?</p>
<p>Thanks,<br />
SeB</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vlummi</title>
		<link>http://op.closedformodification.com/2006/06/18/x-macros/comment-page-1/#comment-28</link>
		<dc:creator>vlummi</dc:creator>
		<pubDate>Thu, 27 Jul 2006 22:12:00 +0000</pubDate>
		<guid isPermaLink="false">http://op.closedformodification.com/2006/06/18/x-macros/#comment-28</guid>
		<description>&lt;p&gt;just for completeness, i found this link..: http://en.wikipedia.org/wiki/C_preprocessor#X-Macros&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>just for completeness, i found this link..: <a href="http://en.wikipedia.org/wiki/C_preprocessor#X-Macros" rel="nofollow">http://en.wikipedia.org/wiki/C_preprocessor#X-Macros</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.288 seconds -->
