<?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[problem mit (expliziter) spezialisierung von funktionstemplate]]></title><description><![CDATA[<pre><code class="language-cpp">struct X { typedef int type; };

template&lt;typename T&gt;
void f(const typename T::type* foo);

template&lt;&gt;
void f&lt;X&gt;(const X::type* foo) {}
</code></pre>
<p>vc++ 7.1 behauptet:</p>
<blockquote>
<p>error C2912: explicit specialization; 'void f&lt;X&gt;(const X::type *)' is not a specialization of a function template</p>
</blockquote>
<p>g++ schluckt es ohne probleme. Ist das nun mein fehler oder spinnt der compiler?<br />
Schätze im zweifel schreib ich eben einen Funktor - zumindest akzeptiert es dann auch vc++.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/119096/problem-mit-expliziter-spezialisierung-von-funktionstemplate</link><generator>RSS for Node</generator><lastBuildDate>Wed, 23 Sep 2026 15:35:04 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/119096.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 27 Aug 2005 19:51:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to problem mit (expliziter) spezialisierung von funktionstemplate on Sat, 27 Aug 2005 19:51:22 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">struct X { typedef int type; };

template&lt;typename T&gt;
void f(const typename T::type* foo);

template&lt;&gt;
void f&lt;X&gt;(const X::type* foo) {}
</code></pre>
<p>vc++ 7.1 behauptet:</p>
<blockquote>
<p>error C2912: explicit specialization; 'void f&lt;X&gt;(const X::type *)' is not a specialization of a function template</p>
</blockquote>
<p>g++ schluckt es ohne probleme. Ist das nun mein fehler oder spinnt der compiler?<br />
Schätze im zweifel schreib ich eben einen Funktor - zumindest akzeptiert es dann auch vc++.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/859791</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/859791</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Sat, 27 Aug 2005 19:51:22 GMT</pubDate></item><item><title><![CDATA[Reply to problem mit (expliziter) spezialisierung von funktionstemplate on Sat, 27 Aug 2005 20:25:42 GMT]]></title><description><![CDATA[<p>überladen sollte gehen:</p>
<pre><code class="language-cpp">void f(const X::type* foo) {};
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/859812</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/859812</guid><dc:creator><![CDATA[ness]]></dc:creator><pubDate>Sat, 27 Aug 2005 20:25:42 GMT</pubDate></item><item><title><![CDATA[Reply to problem mit (expliziter) spezialisierung von funktionstemplate on Sat, 27 Aug 2005 20:30:36 GMT]]></title><description><![CDATA[<p>das geht, nützt mir hier aber nichts. X ist eine art traits klasse, und type kann für verschiedene T identisch sein, trotzdem handelt es sich um verschiedene funktionen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/859816</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/859816</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Sat, 27 Aug 2005 20:30:36 GMT</pubDate></item><item><title><![CDATA[Reply to problem mit (expliziter) spezialisierung von funktionstemplate on Sun, 28 Aug 2005 15:26:58 GMT]]></title><description><![CDATA[<p>Mir ist grad noch was eingefallen:</p>
<pre><code class="language-cpp">template&lt;class T&gt;
struct help
{
    static void f(const typename T::type* foo)
    {
        //...
    };
};

template&lt;&gt;
struct help&lt;X&gt;
{
    static void f&lt;(const X::type* foo) {};
};

template&lt;class T&gt;
void f(const typename T::type* foo)
{
    return help&lt;T&gt;::f(foo);
};
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/860143</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/860143</guid><dc:creator><![CDATA[ness]]></dc:creator><pubDate>Sun, 28 Aug 2005 15:26:58 GMT</pubDate></item><item><title><![CDATA[Reply to problem mit (expliziter) spezialisierung von funktionstemplate on Wed, 13 Jun 2007 10:55:10 GMT]]></title><description><![CDATA[<p>auch wenn das thema angestaubt ist, aber ich hat das gleiche problem und habs grad eben kapiert warum das hier nicht gehen kann.</p>
<p>als funkionsparameter wird ein typ verwendet der in X definiert wird. wenn mans nun aber mit X spezialisiert sieht der compiler nur: einen typ X mit dem die funktion ausgeprägt wurde und einen paramter X::type* was effektiv ein int ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1304723</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1304723</guid><dc:creator><![CDATA[Jason_Frost]]></dc:creator><pubDate>Wed, 13 Jun 2007 10:55:10 GMT</pubDate></item></channel></rss>