<?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[Funktionsnamen als Templateparameter?]]></title><description><![CDATA[<p>Wie kann man Funktionsnamen als Templateparameter angeben?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/222454/funktionsnamen-als-templateparameter</link><generator>RSS for Node</generator><lastBuildDate>Mon, 05 Oct 2026 02:54:20 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/222454.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 12 Sep 2008 17:25:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Funktionsnamen als Templateparameter? on Fri, 12 Sep 2008 17:25:35 GMT]]></title><description><![CDATA[<p>Wie kann man Funktionsnamen als Templateparameter angeben?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1581092</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1581092</guid><dc:creator><![CDATA[hihohuhe]]></dc:creator><pubDate>Fri, 12 Sep 2008 17:25:35 GMT</pubDate></item><item><title><![CDATA[Reply to Funktionsnamen als Templateparameter? on Fri, 12 Sep 2008 17:47:04 GMT]]></title><description><![CDATA[<p>Namen können keine Templateparameter sein, wohl aber Funktionszeiger auf Funktionen mit externer Verlinkung. z.B.</p>
<pre><code class="language-cpp">template &lt;typename Arg1, typename Arg2, typename Result, Result (*fun)(Arg1, Arg2)&gt;
struct binary_function2function_object
    : public std::binary_function&lt;
          typename std::tr1::remove_cv&lt; typename std::tr1::remove_reference&lt; Arg1 &gt;::type &gt;::type,
          typename std::tr1::remove_cv&lt; typename std::tr1::remove_reference&lt; Arg2 &gt;::type &gt;::type,
          Result &gt;
{
    Result operator()(Arg1 arg1, Arg2 arg2) const { return fun( arg1, arg2 ); }
};

struct Foo { ... };
void compare_foo(const Foo&amp;, const Foo&amp;);

std::set&lt; Foo, binary_function2function_object&lt; const Foo&amp;, const Foo&amp;, bool, compare_foo &gt; &gt; my_set;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1581094</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1581094</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Fri, 12 Sep 2008 17:47:04 GMT</pubDate></item><item><title><![CDATA[Reply to Funktionsnamen als Templateparameter? on Sat, 13 Sep 2008 16:13:07 GMT]]></title><description><![CDATA[<p>... oder einfach &quot;Funktoren&quot; (= Objekte von Klassen, die den operator() definieren) - kann man auch ganz ohne &quot;template-magic&quot; machen.</p>
<p>Gruß,</p>
<p>Simon2.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1581397</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1581397</guid><dc:creator><![CDATA[Simon2]]></dc:creator><pubDate>Sat, 13 Sep 2008 16:13:07 GMT</pubDate></item></channel></rss>