<?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 0x</title>
	<atom:link href="http://efesx.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://efesx.com</link>
	<description>Technical &#38; low level</description>
	<lastBuildDate>Mon, 30 Apr 2012 17:39:06 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>Comment on Bounded size priority queue by rmn</title>
		<link>http://efesx.com/2012/04/30/bounded-size-priority-queue/#comment-334</link>
		<dc:creator>rmn</dc:creator>
		<pubDate>Mon, 30 Apr 2012 17:39:06 +0000</pubDate>
		<guid isPermaLink="false">http://efesx.com/?p=1333#comment-334</guid>
		<description>You are absolutly right! Fixed.</description>
		<content:encoded><![CDATA[<p>You are absolutly right! Fixed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Bounded size priority queue by Jake</title>
		<link>http://efesx.com/2012/04/30/bounded-size-priority-queue/#comment-333</link>
		<dc:creator>Jake</dc:creator>
		<pubDate>Mon, 30 Apr 2012 17:00:21 +0000</pubDate>
		<guid isPermaLink="false">http://efesx.com/?p=1333#comment-333</guid>
		<description>add an &lt;code&gt;explicit&lt;/code&gt; to your one-integer-argument constructor.

&lt;code&gt;
    explicit bounded_priority_queue (const size_type&amp; maxsize)
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>add an <code>explicit</code> to your one-integer-argument constructor.</p>
<p><code><br />
    explicit bounded_priority_queue (const size_type&amp; maxsize)<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Welcome to efesx.com! by rmn</title>
		<link>http://efesx.com/2012/01/01/welcome-to-efesx-com/#comment-302</link>
		<dc:creator>rmn</dc:creator>
		<pubDate>Thu, 19 Apr 2012 23:50:19 +0000</pubDate>
		<guid isPermaLink="false">http://efesx.com/?p=1#comment-302</guid>
		<description>That part was a mistake and is now removed :)

Welcome though.</description>
		<content:encoded><![CDATA[<p>That part was a mistake and is now removed <img src='http://efesx.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Welcome though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Welcome to efesx.com! by yos</title>
		<link>http://efesx.com/2012/01/01/welcome-to-efesx-com/#comment-298</link>
		<dc:creator>yos</dc:creator>
		<pubDate>Thu, 19 Apr 2012 23:42:25 +0000</pubDate>
		<guid isPermaLink="false">http://efesx.com/?p=1#comment-298</guid>
		<description>i&#039;ve already donated in the office</description>
		<content:encoded><![CDATA[<p>i&#8217;ve already donated in the office</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Variadic macro to count number of arguments by Austin Morgan</title>
		<link>http://efesx.com/2010/07/17/variadic-macro-to-count-number-of-arguments/#comment-290</link>
		<dc:creator>Austin Morgan</dc:creator>
		<pubDate>Mon, 16 Apr 2012 14:20:57 +0000</pubDate>
		<guid isPermaLink="false">http://cplusplus.co.il/?p=1003#comment-290</guid>
		<description>I find an additional level of indirection helps microsoft.

#define macro_dispatcher(macro, ...) macro_dispatcher_(macro, VA_NARGS(__VA_ARGS__))
#define macro_dispatcher_(macro, nargs) macro_dispatcher__(macro, nargs)
#define macro_dispatcher__(macro, nargs) macro_dispatcher___(macro, nargs)
#define macro_dispatcher___(macro, nargs) macro ## nargs</description>
		<content:encoded><![CDATA[<p>I find an additional level of indirection helps microsoft.</p>
<p>#define macro_dispatcher(macro, &#8230;) macro_dispatcher_(macro, VA_NARGS(__VA_ARGS__))<br />
#define macro_dispatcher_(macro, nargs) macro_dispatcher__(macro, nargs)<br />
#define macro_dispatcher__(macro, nargs) macro_dispatcher___(macro, nargs)<br />
#define macro_dispatcher___(macro, nargs) macro ## nargs</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Variadic macro to count number of arguments by MattG</title>
		<link>http://efesx.com/2010/07/17/variadic-macro-to-count-number-of-arguments/#comment-289</link>
		<dc:creator>MattG</dc:creator>
		<pubDate>Sun, 25 Mar 2012 02:43:37 +0000</pubDate>
		<guid isPermaLink="false">http://cplusplus.co.il/?p=1003#comment-289</guid>
		<description>Thanks for posting this!

Regarding the first sourcecode line from the article:

  #define VA_NUM_ARGS(...) VA_NUM_ARGS_IMPL(__VA_ARGS__, 5,4,3,2,1)

I think C99 requires at least one argument to be specified for __VA_ARGS__, when ... is used in combination with named parameters.  This means VA_NUM_ARGS() will fail when passed only a single parameter.

However, it can be fixed by simply adding an extra param to the invocation of VA_NUM_ARGS_IMPL(), like this:

  #define VA_NUM_ARGS(...) VA_NUM_ARGS_IMPL(__VA_ARGS__, 5,4,3,2,1,unused)

I chose to call it &quot;unused&quot; to indicate that it&#039;s a meaningless filler.</description>
		<content:encoded><![CDATA[<p>Thanks for posting this!</p>
<p>Regarding the first sourcecode line from the article:</p>
<p>  #define VA_NUM_ARGS(&#8230;) VA_NUM_ARGS_IMPL(__VA_ARGS__, 5,4,3,2,1)</p>
<p>I think C99 requires at least one argument to be specified for __VA_ARGS__, when &#8230; is used in combination with named parameters.  This means VA_NUM_ARGS() will fail when passed only a single parameter.</p>
<p>However, it can be fixed by simply adding an extra param to the invocation of VA_NUM_ARGS_IMPL(), like this:</p>
<p>  #define VA_NUM_ARGS(&#8230;) VA_NUM_ARGS_IMPL(__VA_ARGS__, 5,4,3,2,1,unused)</p>
<p>I chose to call it &#8220;unused&#8221; to indicate that it&#8217;s a meaningless filler.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Variadic macro to count number of arguments by MattG</title>
		<link>http://efesx.com/2010/07/17/variadic-macro-to-count-number-of-arguments/#comment-288</link>
		<dc:creator>MattG</dc:creator>
		<pubDate>Sun, 25 Mar 2012 02:39:47 +0000</pubDate>
		<guid isPermaLink="false">http://cplusplus.co.il/?p=1003#comment-288</guid>
		<description>This uses a nonstandard GCC extension.  See http://gcc.gnu.org/onlinedocs/gcc-4.7.0/cpp/Variadic-Macros.html#Variadic-Macros</description>
		<content:encoded><![CDATA[<p>This uses a nonstandard GCC extension.  See <a href="http://gcc.gnu.org/onlinedocs/gcc-4.7.0/cpp/Variadic-Macros.html#Variadic-Macros" rel="nofollow">http://gcc.gnu.org/onlinedocs/gcc-4.7.0/cpp/Variadic-Macros.html#Variadic-Macros</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Variadic macro to count number of arguments by A.Ahmed</title>
		<link>http://efesx.com/2010/07/17/variadic-macro-to-count-number-of-arguments/#comment-287</link>
		<dc:creator>A.Ahmed</dc:creator>
		<pubDate>Tue, 21 Feb 2012 08:52:49 +0000</pubDate>
		<guid isPermaLink="false">http://cplusplus.co.il/?p=1003#comment-287</guid>
		<description>I am using Microsoft visual studio 2010 and I faced a problem with _VA_ARGE_
I used the solution provided by Stan   
-----------------------------------------------------------------------------------------
#define VA_NUM_ARGS(…) VA_NUM_ARGS_IMPL_((__VA_ARGS__, 5,4,3,2,1))
#define VA_NUM_ARGS_IMPL_(tuple) VA_NUM_ARGS_IMPL tuple
#define VA_NUM_ARGS_IMPL(_1,_2,_3,_4,_5,N,…) N
-----------------------------------------------------------------------------------------
it works very well  but when I tired to apply the example provided by Rmn 

----------------------------------------------------------------------------------------
#define macro_dispatcher(func, ...) \
            macro_dispatcher_(func, VA_NUM_ARGS(__VA_ARGS__))
#define macro_dispatcher_(func, nargs) \
            macro_dispatcher__(func, nargs)
#define macro_dispatcher__(func, nargs) \
            func ## nargs

#define max(...) macro_dispatcher(max, __VA_ARGS__)(__VA_ARGS__)

#define max1(a) a
#define max2(a,b) ((a)&gt;(b)?(a):(b))
#define max3(a,b,c) max2(max2(a,b),c)
// ...

// to verify, run the preprocessor alone (g++ -E):
max(1,2,3);
-------------------------------------------------------------------------------------------
if I called max(1,c); 
I got that error

maxVA_NUM_ARGS_IMPL (1,c, 5,4,3,2,1) (1,c);</description>
		<content:encoded><![CDATA[<p>I am using Microsoft visual studio 2010 and I faced a problem with _VA_ARGE_<br />
I used the solution provided by Stan<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
#define VA_NUM_ARGS(…) VA_NUM_ARGS_IMPL_((__VA_ARGS__, 5,4,3,2,1))<br />
#define VA_NUM_ARGS_IMPL_(tuple) VA_NUM_ARGS_IMPL tuple<br />
#define VA_NUM_ARGS_IMPL(_1,_2,_3,_4,_5,N,…) N<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
it works very well  but when I tired to apply the example provided by Rmn </p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
#define macro_dispatcher(func, &#8230;) \<br />
            macro_dispatcher_(func, VA_NUM_ARGS(__VA_ARGS__))<br />
#define macro_dispatcher_(func, nargs) \<br />
            macro_dispatcher__(func, nargs)<br />
#define macro_dispatcher__(func, nargs) \<br />
            func ## nargs</p>
<p>#define max(&#8230;) macro_dispatcher(max, __VA_ARGS__)(__VA_ARGS__)</p>
<p>#define max1(a) a<br />
#define max2(a,b) ((a)&gt;(b)?(a):(b))<br />
#define max3(a,b,c) max2(max2(a,b),c)<br />
// &#8230;</p>
<p>// to verify, run the preprocessor alone (g++ -E):<br />
max(1,2,3);<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
if I called max(1,c);<br />
I got that error</p>
<p>maxVA_NUM_ARGS_IMPL (1,c, 5,4,3,2,1) (1,c);</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Reference to temporary by Boris Batkin</title>
		<link>http://efesx.com/2009/09/20/reference-to-temporary/#comment-286</link>
		<dc:creator>Boris Batkin</dc:creator>
		<pubDate>Tue, 31 Jan 2012 01:36:51 +0000</pubDate>
		<guid isPermaLink="false">http://cpptalk.wordpress.com/?p=254#comment-286</guid>
		<description>It&#039;s not virtual dispatching, since its temp object being destructed. And type of that temp object is known at compilation time. Think of it as if it was something in the lines of { B tmp = func(); const &amp; A = tmp; }, only with the move semantics. Otherwise very good article.</description>
		<content:encoded><![CDATA[<p>It&#8217;s not virtual dispatching, since its temp object being destructed. And type of that temp object is known at compilation time. Think of it as if it was something in the lines of { B tmp = func(); const &amp; A = tmp; }, only with the move semantics. Otherwise very good article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Imitation of Java Generics by Andrzej Krzemieński</title>
		<link>http://efesx.com/2010/12/31/imitation-of-java-generics/#comment-284</link>
		<dc:creator>Andrzej Krzemieński</dc:creator>
		<pubDate>Fri, 30 Sep 2011 11:50:35 +0000</pubDate>
		<guid isPermaLink="false">http://cplusplus.co.il/?p=1094#comment-284</guid>
		<description>Hi,
I would like to add to your view of generics that apart from problems like clumsy interface (we require unnecessary inheritance) and some safety issues, they have obvious advantages over templates, at least when it comes to defining generic containers:
1. No cryptic error messages.
2. Much faster compilation - a generic can be compiled once, regardless of how many times you instantiate it and with how many types.
3. Smaller executable - each template instantiation generates almost the same code time and again - this is not so for generics

That said, I would also not like to see generics in C++. You can still implement something similar yourself using templates.

Regards,
&amp;rzej</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I would like to add to your view of generics that apart from problems like clumsy interface (we require unnecessary inheritance) and some safety issues, they have obvious advantages over templates, at least when it comes to defining generic containers:<br />
1. No cryptic error messages.<br />
2. Much faster compilation &#8211; a generic can be compiled once, regardless of how many times you instantiate it and with how many types.<br />
3. Smaller executable &#8211; each template instantiation generates almost the same code time and again &#8211; this is not so for generics</p>
<p>That said, I would also not like to see generics in C++. You can still implement something similar yourself using templates.</p>
<p>Regards,<br />
&amp;rzej</p>
]]></content:encoded>
	</item>
</channel>
</rss>

