<?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[Template-Spezialisierung]]></title><description><![CDATA[<p>Hallo,</p>
<p>kann ich ein Template mit einem Template spezialisieren? Ich versuche mal das in etwas Code zu packen:</p>
<pre><code class="language-cpp">template&lt;int Size&gt; class Typ1 {
  //...
};

template&lt;int Length, class T&gt; class Typ2 {
  //...
};

template&lt;class T&gt; class X {
  void Function();
}

// das ist kein Problem ...
template&lt;&gt;
X&lt;Typ1&lt;8&gt; &gt;::Function() {
  // ...
}

// ... aber geht auch sowas irgendwie???
template&lt;&gt;
X&lt;Typ1&lt;Size&gt; &gt;::Function() {

}

template&lt;&gt;
X&lt;Typ2&lt;Length, Typ1&lt;Size&gt; &gt; &gt;::Function() {

}
</code></pre>
<p>Ich moechte also eine Spezialisierung fuer jede moegliche Konfiguration von Typ1 oder Typ2 haben ...<br />
Falls das irgendwie geht, mit welcher Syntax???</p>
<p>Vielen Dank,<br />
Locke</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/135190/template-spezialisierung</link><generator>RSS for Node</generator><lastBuildDate>Fri, 28 Aug 2026 22:11:54 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/135190.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 31 Jan 2006 14:10:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Template-Spezialisierung on Tue, 31 Jan 2006 14:10:52 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>kann ich ein Template mit einem Template spezialisieren? Ich versuche mal das in etwas Code zu packen:</p>
<pre><code class="language-cpp">template&lt;int Size&gt; class Typ1 {
  //...
};

template&lt;int Length, class T&gt; class Typ2 {
  //...
};

template&lt;class T&gt; class X {
  void Function();
}

// das ist kein Problem ...
template&lt;&gt;
X&lt;Typ1&lt;8&gt; &gt;::Function() {
  // ...
}

// ... aber geht auch sowas irgendwie???
template&lt;&gt;
X&lt;Typ1&lt;Size&gt; &gt;::Function() {

}

template&lt;&gt;
X&lt;Typ2&lt;Length, Typ1&lt;Size&gt; &gt; &gt;::Function() {

}
</code></pre>
<p>Ich moechte also eine Spezialisierung fuer jede moegliche Konfiguration von Typ1 oder Typ2 haben ...<br />
Falls das irgendwie geht, mit welcher Syntax???</p>
<p>Vielen Dank,<br />
Locke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/982057</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/982057</guid><dc:creator><![CDATA[Locke]]></dc:creator><pubDate>Tue, 31 Jan 2006 14:10:52 GMT</pubDate></item><item><title><![CDATA[Reply to Template-Spezialisierung on Tue, 31 Jan 2006 14:32:02 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>geht, schaust du hier: <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-128361-and-start-is-0.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-128361-and-start-is-0.html</a></p>
<p>MfG</p>
<p>GPC</p>
]]></description><link>https://www.c-plusplus.net/forum/post/982085</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/982085</guid><dc:creator><![CDATA[GPC]]></dc:creator><pubDate>Tue, 31 Jan 2006 14:32:02 GMT</pubDate></item><item><title><![CDATA[Reply to Template-Spezialisierung on Wed, 01 Feb 2006 07:35:19 GMT]]></title><description><![CDATA[<p>Klar geht das, du mußt nur die übriggebliebenen Template-Parameter mit angeben:</p>
<pre><code class="language-cpp">template&lt;int Size&gt;
class X&lt;Typ1&lt;Size&gt; &gt;{
  ...
};//X-Spzialisierung für alle Typ1

template&lt;int Length,int Size&gt;
class X&lt;Typ2&lt;Length,Typ1&lt;Size&gt; &gt; &gt;{
  ...
};//X-Spzialisierung für alle Typ2&lt;...,Typ1&gt;
</code></pre>
<p>(Einzelne Memberfunktionen kannst du afaik nicht gesondert spezialisieren, nur die komplette Template-Klasse)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/982704</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/982704</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Wed, 01 Feb 2006 07:35:19 GMT</pubDate></item></channel></rss>