<?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 template parameter Frage]]></title><description><![CDATA[<p>Folgender Fall:</p>
<pre><code class="language-cpp">template &lt; template &lt; class &gt; class policy &gt; class foo: public policy &lt; some_traits &lt; ..... &gt; &gt;
{
};

template &lt; class traits &gt; class simple_policy {}; // OK
template &lt; class traits, unsigned int extra_value &gt; class extra_policy {}; // Problem
</code></pre>
<p>Ich will in der Lage sein, das zu erreichen:</p>
<pre><code class="language-cpp">foo &lt; simple_policy &gt; foo1;
foo &lt; extra_policy &lt; 5 &gt; &gt; foo2;
</code></pre>
<p>Bis dato ist mir keine direkte Lösung eingefallen, nur das:</p>
<pre><code class="language-cpp">template &lt; unsigned int extra_value &gt; struct extra_policy { template &lt; class traits &gt; class type { ... }; };
foo &lt; extra_policy &lt; 5 &gt; ::type &gt; foo2;
</code></pre>
<p>Hat jemand einen besseren Vorschlag?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/196317/template-template-parameter-frage</link><generator>RSS for Node</generator><lastBuildDate>Wed, 30 Sep 2026 10:07:16 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/196317.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 28 Oct 2007 11:31:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to template template parameter Frage on Sun, 28 Oct 2007 11:31:57 GMT]]></title><description><![CDATA[<p>Folgender Fall:</p>
<pre><code class="language-cpp">template &lt; template &lt; class &gt; class policy &gt; class foo: public policy &lt; some_traits &lt; ..... &gt; &gt;
{
};

template &lt; class traits &gt; class simple_policy {}; // OK
template &lt; class traits, unsigned int extra_value &gt; class extra_policy {}; // Problem
</code></pre>
<p>Ich will in der Lage sein, das zu erreichen:</p>
<pre><code class="language-cpp">foo &lt; simple_policy &gt; foo1;
foo &lt; extra_policy &lt; 5 &gt; &gt; foo2;
</code></pre>
<p>Bis dato ist mir keine direkte Lösung eingefallen, nur das:</p>
<pre><code class="language-cpp">template &lt; unsigned int extra_value &gt; struct extra_policy { template &lt; class traits &gt; class type { ... }; };
foo &lt; extra_policy &lt; 5 &gt; ::type &gt; foo2;
</code></pre>
<p>Hat jemand einen besseren Vorschlag?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1393509</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1393509</guid><dc:creator><![CDATA[dv_]]></dc:creator><pubDate>Sun, 28 Oct 2007 11:31:57 GMT</pubDate></item><item><title><![CDATA[Reply to template template parameter Frage on Sun, 28 Oct 2007 11:42:19 GMT]]></title><description><![CDATA[<p>Wie wäre es damit:</p>
<pre><code class="language-cpp">template&lt;typename TPolicy&gt;
class foo /* : ... */ {

    // ...
};

class simple_policy() { /* ... */ };

template&lt;unsigned int extra_value&gt;
class extra_policy {

    // ...
}

// Dann kannst du das machen:
foo&lt;simple_policiy&gt; foo1;
foo&lt;extra_policy&lt;5&gt; &gt; foo2;
</code></pre>
<p>Oder versteh ich was falsch?</p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1393514</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1393514</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Sun, 28 Oct 2007 11:42:19 GMT</pubDate></item><item><title><![CDATA[Reply to template template parameter Frage on Sun, 28 Oct 2007 12:06:39 GMT]]></title><description><![CDATA[<p>Du hast auf die traits vergessen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1393531</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1393531</guid><dc:creator><![CDATA[dv_]]></dc:creator><pubDate>Sun, 28 Oct 2007 12:06:39 GMT</pubDate></item><item><title><![CDATA[Reply to template template parameter Frage on Sun, 28 Oct 2007 14:29:29 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">struct simple_policy {
  template&lt;typename Traits&gt;
  struct policy { ... };
};

template&lt;int X&gt;
struct extra_policy {
  template&lt;typename Traits&gt;
  struct policy { ... };
};

template&lt;typename Policy, typename Traits&gt;
struct foo {
  typedef typename Policy::template policy&lt;Traits&gt; policy;
}
</code></pre>
<p>Oder fragments.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1393602</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1393602</guid><dc:creator><![CDATA[Mr. N]]></dc:creator><pubDate>Sun, 28 Oct 2007 14:29:29 GMT</pubDate></item></channel></rss>