<?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[Nicht nachvollziehbare Compiler-Fehlermeldung]]></title><description><![CDATA[<p>Hallo Leute, ich habe seit neuestem in diesem codepart:</p>
<pre><code class="language-cpp">#include &lt;cmath&gt;
...
// hier ist die Zeile 42 und 43
template &lt;class T&gt; inline T max(T x, T y) { return x&gt;y ? x : y;}
template &lt;class T&gt; inline T min(T x, T y) { return x&lt;y ? x : y;}
</code></pre>
<p>eine Fehlermeldung die ich nicht nachvollziehen kann.</p>
<pre><code>2&gt;c:\util.h(42): error C2027: use of undefined type 'T'
2&gt;c:\util.h(42): error C2226: syntax error : unexpected type 'T'
2&gt;c:\util.h(42): error C2146: syntax error : missing ')' before identifier 'y'
2&gt;c:\util.h(42): error C2146: syntax error : missing ';' before identifier 'y'
2&gt;c:\util.h(42): error C2059: syntax error : ')'
2&gt;c:\util.h(42): error C2059: syntax error : ')'
2&gt;c:\util.h(43): error C2027: use of undefined type 'T'
2&gt;c:\util.h(43): error C2226: syntax error : unexpected type 'T'
2&gt;c:\util.h(43): error C2146: syntax error : missing ')' before identifier 'y'
2&gt;c:\util.h(43): error C2146: syntax error : missing ';' before identifier 'y'
2&gt;c:\util.h(43): error C2059: syntax error : ')'
2&gt;c:\util.h(43): error C2059: syntax error : ')'
</code></pre>
<p>Ich binde diese Header Datei in fast allen anderen Dateien ein.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/282648/nicht-nachvollziehbare-compiler-fehlermeldung</link><generator>RSS for Node</generator><lastBuildDate>Sun, 23 Aug 2026 00:34:09 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/282648.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 23 Feb 2011 16:45:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Nicht nachvollziehbare Compiler-Fehlermeldung on Wed, 23 Feb 2011 16:45:45 GMT]]></title><description><![CDATA[<p>Hallo Leute, ich habe seit neuestem in diesem codepart:</p>
<pre><code class="language-cpp">#include &lt;cmath&gt;
...
// hier ist die Zeile 42 und 43
template &lt;class T&gt; inline T max(T x, T y) { return x&gt;y ? x : y;}
template &lt;class T&gt; inline T min(T x, T y) { return x&lt;y ? x : y;}
</code></pre>
<p>eine Fehlermeldung die ich nicht nachvollziehen kann.</p>
<pre><code>2&gt;c:\util.h(42): error C2027: use of undefined type 'T'
2&gt;c:\util.h(42): error C2226: syntax error : unexpected type 'T'
2&gt;c:\util.h(42): error C2146: syntax error : missing ')' before identifier 'y'
2&gt;c:\util.h(42): error C2146: syntax error : missing ';' before identifier 'y'
2&gt;c:\util.h(42): error C2059: syntax error : ')'
2&gt;c:\util.h(42): error C2059: syntax error : ')'
2&gt;c:\util.h(43): error C2027: use of undefined type 'T'
2&gt;c:\util.h(43): error C2226: syntax error : unexpected type 'T'
2&gt;c:\util.h(43): error C2146: syntax error : missing ')' before identifier 'y'
2&gt;c:\util.h(43): error C2146: syntax error : missing ';' before identifier 'y'
2&gt;c:\util.h(43): error C2059: syntax error : ')'
2&gt;c:\util.h(43): error C2059: syntax error : ')'
</code></pre>
<p>Ich binde diese Header Datei in fast allen anderen Dateien ein.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2025431</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2025431</guid><dc:creator><![CDATA[VS2010]]></dc:creator><pubDate>Wed, 23 Feb 2011 16:45:45 GMT</pubDate></item><item><title><![CDATA[Reply to Nicht nachvollziehbare Compiler-Fehlermeldung on Wed, 23 Feb 2011 16:50:28 GMT]]></title><description><![CDATA[<p>Der von dir gezeige Codeausschnitt funktioniert bei mir. Eventuell liegt es an den Funktionsnamen. Es gibt in der STL bereits Funktionen namens min und max.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2025434</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2025434</guid><dc:creator><![CDATA[kjljkl]]></dc:creator><pubDate>Wed, 23 Feb 2011 16:50:28 GMT</pubDate></item><item><title><![CDATA[Reply to Nicht nachvollziehbare Compiler-Fehlermeldung on Wed, 23 Feb 2011 16:56:09 GMT]]></title><description><![CDATA[<p>kjljkl schrieb:</p>
<blockquote>
<p>Der von dir gezeige Codeausschnitt funktioniert bei mir. Eventuell liegt es an den Funktionsnamen. Es gibt in der STL bereits Funktionen namens min und max.</p>
</blockquote>
<p>Tatsächlich. Es hat sich mit &lt;algorithm&gt; gebissen. Dennoch ein nicht nachvollziehbare Beschreibung. Danke für den Tipp.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2025437</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2025437</guid><dc:creator><![CDATA[VS2010]]></dc:creator><pubDate>Wed, 23 Feb 2011 16:56:09 GMT</pubDate></item><item><title><![CDATA[Reply to Nicht nachvollziehbare Compiler-Fehlermeldung on Wed, 23 Feb 2011 17:25:18 GMT]]></title><description><![CDATA[<p>Deshalb gibt es ja auch den Namespace std. Das dauernde <code>using namespace std;</code> macht das natürlich zu nichte.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2025453</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2025453</guid><dc:creator><![CDATA[kjljkl]]></dc:creator><pubDate>Wed, 23 Feb 2011 17:25:18 GMT</pubDate></item><item><title><![CDATA[Reply to Nicht nachvollziehbare Compiler-Fehlermeldung on Wed, 23 Feb 2011 17:28:44 GMT]]></title><description><![CDATA[<p>Ich sehe gerade, dass es sich bei deinem Codeausschnitt um eine Headerdatei handelt. In einer Headerdatei gehören absolut GAR KEINE using-Direktiven. Das ist das schlimmste was man machen kann. In Headern daher immer <code>std::</code> ausschreiben. Ansonsten wird bei jedem Inkludiere die using-Direktive erneut ausgeführt und der Sinn von Namespaces ist damit gänzlich hinüber, da der Namespace überall &quot;aufgehoben&quot; wurde.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2025455</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2025455</guid><dc:creator><![CDATA[kjljkl]]></dc:creator><pubDate>Wed, 23 Feb 2011 17:28:44 GMT</pubDate></item><item><title><![CDATA[Reply to Nicht nachvollziehbare Compiler-Fehlermeldung on Wed, 23 Feb 2011 17:34:06 GMT]]></title><description><![CDATA[<p>Ja, nie using declarations mit file scope in einer Header Datei. Aber mit local lcope sind using declarations in Ordnung, auch in einem Header, nicht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2025456</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2025456</guid><dc:creator><![CDATA[icarus2]]></dc:creator><pubDate>Wed, 23 Feb 2011 17:34:06 GMT</pubDate></item><item><title><![CDATA[Reply to Nicht nachvollziehbare Compiler-Fehlermeldung on Wed, 23 Feb 2011 17:36:18 GMT]]></title><description><![CDATA[<p>icarus2 schrieb:</p>
<blockquote>
<p>Ja, nie using declarations mit file scope in einer Header Datei. Aber mit local lcope sind using declarations in Ordnung, auch in einem Header, nicht?</p>
</blockquote>
<p>Was meinst du?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2025460</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2025460</guid><dc:creator><![CDATA[kjljkl]]></dc:creator><pubDate>Wed, 23 Feb 2011 17:36:18 GMT</pubDate></item><item><title><![CDATA[Reply to Nicht nachvollziehbare Compiler-Fehlermeldung on Wed, 23 Feb 2011 18:02:27 GMT]]></title><description><![CDATA[<p>kjljkl schrieb:</p>
<blockquote>
<p>icarus2 schrieb:</p>
<blockquote>
<p>Ja, nie using declarations mit file scope in einer Header Datei. Aber mit local lcope sind using declarations in Ordnung, auch in einem Header, nicht?</p>
</blockquote>
<p>Was meinst du?</p>
</blockquote>
<p>Du kannst ja auch z.B. innerhalb einer Funktion using declaratiosn brauchen. Die sind haben dann local scope. Und die müssten in einem Header ja trotzdem gehen. (Gut, um ehrlich zu sein... brauchen tut mans nicht wirklich ^^).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2025474</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2025474</guid><dc:creator><![CDATA[icarus2]]></dc:creator><pubDate>Wed, 23 Feb 2011 18:02:27 GMT</pubDate></item><item><title><![CDATA[Reply to Nicht nachvollziehbare Compiler-Fehlermeldung on Wed, 23 Feb 2011 18:14:47 GMT]]></title><description><![CDATA[<p>Lokale usings in Headern sind durchaus ok, wenn man es nötig hat. Merkt ja niemand anderes. Aber wenn man gleich ein <code>using namespace std;</code> reinhaut anstatt <code>using std::...</code> dann sollte man auch tunlichst vermeiden, Bezeichner aus der Standardbibliothek zu benutzen. Man weiß ja nicht, welche Header vor dem eigenen eingebunden werden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2025483</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2025483</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Wed, 23 Feb 2011 18:14:47 GMT</pubDate></item><item><title><![CDATA[Reply to Nicht nachvollziehbare Compiler-Fehlermeldung on Thu, 24 Feb 2011 00:51:35 GMT]]></title><description><![CDATA[<p>VS2010 schrieb:</p>
<blockquote>
<p>kjljkl schrieb:</p>
<blockquote>
<p>Der von dir gezeige Codeausschnitt funktioniert bei mir. Eventuell liegt es an den Funktionsnamen. Es gibt in der STL bereits Funktionen namens min und max.</p>
</blockquote>
<p>Tatsächlich. Es hat sich mit &lt;algorithm&gt; gebissen. Dennoch ein nicht nachvollziehbare Beschreibung. Danke für den Tipp.</p>
</blockquote>
<p>Dann hast du schief geguckt. Das beisst sich nicht mit &lt;algorithm&gt; sondern mit &lt;windows.h&gt;, und zwar weil da &quot;min&quot; und &quot;max&quot; als #defines drinstehen.</p>
<p>Mach ein #undef min #undef max davor und du hast Ruhe.<br />
(Oder auch ein #define NOMINMAX vor das #include &lt;windows.h&gt;)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2025648</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2025648</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Thu, 24 Feb 2011 00:51:35 GMT</pubDate></item></channel></rss>