<?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 in vs6]]></title><description><![CDATA[<p>hallo</p>
<p>ich hab hier ein fehler bei der template funktion, dieser code funktioniert unter vs 2008, leider hab ich damit unter vs6 problem.</p>
<pre><code class="language-cpp">#define TEMPLATE template &lt; typename T &gt;
typedef int MYINT;

TEMPLATE T			ToNumber() {
    std::wstringstream wss( L&quot;234&quot; );
        T num;
	wss &gt;&gt; num;
	return num;
    }

// aufruf
   MYINT test(){
      return ToNumber&lt; MYINT&gt;();       // 
   }
</code></pre>
<p>fehlermeldung ist : C2275: 'MYINT' : illegal use of this type as an expression</p>
<p>irgendjemand ne loesung??</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/275381/template-in-vs6</link><generator>RSS for Node</generator><lastBuildDate>Thu, 27 Aug 2026 00:24:24 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/275381.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 13 Oct 2010 19:19:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Template in vs6 on Wed, 13 Oct 2010 19:19:08 GMT]]></title><description><![CDATA[<p>hallo</p>
<p>ich hab hier ein fehler bei der template funktion, dieser code funktioniert unter vs 2008, leider hab ich damit unter vs6 problem.</p>
<pre><code class="language-cpp">#define TEMPLATE template &lt; typename T &gt;
typedef int MYINT;

TEMPLATE T			ToNumber() {
    std::wstringstream wss( L&quot;234&quot; );
        T num;
	wss &gt;&gt; num;
	return num;
    }

// aufruf
   MYINT test(){
      return ToNumber&lt; MYINT&gt;();       // 
   }
</code></pre>
<p>fehlermeldung ist : C2275: 'MYINT' : illegal use of this type as an expression</p>
<p>irgendjemand ne loesung??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1965216</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1965216</guid><dc:creator><![CDATA[JnZn558]]></dc:creator><pubDate>Wed, 13 Oct 2010 19:19:08 GMT</pubDate></item><item><title><![CDATA[Reply to Template in vs6 on Wed, 13 Oct 2010 19:19:54 GMT]]></title><description><![CDATA[<p>JnZn558 schrieb:</p>
<blockquote>
<p>hallo</p>
<p>ich hab hier ein fehler bei der template funktion, dieser code funktioniert unter vs 2008, leider hab ich damit unter vs6 problem.</p>
<pre><code class="language-cpp">#define TEMPLATE template &lt; typename T &gt;
typedef int MYINT;

TEMPLATE T			ToNumber() {
    std::wstringstream wss( L&quot;234&quot; );
        T num;
	wss &gt;&gt; num;
	return num;
    }

// aufruf
   MYINT test(){
      return ToNumber&lt; MYINT&gt;();       // hier soll der fehler sein
   }
</code></pre>
<p>fehlermeldung ist : C2275: 'MYINT' : illegal use of this type as an expression</p>
<p>irgendjemand ne loesung??</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1965217</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1965217</guid><dc:creator><![CDATA[JnZn558]]></dc:creator><pubDate>Wed, 13 Oct 2010 19:19:54 GMT</pubDate></item><item><title><![CDATA[Reply to Template in vs6 on Wed, 13 Oct 2010 19:40:37 GMT]]></title><description><![CDATA[<p>Hast du schon mal nachgeschaut, inwieweit vs6 Templates unterstützt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1965230</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1965230</guid><dc:creator><![CDATA[wxSkip]]></dc:creator><pubDate>Wed, 13 Oct 2010 19:40:37 GMT</pubDate></item><item><title><![CDATA[Reply to Template in vs6 on Wed, 13 Oct 2010 19:59:56 GMT]]></title><description><![CDATA[<p>Ich habe meinen alten VS6 noch einmal hervorgekramt und es klappt.<br />
Hast du mal nach verfügbaren Service-Packs gesucht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1965232</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1965232</guid><dc:creator><![CDATA[Vicious Falcon]]></dc:creator><pubDate>Wed, 13 Oct 2010 19:59:56 GMT</pubDate></item><item><title><![CDATA[Reply to Template in vs6 on Wed, 13 Oct 2010 20:21:24 GMT]]></title><description><![CDATA[<blockquote>
<pre><code class="language-cpp">#define TEMPLATE template &lt; typename T &gt; 
typedef int MYINT;
</code></pre>
</blockquote>
<p>Sonst geht es dir hoffentlich gut.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1965239</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1965239</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Wed, 13 Oct 2010 20:21:24 GMT</pubDate></item><item><title><![CDATA[Reply to Template in vs6 on Wed, 13 Oct 2010 20:23:17 GMT]]></title><description><![CDATA[<p><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="😃"
    /><br />
Ich habs bei mir auch schnell wieder raus genommen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1965240</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1965240</guid><dc:creator><![CDATA[Vicious Falcon]]></dc:creator><pubDate>Wed, 13 Oct 2010 20:23:17 GMT</pubDate></item><item><title><![CDATA[Reply to Template in vs6 on Thu, 14 Oct 2010 06:38:11 GMT]]></title><description><![CDATA[<p>hustbaer schrieb:</p>
<blockquote>
<blockquote>
<pre><code class="language-cpp">#define TEMPLATE template &lt; typename T &gt; 
typedef int MYINT;
</code></pre>
</blockquote>
<p>Sonst geht es dir hoffentlich gut.</p>
</blockquote>
<p>das ist nur ne codeausschnitt, für kleine anwendung ist das wohl bullshit</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1965372</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1965372</guid><dc:creator><![CDATA[es geht mir gut]]></dc:creator><pubDate>Thu, 14 Oct 2010 06:38:11 GMT</pubDate></item><item><title><![CDATA[Reply to Template in vs6 on Thu, 14 Oct 2010 06:52:21 GMT]]></title><description><![CDATA[<p>es geht mir gut schrieb:</p>
<blockquote>
<p>hustbaer schrieb:</p>
<blockquote>
<blockquote>
<pre><code class="language-cpp">#define TEMPLATE template &lt; typename T &gt; 
typedef int MYINT;
</code></pre>
</blockquote>
<p>Sonst geht es dir hoffentlich gut.</p>
</blockquote>
<p>das ist nur ne codeausschnitt, für kleine anwendung ist das wohl bullshit</p>
</blockquote>
<p>Für große erst recht! Das spart dir genau 2 Klammern und ein &quot;typename&quot;. Dafür wird es verdammt unübersichtlich, alle templates, die mit dem Macro arbeiten, legen sich BLIND auf &quot;T&quot; als template-Parameter fest, jeder der das template verwenden will, ist erstmal stutzig, weil er mit dem Macro nix anfangen kann.<br />
Doof wird es, wenn du einer Funktion später einen zweiten Template-Parameter verpassen willst (musst). Entweder passt du das Macro an (-&gt;juppidu, alle anderen templates werfen Fehler), oder du definierst ein neues Macro &quot;TEMPLATE_2&quot; für templates mit 2 Parametern, oder du schreibst sauber &quot;template &lt;typename T1, typename T2&gt;&quot; hin und alle sind glücklich!<br />
Ein weiterer großer Vorteil: Du kannst &quot;T&quot; einen individuellen und vor allem sprechenden Namen verpassen. &quot;T&quot; ist doch so nichtssagend.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1965379</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1965379</guid><dc:creator><![CDATA[l&#x27;abra d&#x27;or]]></dc:creator><pubDate>Thu, 14 Oct 2010 06:52:21 GMT</pubDate></item><item><title><![CDATA[Reply to Template in vs6 on Thu, 14 Oct 2010 15:31:36 GMT]]></title><description><![CDATA[<p>JnZn558 schrieb:</p>
<blockquote>
<p>dieser code funktioniert unter vs 2008, leider hab ich damit unter vs6 problem. [...]<br />
irgendjemand ne loesung??</p>
</blockquote>
<p>Ja. Schreib an deinen Code dran dass er nur für Standard-konforme Compiler gedacht ist und deshalb auf VS6 nicht läuft <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1965649</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1965649</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Thu, 14 Oct 2010 15:31:36 GMT</pubDate></item><item><title><![CDATA[Reply to Template in vs6 on Thu, 14 Oct 2010 15:35:21 GMT]]></title><description><![CDATA[<p>Vicious Falcon schrieb:</p>
<blockquote>
<p>Ich habe meinen alten VS6 noch einmal hervorgekramt und es klappt.</p>
</blockquote>
<p>Ich habe nicht gelogen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1965655</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1965655</guid><dc:creator><![CDATA[Vicious Falcon]]></dc:creator><pubDate>Thu, 14 Oct 2010 15:35:21 GMT</pubDate></item><item><title><![CDATA[Reply to Template in vs6 on Thu, 14 Oct 2010 19:38:53 GMT]]></title><description><![CDATA[<p>ja schoen dass es bei dir klappt, hast du auch so ne template funktion drin oder was?? dann zeig mal bitte so ne ausschnitt davon. ich bitte hier um loesung, nicht wegen ob typedef hier notwendig ist oder nicht</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1965767</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1965767</guid><dc:creator><![CDATA[JnZn558]]></dc:creator><pubDate>Thu, 14 Oct 2010 19:38:53 GMT</pubDate></item><item><title><![CDATA[Reply to Template in vs6 on Thu, 14 Oct 2010 20:03:01 GMT]]></title><description><![CDATA[<p>Wieso soll ich auch so eine Template - Funktion haben? So eine wie du mit Sicherheit nicht <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="😃"
    /> .<br />
Ich habe lediglich deinen Code in ein kleines Projekt eingefügt und mir den Wert ausgeben lassen (war 234). Ich habe hier noch ein altes VS6 professional, das ich jedoch nicht mehr nutze. Die letzte OS-Installation ist aber ca. 5 Jahre her, sodass ich es noch auf der Platte habe.</p>
<p>Edit: Ich nutze es schon noch, Dialoge etc. kann man damit rasend schnell erstellen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1965770</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1965770</guid><dc:creator><![CDATA[Vicious Falcon]]></dc:creator><pubDate>Thu, 14 Oct 2010 20:03:01 GMT</pubDate></item></channel></rss>