<?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[Syntax für Typedef auf Template-Function-Pointer]]></title><description><![CDATA[<p>Hallo, ich möchte ein Typedef auf eine Funktion, deren Rückgabewert und Argument Template Variablen sind:</p>
<pre><code class="language-cpp">typedef template&lt;typename T&gt; T (*calculate_function)(const T&amp;);
</code></pre>
<p>Allerdings bekomme ich einen Fehler bom kompilieren:</p>
<pre><code>error: expected unqualified-id before &quot;template&quot;
</code></pre>
<p>Kann man gar keine Pointer zu Template Funktionen erstellen?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/257371/syntax-für-typedef-auf-template-function-pointer</link><generator>RSS for Node</generator><lastBuildDate>Thu, 10 Sep 2026 07:44:16 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/257371.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 27 Dec 2009 15:41:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Syntax für Typedef auf Template-Function-Pointer on Sun, 27 Dec 2009 15:41:57 GMT]]></title><description><![CDATA[<p>Hallo, ich möchte ein Typedef auf eine Funktion, deren Rückgabewert und Argument Template Variablen sind:</p>
<pre><code class="language-cpp">typedef template&lt;typename T&gt; T (*calculate_function)(const T&amp;);
</code></pre>
<p>Allerdings bekomme ich einen Fehler bom kompilieren:</p>
<pre><code>error: expected unqualified-id before &quot;template&quot;
</code></pre>
<p>Kann man gar keine Pointer zu Template Funktionen erstellen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1828523</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1828523</guid><dc:creator><![CDATA[MemberFuncTor]]></dc:creator><pubDate>Sun, 27 Dec 2009 15:41:57 GMT</pubDate></item><item><title><![CDATA[Reply to Syntax für Typedef auf Template-Function-Pointer on Sun, 27 Dec 2009 15:50:13 GMT]]></title><description><![CDATA[<p>MemberFuncTor schrieb:</p>
<blockquote>
<p>Kann man gar keine Pointer zu Template Funktionen erstellen?</p>
</blockquote>
<p>Exakt. Für T wird später ein konkreter Typ eingesetzt, je nach Typ entsteht eine andere Funktion, also ein anderer Zeiger.</p>
<p>Du kannst allerdings sowas machen:</p>
<pre><code class="language-cpp">template &lt;typename T&gt;
struct calculate_function
{
   typedef T (*type)(const T&amp;);
};

int foo(const int&amp;);
calculate_function&lt;int&gt;::type ptr_fn = &amp;foo;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1828527</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1828527</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Sun, 27 Dec 2009 15:50:13 GMT</pubDate></item><item><title><![CDATA[Reply to Syntax für Typedef auf Template-Function-Pointer on Sun, 27 Dec 2009 16:03:24 GMT]]></title><description><![CDATA[<p>typedefs auf templates gehen nicht in C++. Hier findest du eine Erklärung der üblichen alternativen Vorgehensweise:</p>
<p><a href="http://www.gotw.ca/gotw/079.htm" rel="nofollow">http://www.gotw.ca/gotw/079.htm</a></p>
<p>edit: Oh, zu spät. Nexus hat schon alles gesagt, während ich den Link gesucht habe.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1828535</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1828535</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Sun, 27 Dec 2009 16:03:24 GMT</pubDate></item></channel></rss>