<?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: Calling function via void* pointer with arguments contained in std::container</title>
	<atom:link href="http://blog.shandyba.com/2010/04/22/calling-function-via-void-pointer-with-arguments-as-stdcontainer/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.shandyba.com/2010/04/22/calling-function-via-void-pointer-with-arguments-as-stdcontainer/</link>
	<description></description>
	<lastBuildDate>Wed, 28 Sep 2011 20:53:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: niXman</title>
		<link>http://blog.shandyba.com/2010/04/22/calling-function-via-void-pointer-with-arguments-as-stdcontainer/comment-page-1/#comment-4068</link>
		<dc:creator>niXman</dc:creator>
		<pubDate>Thu, 02 Jun 2011 08:07:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.shandyba.com/?p=89#comment-4068</guid>
		<description>Oh? sorry. Delete this post. I wrote it in Russian :D</description>
		<content:encoded><![CDATA[<p>Oh? sorry. Delete this post. I wrote it in Russian <img src='http://blog.shandyba.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dmitry Shandyba</title>
		<link>http://blog.shandyba.com/2010/04/22/calling-function-via-void-pointer-with-arguments-as-stdcontainer/comment-page-1/#comment-2703</link>
		<dc:creator>Dmitry Shandyba</dc:creator>
		<pubDate>Fri, 25 Feb 2011 09:52:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.shandyba.com/?p=89#comment-2703</guid>
		<description>Heh, that requires boost::fusion, while the original approach is in naked C++0x, showing the mechanics of the process! :)
Also, this approach doesn&#039;t work for functions casted to void* pointers, so the following snippet doesn&#039;t even compile:

&lt;code&gt;
void *pFun = reinterpret_cast&lt;void*&gt;(&amp;f1);
boost::fusion::invoke(pFun, boost::fusion::make_vector());
&lt;/code&gt;

PS Anyway, surely the task should have many possible solutions, including elegant and simple ones, like the one you provided, even if they don&#039;t match the task precisely :) So thanks for that!</description>
		<content:encoded><![CDATA[<p>Heh, that requires boost::fusion, while the original approach is in naked C++0x, showing the mechanics of the process! <img src='http://blog.shandyba.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Also, this approach doesn&#8217;t work for functions casted to void* pointers, so the following snippet doesn&#8217;t even compile:</p>
<p><code><br />
void *pFun = reinterpret_cast<void *>(&#038;f1);<br />
boost::fusion::invoke(pFun, boost::fusion::make_vector());<br />
</void></code></p>
<p>PS Anyway, surely the task should have many possible solutions, including elegant and simple ones, like the one you provided, even if they don&#8217;t match the task precisely <img src='http://blog.shandyba.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  So thanks for that!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: niXman</title>
		<link>http://blog.shandyba.com/2010/04/22/calling-function-via-void-pointer-with-arguments-as-stdcontainer/comment-page-1/#comment-2696</link>
		<dc:creator>niXman</dc:creator>
		<pubDate>Fri, 25 Feb 2011 06:36:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.shandyba.com/?p=89#comment-2696</guid>
		<description>All is much easier ;)


#include 
#include 
#include 
#include 

void f1() {
   std::cout &lt;&lt; &quot;f1()&quot; &lt;&lt; std::endl;
}

int f2() {
   std::cout &lt;&lt; &quot;f2()&quot; &lt;&lt; std::endl;
   return 3;
}

int f3(int v) {
   std::cout &lt;&lt; &quot;f3()&quot; &lt;&lt; std::endl;
   return f2()+v;
}

int main() {
   /** without args */
   boost::fusion::invoke(&amp;f1, boost::fusion::make_vector());

   /** without args */
   boost::fusion::invoke(&amp;f2, boost::fusion::make_vector());

   /** with args */
   int r = boost::fusion::invoke(&amp;f3, boost::fusion::make_vector(3));
   std::cout &lt;&lt; r &lt;&lt; std::endl;
}


http://liveworkspace.org/code/da4fb745ee9f2509eb5af862408e7648</description>
		<content:encoded><![CDATA[<p>All is much easier <img src='http://blog.shandyba.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>#include<br />
#include<br />
#include<br />
#include </p>
<p>void f1() {<br />
   std::cout &lt;&lt; &quot;f1()&quot; &lt;&lt; std::endl;<br />
}</p>
<p>int f2() {<br />
   std::cout &lt;&lt; &quot;f2()&quot; &lt;&lt; std::endl;<br />
   return 3;<br />
}</p>
<p>int f3(int v) {<br />
   std::cout &lt;&lt; &quot;f3()&quot; &lt;&lt; std::endl;<br />
   return f2()+v;<br />
}</p>
<p>int main() {<br />
   /** without args */<br />
   boost::fusion::invoke(&amp;f1, boost::fusion::make_vector());</p>
<p>   /** without args */<br />
   boost::fusion::invoke(&amp;f2, boost::fusion::make_vector());</p>
<p>   /** with args */<br />
   int r = boost::fusion::invoke(&amp;f3, boost::fusion::make_vector(3));<br />
   std::cout &lt;&lt; r &lt;&lt; std::endl;<br />
}</p>
<p><a href="http://liveworkspace.org/code/da4fb745ee9f2509eb5af862408e7648" rel="nofollow">http://liveworkspace.org/code/da4fb745ee9f2509eb5af862408e7648</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

