<?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]]></title><description><![CDATA[<p>hallo ^^<br />
ich will eine template-funktion schreiben, die in etwa so aufgebaut ist:</p>
<pre><code class="language-cpp">#include &lt;iterator&gt;
#include &lt;vector&gt;

template &lt;class T&gt;
	void foo (T &amp;ergebnis, const T::iterator &amp;start)
</code></pre>
<p>also es wird ein Container übergeben (z.bsp. vector oder deque) und ein zugehöriger iterator.</p>
<p>Nun will mein VS das aber nicht so richtig machen : &lt;<br />
Ich will aber nicht jedes mal 7 template-Argumente mit angeben müssen - oder geht das nicht anders?</p>
<p>Die Fehlermeldung dazu:</p>
<pre><code>warning C4346: 'std::vector&lt;T&gt;::iterator': Abhängiger Name ist kein Typ
	Präfix mit 'typename' zum Angeben eines Typs
error C2061: Syntaxfehler: Bezeichner 'iterator'
</code></pre>
<p>Danke schon mal : &gt;</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/212639/template</link><generator>RSS for Node</generator><lastBuildDate>Wed, 14 Oct 2026 18:49:06 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/212639.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 08 May 2008 16:47:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to template on Thu, 08 May 2008 16:47:18 GMT]]></title><description><![CDATA[<p>hallo ^^<br />
ich will eine template-funktion schreiben, die in etwa so aufgebaut ist:</p>
<pre><code class="language-cpp">#include &lt;iterator&gt;
#include &lt;vector&gt;

template &lt;class T&gt;
	void foo (T &amp;ergebnis, const T::iterator &amp;start)
</code></pre>
<p>also es wird ein Container übergeben (z.bsp. vector oder deque) und ein zugehöriger iterator.</p>
<p>Nun will mein VS das aber nicht so richtig machen : &lt;<br />
Ich will aber nicht jedes mal 7 template-Argumente mit angeben müssen - oder geht das nicht anders?</p>
<p>Die Fehlermeldung dazu:</p>
<pre><code>warning C4346: 'std::vector&lt;T&gt;::iterator': Abhängiger Name ist kein Typ
	Präfix mit 'typename' zum Angeben eines Typs
error C2061: Syntaxfehler: Bezeichner 'iterator'
</code></pre>
<p>Danke schon mal : &gt;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1505573</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1505573</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Thu, 08 May 2008 16:47:18 GMT</pubDate></item><item><title><![CDATA[Reply to template on Thu, 08 May 2008 16:49:29 GMT]]></title><description><![CDATA[<p>unskilled schrieb:</p>
<blockquote>
<pre><code>Präfix mit 'typename' zum Angeben eines Typs
</code></pre>
</blockquote>
<p>Ansonsten liegt dein Fehler nebenbei auch mehr oder weniuger außerhalb des Codeabschnitts, den du gepostet hast</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1505577</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1505577</guid><dc:creator><![CDATA[darthdespotism]]></dc:creator><pubDate>Thu, 08 May 2008 16:49:29 GMT</pubDate></item><item><title><![CDATA[Reply to template on Thu, 08 May 2008 17:07:38 GMT]]></title><description><![CDATA[<p>Ahhh - sry - hatte das typename überall probiert - nur halt nicht vor dem const xD danke <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f611.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--expressionless_face"
      title="-_-"
      alt="😑"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1505586</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1505586</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Thu, 08 May 2008 17:07:38 GMT</pubDate></item><item><title><![CDATA[Reply to template on Thu, 08 May 2008 20:04:48 GMT]]></title><description><![CDATA[<p>unskilled schrieb:</p>
<blockquote>
<p>Ahhh - sry - hatte das typename überall probiert - nur halt nicht vor dem const xD danke <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f611.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--expressionless_face"
      title="-_-"
      alt="😑"
    /></p>
</blockquote>
<p>Wieder mal ein Grund, warum ich postfix-const bevorzuge. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>Gruß,</p>
<p>Simon2.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1505676</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1505676</guid><dc:creator><![CDATA[Simon2]]></dc:creator><pubDate>Thu, 08 May 2008 20:04:48 GMT</pubDate></item></channel></rss>