<?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[Bereichsoperator: Funktion ohne Signatur]]></title><description><![CDATA[<p>Hallo ihr Lieben,</p>
<p>ich bin bin <a href="http://stackoverflow.com/questions/13289311/c-function-pointers-with-c11-lambdas/18413206#18413206" rel="nofollow">in diesem Stack Overflow</a> Eintrag auf folgendes Template gestoßen:</p>
<pre><code class="language-cpp">template&lt; typename F &gt;  class gsl_function_pp : public gsl_function {
 public:
 gsl_function_pp(const F&amp; func) : _func(func) {
   function = &amp;gsl_function_pp::invoke;
   params=this;
 }
 private:
 const F&amp; _func;
 static double invoke(double x, void *params) {
 return static_cast&lt;gsl_function_pp*&gt;(params)-&gt;_func(x);
 }
 };
</code></pre>
<p>Dabei wundert mich Zeile 4: Warum muss bei dem <code>invoke</code> nicht nocht die Signature aus Zeile 9 angegeben werden? Ich hätte mir noch vorstellen können auf das <code>x</code> und <code>params</code> (also den Bezeichner?) zu verzichten, aber so ganze ohne Signatur?</p>
<p>Gruß,<br />
-- Klaus.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/326774/bereichsoperator-funktion-ohne-signatur</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Jul 2026 17:41:44 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/326774.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 06 Jul 2014 18:55:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bereichsoperator: Funktion ohne Signatur on Sun, 06 Jul 2014 18:55:13 GMT]]></title><description><![CDATA[<p>Hallo ihr Lieben,</p>
<p>ich bin bin <a href="http://stackoverflow.com/questions/13289311/c-function-pointers-with-c11-lambdas/18413206#18413206" rel="nofollow">in diesem Stack Overflow</a> Eintrag auf folgendes Template gestoßen:</p>
<pre><code class="language-cpp">template&lt; typename F &gt;  class gsl_function_pp : public gsl_function {
 public:
 gsl_function_pp(const F&amp; func) : _func(func) {
   function = &amp;gsl_function_pp::invoke;
   params=this;
 }
 private:
 const F&amp; _func;
 static double invoke(double x, void *params) {
 return static_cast&lt;gsl_function_pp*&gt;(params)-&gt;_func(x);
 }
 };
</code></pre>
<p>Dabei wundert mich Zeile 4: Warum muss bei dem <code>invoke</code> nicht nocht die Signature aus Zeile 9 angegeben werden? Ich hätte mir noch vorstellen können auf das <code>x</code> und <code>params</code> (also den Bezeichner?) zu verzichten, aber so ganze ohne Signatur?</p>
<p>Gruß,<br />
-- Klaus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2407273</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2407273</guid><dc:creator><![CDATA[Klaus82]]></dc:creator><pubDate>Sun, 06 Jul 2014 18:55:13 GMT</pubDate></item><item><title><![CDATA[Reply to Bereichsoperator: Funktion ohne Signatur on Sun, 06 Jul 2014 19:11:48 GMT]]></title><description><![CDATA[<p>Sofern die Funktion nicht überladen ist, ist das eindeutig. Das Feature stammt noch aus C, wo es keine Überladungen gibt, dann macht es umgekehrt keinen Sinn, die Parametertypen anzugeben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2407275</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2407275</guid><dc:creator><![CDATA[nonprob]]></dc:creator><pubDate>Sun, 06 Jul 2014 19:11:48 GMT</pubDate></item><item><title><![CDATA[Reply to Bereichsoperator: Funktion ohne Signatur on Sun, 06 Jul 2014 19:13:06 GMT]]></title><description><![CDATA[<p>In zeile 4 wird ein adresse auf die funktion in der Variable &quot;function&quot; gespeichert. (Sichwort: Funktionszeiger)<br />
Und dafür braucht man die Parameterliste nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2407276</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2407276</guid><dc:creator><![CDATA[firefly]]></dc:creator><pubDate>Sun, 06 Jul 2014 19:13:06 GMT</pubDate></item><item><title><![CDATA[Reply to Bereichsoperator: Funktion ohne Signatur on Sun, 06 Jul 2014 19:14:46 GMT]]></title><description><![CDATA[<p>Okay,</p>
<p>vielen Dank.</p>
<p>Aber der Compiler würde auch das Angeben der Signatur verstehen?</p>
<p>Gruß,<br />
-- Klaus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2407277</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2407277</guid><dc:creator><![CDATA[Klaus82]]></dc:creator><pubDate>Sun, 06 Jul 2014 19:14:46 GMT</pubDate></item><item><title><![CDATA[Reply to Bereichsoperator: Funktion ohne Signatur on Sun, 06 Jul 2014 19:20:45 GMT]]></title><description><![CDATA[<p>Nein.</p>
<p>(ausser du meinst mit &quot;Signatur angeben&quot; &quot;zum entsprechenden Funktionszeiger casten&quot; -- aber Parameterlisten sind syntaktisch falsch)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2407278</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2407278</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Sun, 06 Jul 2014 19:20:45 GMT</pubDate></item></channel></rss>