<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[boost::function portable-syntax]]></title><description><![CDATA[<p>Kann mir bitte erklären wie die 'portable-syntax' funktioniert?<br />
Denn das hier:</p>
<pre><code class="language-cpp">#include &lt;boost/function.hpp&gt; 
#include &lt;iostream&gt; 

struct world 
{ 
  void hello(void) 
  { 
    std::cout &lt;&lt; &quot;Hello, Boost!&quot; &lt;&lt; std::endl; 
  } 
}; 

int main() 
{ 
  boost::function&lt;void, world*&gt; f = &amp;world::hello; 
  world w; 
  f(&amp;w); 
}
</code></pre>
<p>Ergibt das hier:</p>
<pre><code>In Funktion »int main()«:
Fehler: falsche Anzahl der Templateargumente (2, sollte 1 sein)
Fehler: für »template&lt;class Signature&gt; struct boost::function« bereitgestellt
Fehler: invalid type in declaration before »=« token
Fehler: »void (world::*)()« kann nicht nach »int« in initialization umgewandelt werden
Fehler: »f« kann nicht als Funktion verwendet werden
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/271201/boost-function-portable-syntax</link><generator>RSS for Node</generator><lastBuildDate>Sat, 29 Aug 2026 15:54:20 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/271201.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 24 Jul 2010 17:18:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to boost::function portable-syntax on Sat, 24 Jul 2010 17:18:29 GMT]]></title><description><![CDATA[<p>Kann mir bitte erklären wie die 'portable-syntax' funktioniert?<br />
Denn das hier:</p>
<pre><code class="language-cpp">#include &lt;boost/function.hpp&gt; 
#include &lt;iostream&gt; 

struct world 
{ 
  void hello(void) 
  { 
    std::cout &lt;&lt; &quot;Hello, Boost!&quot; &lt;&lt; std::endl; 
  } 
}; 

int main() 
{ 
  boost::function&lt;void, world*&gt; f = &amp;world::hello; 
  world w; 
  f(&amp;w); 
}
</code></pre>
<p>Ergibt das hier:</p>
<pre><code>In Funktion »int main()«:
Fehler: falsche Anzahl der Templateargumente (2, sollte 1 sein)
Fehler: für »template&lt;class Signature&gt; struct boost::function« bereitgestellt
Fehler: invalid type in declaration before »=« token
Fehler: »void (world::*)()« kann nicht nach »int« in initialization umgewandelt werden
Fehler: »f« kann nicht als Funktion verwendet werden
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1931104</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1931104</guid><dc:creator><![CDATA[functionary]]></dc:creator><pubDate>Sat, 24 Jul 2010 17:18:29 GMT</pubDate></item><item><title><![CDATA[Reply to boost::function portable-syntax on Sat, 24 Jul 2010 17:25:22 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">struct world
{
  void hello(void)
  {
    std::cout &lt;&lt; &quot;Hello, Boost!&quot; &lt;&lt; std::endl;
  }
};

int main()
{
  boost::function1&lt;void, world*&gt; f = &amp;world::hello;
  world w;
  f(&amp;w);
}
</code></pre>
<p>Schau genau, ich hab 1 geändert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1931107</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1931107</guid><dc:creator><![CDATA[so]]></dc:creator><pubDate>Sat, 24 Jul 2010 17:25:22 GMT</pubDate></item><item><title><![CDATA[Reply to boost::function portable-syntax on Sat, 24 Jul 2010 17:30:33 GMT]]></title><description><![CDATA[<p>wtf, steht auch in der docu von boost &gt;.&gt;</p>
<p>habs übersehen... ein &quot;_1&quot; wäre viel übersichtlicher. danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1931109</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1931109</guid><dc:creator><![CDATA[functionary]]></dc:creator><pubDate>Sat, 24 Jul 2010 17:30:33 GMT</pubDate></item><item><title><![CDATA[Reply to boost::function portable-syntax on Sat, 24 Jul 2010 17:32:38 GMT]]></title><description><![CDATA[<p>aber wo steht bitte was die '1, 2,...' bedeuten?<br />
es funktioniert zwar, aber schlauer bin ich nicht gerade geworden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1931111</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1931111</guid><dc:creator><![CDATA[functionary]]></dc:creator><pubDate>Sat, 24 Jul 2010 17:32:38 GMT</pubDate></item><item><title><![CDATA[Reply to boost::function portable-syntax on Sat, 24 Jul 2010 17:41:43 GMT]]></title><description><![CDATA[<p>functionary schrieb:</p>
<blockquote>
<p>aber wo steht bitte was die '1, 2,...' bedeuten?</p>
</blockquote>
<p>Die Zahl der Funktionsparameter vielleicht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1931114</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1931114</guid><dc:creator><![CDATA[krümelkacker]]></dc:creator><pubDate>Sat, 24 Jul 2010 17:41:43 GMT</pubDate></item><item><title><![CDATA[Reply to boost::function portable-syntax on Sat, 24 Jul 2010 17:50:29 GMT]]></title><description><![CDATA[<p>krümelkacker schrieb:</p>
<blockquote>
<p>functionary schrieb:</p>
<blockquote>
<p>aber wo steht bitte was die '1, 2,...' bedeuten?</p>
</blockquote>
<p>Die Zahl der Funktionsparameter vielleicht?</p>
</blockquote>
<p>mist. ich wollte etwas mit variadic-templates und boost::function machen damit ich eine variable anzahl von argumenten an boost::function&lt;T, T, Y, X....&gt; übergeben kann. Möglich oder bietet boost schon was ähnliches an?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1931115</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1931115</guid><dc:creator><![CDATA[functionary]]></dc:creator><pubDate>Sat, 24 Jul 2010 17:50:29 GMT</pubDate></item><item><title><![CDATA[Reply to boost::function portable-syntax on Sat, 24 Jul 2010 19:04:13 GMT]]></title><description><![CDATA[<p>functionary schrieb:</p>
<blockquote>
<p>Möglich oder bietet boost schon was ähnliches an?</p>
</blockquote>
<p>Mit std::function aus dem functional-Header sollte das gehen. Du bist ja mit variadischen Templates sowieso auf C++0x angewiesen und in C++0x gibt es std::function, welches selbst mit variadischen Templates implementiert wird. Der GCC unterstützt das schon scheinbar.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1931130</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1931130</guid><dc:creator><![CDATA[krümelkacker]]></dc:creator><pubDate>Sat, 24 Jul 2010 19:04:13 GMT</pubDate></item></channel></rss>