<?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[Compilerfehler nur in .NET?]]></title><description><![CDATA[<p>Hallo!<br />
Die folgenden Klassenmethoden wurden deklariert:</p>
<pre><code class="language-cpp">public:                         // find.

  size_type find(const _Self&amp; __s, size_type __pos = 0) const 
    { return find(__s._M_start, __pos, __s.size()); }

  size_type find(const _CharT* __s, size_type __pos = 0) const 
    { _STLP_FIX_LITERAL_BUG(__s) return find(__s, __pos, _Traits::length(__s)); }

  size_type find(const _CharT* __s, size_type __pos, size_type __n) const;
  size_type find(_CharT __c, size_type __pos = 0) const;
</code></pre>
<p>Diese Methoden sind folgendermaßen definiert:</p>
<pre><code class="language-cpp">template &lt;class _CharT, class _Traits, class _Alloc&gt; __size_type__
basic_string&lt;_CharT,_Traits,_Alloc&gt; ::find(const _CharT* __s, size_type __pos, size_type __n) const 
{
  if (__pos + __n &gt; size())
    return npos;
  else {
    const const_pointer __result =
      _STLP_STD::search((const _CharT*)this-&gt;_M_start + __pos, (const _CharT*)this-&gt;_M_finish, 
			__s, __s + __n, _Eq_traits&lt;_Traits&gt;());
    return __result != this-&gt;_M_finish ? __result - this-&gt;_M_start : npos;
  }
}

template &lt;class _CharT, class _Traits, class _Alloc&gt; __size_type__
basic_string&lt;_CharT,_Traits,_Alloc&gt; ::find(_CharT __c, size_type __pos) const 
{
  if (__pos &gt;= size())
    return npos;
  else {
    const const_pointer __result =
      _STLP_STD::find_if((const _CharT*)this-&gt;_M_start + __pos, (const _CharT*)this-&gt;_M_finish,
			 _Eq_char_bound&lt;_Traits&gt;(__c));
    return __result != this-&gt;_M_finish ? __result - this-&gt;_M_start : npos;
  }
}
</code></pre>
<p>In Visual Studio 6.0 läuft der Compiler durch und in .Net gibt es die folgende Fehlermeldung:<br />
error C2059: Syntaxfehler: ')'<br />
in der Zeile</p>
<pre><code class="language-cpp">basic_string&lt;_CharT,_Traits,_Alloc&gt; ::find(_CharT __c, size_type __pos) const
</code></pre>
<p>Woran kann es liegen, dass der Compiler von .NET diesen Fehler ausgibt?</p>
<p>Mit besten Grüßen, Lothar.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/78453/compilerfehler-nur-in-net</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 20:12:06 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/78453.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 01 Jul 2004 15:27:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Compilerfehler nur in .NET? on Thu, 01 Jul 2004 15:27:33 GMT]]></title><description><![CDATA[<p>Hallo!<br />
Die folgenden Klassenmethoden wurden deklariert:</p>
<pre><code class="language-cpp">public:                         // find.

  size_type find(const _Self&amp; __s, size_type __pos = 0) const 
    { return find(__s._M_start, __pos, __s.size()); }

  size_type find(const _CharT* __s, size_type __pos = 0) const 
    { _STLP_FIX_LITERAL_BUG(__s) return find(__s, __pos, _Traits::length(__s)); }

  size_type find(const _CharT* __s, size_type __pos, size_type __n) const;
  size_type find(_CharT __c, size_type __pos = 0) const;
</code></pre>
<p>Diese Methoden sind folgendermaßen definiert:</p>
<pre><code class="language-cpp">template &lt;class _CharT, class _Traits, class _Alloc&gt; __size_type__
basic_string&lt;_CharT,_Traits,_Alloc&gt; ::find(const _CharT* __s, size_type __pos, size_type __n) const 
{
  if (__pos + __n &gt; size())
    return npos;
  else {
    const const_pointer __result =
      _STLP_STD::search((const _CharT*)this-&gt;_M_start + __pos, (const _CharT*)this-&gt;_M_finish, 
			__s, __s + __n, _Eq_traits&lt;_Traits&gt;());
    return __result != this-&gt;_M_finish ? __result - this-&gt;_M_start : npos;
  }
}

template &lt;class _CharT, class _Traits, class _Alloc&gt; __size_type__
basic_string&lt;_CharT,_Traits,_Alloc&gt; ::find(_CharT __c, size_type __pos) const 
{
  if (__pos &gt;= size())
    return npos;
  else {
    const const_pointer __result =
      _STLP_STD::find_if((const _CharT*)this-&gt;_M_start + __pos, (const _CharT*)this-&gt;_M_finish,
			 _Eq_char_bound&lt;_Traits&gt;(__c));
    return __result != this-&gt;_M_finish ? __result - this-&gt;_M_start : npos;
  }
}
</code></pre>
<p>In Visual Studio 6.0 läuft der Compiler durch und in .Net gibt es die folgende Fehlermeldung:<br />
error C2059: Syntaxfehler: ')'<br />
in der Zeile</p>
<pre><code class="language-cpp">basic_string&lt;_CharT,_Traits,_Alloc&gt; ::find(_CharT __c, size_type __pos) const
</code></pre>
<p>Woran kann es liegen, dass der Compiler von .NET diesen Fehler ausgibt?</p>
<p>Mit besten Grüßen, Lothar.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/551043</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/551043</guid><dc:creator><![CDATA[Sowada]]></dc:creator><pubDate>Thu, 01 Jul 2004 15:27:33 GMT</pubDate></item><item><title><![CDATA[Reply to Compilerfehler nur in .NET? on Thu, 01 Jul 2004 17:39:09 GMT]]></title><description><![CDATA[<p>Irgendein Include-Pfad anders gesetzt, so daß der falsche Header mit einer notwendigen Definition reingezogen wird?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/551164</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/551164</guid><dc:creator><![CDATA[peterchen]]></dc:creator><pubDate>Thu, 01 Jul 2004 17:39:09 GMT</pubDate></item></channel></rss>