<?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 verwenden in typedef bzw. std::pair ?]]></title><description><![CDATA[<p>Hallo,<br />
Ich würde gerne wissen ob es blödsinn ist templates in typedefinitions zu verwenden. Geht das nicht? Mein Compiler schreit mit &quot;T was not declared in this scope&quot;.</p>
<p>Ich verwende das Ding so:</p>
<pre><code>typedef std::pair&lt; Key, HASH_DATA&lt;T&gt; &gt; Hash_Pair;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/220596/template-verwenden-in-typedef-bzw-std-pair</link><generator>RSS for Node</generator><lastBuildDate>Wed, 07 Oct 2026 00:09:38 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/220596.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 18 Aug 2008 14:17:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Template verwenden in typedef bzw. std::pair ? on Mon, 18 Aug 2008 14:17:02 GMT]]></title><description><![CDATA[<p>Hallo,<br />
Ich würde gerne wissen ob es blödsinn ist templates in typedefinitions zu verwenden. Geht das nicht? Mein Compiler schreit mit &quot;T was not declared in this scope&quot;.</p>
<p>Ich verwende das Ding so:</p>
<pre><code>typedef std::pair&lt; Key, HASH_DATA&lt;T&gt; &gt; Hash_Pair;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1566977</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1566977</guid><dc:creator><![CDATA[umbro]]></dc:creator><pubDate>Mon, 18 Aug 2008 14:17:02 GMT</pubDate></item><item><title><![CDATA[Reply to Template verwenden in typedef bzw. std::pair ? on Mon, 18 Aug 2008 14:17:51 GMT]]></title><description><![CDATA[<p>wobei HASH_DATA eine templatebasiertes struct ist.</p>
<p>Danke euch</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1566978</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1566978</guid><dc:creator><![CDATA[umbro]]></dc:creator><pubDate>Mon, 18 Aug 2008 14:17:51 GMT</pubDate></item><item><title><![CDATA[Reply to Template verwenden in typedef bzw. std::pair ? on Mon, 18 Aug 2008 14:22:11 GMT]]></title><description><![CDATA[<p>Blödsinn ist es sicher nicht, aber mit der gegenwärtigen Sprachdefinition nicht möglich. Die beste Näherung erreichst du durch verschachtelte typedefs</p>
<pre><code class="language-cpp">template&lt;typename T&gt;
struct Hash_Pair
{
    typedef std::pair&lt; Key, HASH_DATA&lt;T&gt; &gt; type;
};
</code></pre>
<p>Hash_Pair&lt;T&gt; ist dann nicht selbst das gesuchte Paar, sondern Hash_Pair&lt;T&gt;::type.<br />
Im nächsten Standard wird es Template-Aliase geben, allerdings mit einer anderen Syntax.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1566982</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1566982</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Mon, 18 Aug 2008 14:22:11 GMT</pubDate></item><item><title><![CDATA[Reply to Template verwenden in typedef bzw. std::pair ? on Mon, 18 Aug 2008 14:30:00 GMT]]></title><description><![CDATA[<p>ah ok - danke für den hinweis. Sehr interessant <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/1566989</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1566989</guid><dc:creator><![CDATA[umbro]]></dc:creator><pubDate>Mon, 18 Aug 2008 14:30:00 GMT</pubDate></item><item><title><![CDATA[Reply to Template verwenden in typedef bzw. std::pair ? on Mon, 18 Aug 2008 19:28:49 GMT]]></title><description><![CDATA[<p>Im Moment kannst du es nur so wie camper schreibt machen, oder einen anderen häufig genutzten Workaround verwenden, nämlich ableiten:</p>
<pre><code class="language-cpp">template&lt;typename T&gt;
struct Hash_Pair : std::pair&lt; Key, HASH_DATA&lt;T&gt; &gt;
{
};
</code></pre>
<p>Wenn der Typ genau std::pair&lt; Key, HASH_DATA&lt;T&gt; &gt; entsprechen muss bleibt nur campers Variante, sonst geht ableiten auch oft.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1567162</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1567162</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Mon, 18 Aug 2008 19:28:49 GMT</pubDate></item></channel></rss>