<?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 mit template parameter geht nicht]]></title><description><![CDATA[<p>hallo zusammen,</p>
<p>warum geht folgender code nicht?</p>
<pre><code class="language-cpp">template &lt;typename T, &lt; S=ReferenceTimer&lt;T&gt; &gt;
        class ReferenceTimerQueue : public PairQueue&lt;T, S *&gt; {

        public:
            void add(S * timer);           
        };

        template &lt;typename T, typename S=ReferenceTimer&lt;T&gt; &gt;
        void ReferenceTimerQueue::add(S * timer){

            T &amp; ref = timer-&gt;getReference();
            PairQueue&lt;T, S *&gt;::add(ref, timer);

       }
</code></pre>
<p>Der Fehler ist:</p>
<pre><code>ReferenceTimerQueue.h:39: error: ‘template&lt;class T, class S&gt; class ReferenceTimerQueue’ used without template parameters
ReferenceTimerQueue.h:39: error: default template arguments may not be used in function templates
ReferenceTimerQueue.h:39: error: ‘template&lt;class T, class S&gt; class ReferenceTimerQueue’ used without template parameters
ReferenceTimerQueue.h:39: error: default template arguments may not be used in function templates
</code></pre>
<p>Vielen Dank. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/313970/template-mit-template-parameter-geht-nicht</link><generator>RSS for Node</generator><lastBuildDate>Sat, 01 Aug 2026 19:23:54 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/313970.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 15 Feb 2013 18:27:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to template mit template parameter geht nicht on Fri, 15 Feb 2013 18:27:34 GMT]]></title><description><![CDATA[<p>hallo zusammen,</p>
<p>warum geht folgender code nicht?</p>
<pre><code class="language-cpp">template &lt;typename T, &lt; S=ReferenceTimer&lt;T&gt; &gt;
        class ReferenceTimerQueue : public PairQueue&lt;T, S *&gt; {

        public:
            void add(S * timer);           
        };

        template &lt;typename T, typename S=ReferenceTimer&lt;T&gt; &gt;
        void ReferenceTimerQueue::add(S * timer){

            T &amp; ref = timer-&gt;getReference();
            PairQueue&lt;T, S *&gt;::add(ref, timer);

       }
</code></pre>
<p>Der Fehler ist:</p>
<pre><code>ReferenceTimerQueue.h:39: error: ‘template&lt;class T, class S&gt; class ReferenceTimerQueue’ used without template parameters
ReferenceTimerQueue.h:39: error: default template arguments may not be used in function templates
ReferenceTimerQueue.h:39: error: ‘template&lt;class T, class S&gt; class ReferenceTimerQueue’ used without template parameters
ReferenceTimerQueue.h:39: error: default template arguments may not be used in function templates
</code></pre>
<p>Vielen Dank. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2299175</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2299175</guid><dc:creator><![CDATA[sven_]]></dc:creator><pubDate>Fri, 15 Feb 2013 18:27:34 GMT</pubDate></item><item><title><![CDATA[Reply to template mit template parameter geht nicht on Fri, 15 Feb 2013 18:32:42 GMT]]></title><description><![CDATA[<pre><code>void ReferenceTimerQueue&lt;T, S&gt;::add(S * timer) {
</code></pre>
<p>Und oben fehlt ein typename vor S.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2299178</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2299178</guid><dc:creator><![CDATA[cooky451]]></dc:creator><pubDate>Fri, 15 Feb 2013 18:32:42 GMT</pubDate></item><item><title><![CDATA[Reply to template mit template parameter geht nicht on Fri, 15 Feb 2013 19:02:44 GMT]]></title><description><![CDATA[<p>ach dämlich. vielen dank <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2299183</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2299183</guid><dc:creator><![CDATA[sven_]]></dc:creator><pubDate>Fri, 15 Feb 2013 19:02:44 GMT</pubDate></item></channel></rss>