<?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[static constant]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe eine Template Matrix Klasse und möchte nun für die Identitätsmatrix eine statische Konstante anlegen. Versucht hab ichs so:</p>
<pre><code class="language-cpp">template &lt;class T&gt;
class Matrix { 
public:
   static Matrix&lt;T&gt; Identity;

};

Matrix&lt;T&gt;::Matrix&lt;T&gt; Matrix&lt;T&gt;::Identity(1, 0, 0, 0,
                                         0, 1, 0, 0,
                                         0, 0, 1, 0,
                                         0, 0, 0, 1);
</code></pre>
<p>Aus irgend einem Grund geht es aber nicht, VS sagt mir bei der Definition:</p>
<blockquote>
<p>Error: Overloaded function &quot;Matrix&lt;T&gt;::Matrix [with T=&lt;error type&gt;]&quot; is not a type name</p>
</blockquote>
<p>Wo is da der Fehler?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/295058/static-constant</link><generator>RSS for Node</generator><lastBuildDate>Sat, 15 Aug 2026 15:11:47 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/295058.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 06 Nov 2011 15:39:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to static constant on Sun, 06 Nov 2011 15:39:23 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe eine Template Matrix Klasse und möchte nun für die Identitätsmatrix eine statische Konstante anlegen. Versucht hab ichs so:</p>
<pre><code class="language-cpp">template &lt;class T&gt;
class Matrix { 
public:
   static Matrix&lt;T&gt; Identity;

};

Matrix&lt;T&gt;::Matrix&lt;T&gt; Matrix&lt;T&gt;::Identity(1, 0, 0, 0,
                                         0, 1, 0, 0,
                                         0, 0, 1, 0,
                                         0, 0, 0, 1);
</code></pre>
<p>Aus irgend einem Grund geht es aber nicht, VS sagt mir bei der Definition:</p>
<blockquote>
<p>Error: Overloaded function &quot;Matrix&lt;T&gt;::Matrix [with T=&lt;error type&gt;]&quot; is not a type name</p>
</blockquote>
<p>Wo is da der Fehler?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2141152</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2141152</guid><dc:creator><![CDATA[StaticKonstanter]]></dc:creator><pubDate>Sun, 06 Nov 2011 15:39:23 GMT</pubDate></item><item><title><![CDATA[Reply to static constant on Sun, 06 Nov 2011 15:47:44 GMT]]></title><description><![CDATA[<p>Wenn mich nicht gerade alles täuscht, müsste es so lauten:</p>
<pre><code class="language-cpp">template &lt;typename T&gt;
Matrix&lt;T&gt; Matrix&lt;T&gt;::Identity(1, 0, 0, 0,
                              0, 1, 0, 0,
                              0, 0, 1, 0,
                              0, 0, 0, 1);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2141160</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2141160</guid><dc:creator><![CDATA[314159265358979]]></dc:creator><pubDate>Sun, 06 Nov 2011 15:47:44 GMT</pubDate></item><item><title><![CDATA[Reply to static constant on Sun, 06 Nov 2011 15:49:35 GMT]]></title><description><![CDATA[<p>Das ist übrigens keine Konstante.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2141161</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2141161</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Sun, 06 Nov 2011 15:49:35 GMT</pubDate></item></channel></rss>