<?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[generic methode curr()]]></title><description><![CDATA[<p>ich habe einen G_BAG mit strings gemacht, nun möchte ich mit einen courser den wer(string) mit hilfe der methode curr(). habs so probiert:</p>
<p>string tempStr<br />
string* pstr;</p>
<p>while(SlmysCourser.next() != NULL)<br />
{<br />
tempStr = entry.SLMY;</p>
<p>pstr = SlmysCourser.curr(); // * siehe fehler anzeige unten</p>
<p>if(tempStr != *pstr)<br />
{</p>
<p>foundSlmys.add(tempStr);<br />
numberSlmy++;<br />
}<br />
}</p>
<p>D:\HTE_WSP\U\VOBS\HTE\CODE\COMMON\CheckWorkloadAnalysetool\AnalyseTool\Cc_SLMYs.cpp(316) : error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'const class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/126425/generic-methode-curr</link><generator>RSS for Node</generator><lastBuildDate>Mon, 24 Aug 2026 15:57:04 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/126425.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 14 Nov 2005 23:11:51 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to generic methode curr() on Mon, 14 Nov 2005 23:11:51 GMT]]></title><description><![CDATA[<p>ich habe einen G_BAG mit strings gemacht, nun möchte ich mit einen courser den wer(string) mit hilfe der methode curr(). habs so probiert:</p>
<p>string tempStr<br />
string* pstr;</p>
<p>while(SlmysCourser.next() != NULL)<br />
{<br />
tempStr = entry.SLMY;</p>
<p>pstr = SlmysCourser.curr(); // * siehe fehler anzeige unten</p>
<p>if(tempStr != *pstr)<br />
{</p>
<p>foundSlmys.add(tempStr);<br />
numberSlmy++;<br />
}<br />
}</p>
<p>D:\HTE_WSP\U\VOBS\HTE\CODE\COMMON\CheckWorkloadAnalysetool\AnalyseTool\Cc_SLMYs.cpp(316) : error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'const class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class</p>
]]></description><link>https://www.c-plusplus.net/forum/post/918032</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/918032</guid><dc:creator><![CDATA[nooby]]></dc:creator><pubDate>Mon, 14 Nov 2005 23:11:51 GMT</pubDate></item><item><title><![CDATA[Reply to generic methode curr() on Mon, 14 Nov 2005 23:30:31 GMT]]></title><description><![CDATA[<p>nooby schrieb:</p>
<blockquote>
<p>ich habe einen G_BAG mit strings gemacht, nun möchte ich mit einen courser den wer(string) mit hilfe der methode curr(). habs so probiert</p>
</blockquote>
<p>das sagt (mir zumindest) so gut wie nichts, wäre ganz nett, wenn du ein bisschen mehr infos hergeben könntest.<br />
die fehlermeldung ist außerdem ein bisschen abgeschnitten.<br />
wie sieht denn die signatur von curr aus (was gibt curr zurück?)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/918042</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/918042</guid><dc:creator><![CDATA[davie]]></dc:creator><pubDate>Mon, 14 Nov 2005 23:30:31 GMT</pubDate></item><item><title><![CDATA[Reply to generic methode curr() on Mon, 14 Nov 2005 23:46:39 GMT]]></title><description><![CDATA[<p>Compiling...<br />
Cc_SLMYs.cpp<br />
D:\HTE_WSP\U\VOBS\HTE\CODE\COMMON\CheckWorkloadAnalysetool\AnalyseTool\Cc_SLMYs.cpp(316) : error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'const class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class<br />
std::allocator&lt;char&gt; &gt;' (or there is no acceptable conversion)<br />
Error executing cl.exe.<br />
Creating browse info file...</p>
<p>AnalyseTool.lib - 1 error(s), 0 warning(s)</p>
<p>das ist die ganze fehler meldung....<br />
hier ein ausschnitt von der beschreibung von curr():</p>
<p>Current position<br />
const T &amp;curr() const;<br />
Returns a reference to the object referred by the current position of the iterator.<br />
Preconditions: The cursor must be connected to a collection, and a current element must be defined.</p>
<pre><code class="language-cpp">const T &amp;operator*() const;
</code></pre>
<p>Equivalent to curr().</p>
<pre><code class="language-cpp">const T *find(const T &amp;k);
</code></pre>
<p>das ist der code der ganzen funktion:</p>
<pre><code class="language-cpp">int Cc_SLMYs::numberOfSLMYs()
{
  ifstream datei;

  datei.open(LogFileName);

  int numberSlmy = 0;
  int lineNumber = 2;
  string zeile;
  string tempStr;
  string* pstr;

  G_BAG (string) foundSlmys;
  G_Cursor &lt;string&gt; SlmysCourser (foundSlmys);

  Cc_SLMYs entry;

  //spalte um spalte wird nach der wortkette &quot;FAILED&quot; untersucht
  while(getline(datei, zeile))
  {
    entry = lineReader(lineNumber);

    lineNumber++;

    while(SlmysCourser.next() != NULL)
    {
      tempStr = entry.SLMY;

      pstr = SlmysCourser.curr();

      if(tempStr != *pstr)
      {

        foundSlmys.add(tempStr);
        numberSlmy++;
      }
    }

  }
  return numberSlmy;
}
</code></pre>
<p>/edit: bitte lesen und tun: sfds</p>
]]></description><link>https://www.c-plusplus.net/forum/post/918045</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/918045</guid><dc:creator><![CDATA[nooby]]></dc:creator><pubDate>Mon, 14 Nov 2005 23:46:39 GMT</pubDate></item><item><title><![CDATA[Reply to generic methode curr() on Mon, 14 Nov 2005 23:41:20 GMT]]></title><description><![CDATA[<p>hier noch die beschreibung für G_BAG:</p>
<p>DESCRIPTION<br />
A G_Bag&lt;T,IMP&gt; is an abstract parameterized unordered homogeneous collection class whose elements are of type T. Copying and assigning elements of type T must be possible. The actual data structure for the implementation is chosen through the second type parameter IMP. Bags can contain any number of duplicate elements. Equality between elements normally is determined by using operator==. The user can override this behavior by defining an operation class that is passed as the third argument to the instantiation macro GIO_BAG. See chapter ,,Collections with Plugable Implementations&quot; on page 29 for more information.</p>
<p>IMPLEMENTATIONS<br />
The following classes can be used as implementation classes for G_Bag:</p>
<p>#include &lt;gchash.h&gt;<br />
class G_ClosedHashTable&lt;T,OP&gt;;<br />
T must have operator== and operator G_HashValue defined if you do not specify your own operation class and if T is not a built-in type. If you supply an operation class, this must have the static members equals and hash.<br />
Closed hash tables use special values to mark empty slots in the table. For built-in types, the value zero is used as the marker value. For user-defined types, the object constructed by the default constructor, or if there is no constructor, an object with a zero bit pattern is used as the marker value. As a consequence, T must have a default constructor, or no constructor at all if it is a user defined type. Furthermore, it is not allowed to add objects that are equal to the marker value.</p>
<p>Closed hash tables have a smaller memory overhead than open hash tables. But you should only use them if the number of duplicate elements is small compared to the total number of elements. Otherwise you get large clusters with large empty spaces in between, which can dramatically increase the time needed to locate a specific element. Furthermore, you should note that closed hash tables move their members in memory, so that you cannot use them if you want to keep pointers to members of the bag.</p>
<p>leider verstehe ich es nicht so gut und bisher habe ich G_BAg nur in verbindung mit objecten benutzt</p>
]]></description><link>https://www.c-plusplus.net/forum/post/918048</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/918048</guid><dc:creator><![CDATA[nooby]]></dc:creator><pubDate>Mon, 14 Nov 2005 23:41:20 GMT</pubDate></item><item><title><![CDATA[Reply to generic methode curr() on Mon, 14 Nov 2005 23:56:01 GMT]]></title><description><![CDATA[<p>pstr ist ein zeiger auf einen string und curr liefert dir eine referenz auf einen const-string zurück.<br />
also entweder</p>
<pre><code class="language-cpp">string const* pstr;
//...
pstr = &amp;SlmysCourser.curr();

//oder mit referenz
string const&amp; pstr = SlmysCourser.curr(); //geht _nur_ so
</code></pre>
<p>oder, wenn du lieber kopieren möchtest</p>
<pre><code class="language-cpp">string pstr;
//...
pstr = SlmysCourser.curr();

//bzw.
string pstr (SlmysCourser.curr());
</code></pre>
<p>oder du nimmst den operator* von SlmysCourser und schreibst das ganze einfacher mit</p>
<pre><code class="language-cpp">string str = *SlmysCourser; //ist das intuitiv? ich wage fast, das zu bezweifeln...
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/918059</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/918059</guid><dc:creator><![CDATA[davie]]></dc:creator><pubDate>Mon, 14 Nov 2005 23:56:01 GMT</pubDate></item><item><title><![CDATA[Reply to generic methode curr() on Tue, 15 Nov 2005 00:03:42 GMT]]></title><description><![CDATA[<p>mhh merci, aber jetzt habe ich einen andere fehler:</p>
<pre><code class="language-cpp">string const* pstr;

  G_BAG (string) foundSlmys;
  G_Cursor &lt;string&gt; SlmysCourser (foundSlmys);

  Cc_SLMYs entry;

  //spalte um spalte wird nach der wortkette &quot;FAILED&quot; untersucht
  while(getline(datei, zeile))
  {
    entry = lineReader(lineNumber);

    lineNumber++;

    while(SlmysCourser.next() != NULL)
    {
      tempStr = entry.SLMY;

      pstr = &amp;SlmysCourser.curr();

      if(tempStr != pstr)
      {

        foundSlmys.add(tempStr);
        numberSlmy++;
      }
    }

  }
</code></pre>
<p>fehlermeldung:</p>
<p>Compiling...<br />
Cc_SLMYs.cpp<br />
D:\HTE_WSP\U\VOBS\HTE\CODE\COMMON\CheckWorkloadAnalysetool\AnalyseTool\Cc_SLMYs.cpp(318) : error C2679: binary '!=' : no operator defined which takes a right-hand operand of type 'const class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,clas<br />
s std::allocator&lt;char&gt; &gt; *' (or there is no acceptable conversion)<br />
Error executing cl.exe.<br />
Creating browse info file...</p>
<p>AnalyseTool.lib - 1 error(s), 0 warning(s)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/918062</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/918062</guid><dc:creator><![CDATA[nooby]]></dc:creator><pubDate>Tue, 15 Nov 2005 00:03:42 GMT</pubDate></item><item><title><![CDATA[Reply to generic methode curr() on Tue, 15 Nov 2005 00:10:57 GMT]]></title><description><![CDATA[<p>mein vorschlag: lass pstr ganz weg und schreib nur mehr</p>
<pre><code class="language-cpp">if(tempStr != SlmysCourser.curr())
      {

        foundSlmys.add(tempStr);
        numberSlmy++;
      }
    }
</code></pre>
<p>ansonsten müsstest du den zeiger dereferenzieren:</p>
<pre><code class="language-cpp">if (tempStr != *pstr)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/918063</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/918063</guid><dc:creator><![CDATA[davie]]></dc:creator><pubDate>Tue, 15 Nov 2005 00:10:57 GMT</pubDate></item><item><title><![CDATA[Reply to generic methode curr() on Tue, 15 Nov 2005 00:15:28 GMT]]></title><description><![CDATA[<p>uupps das habe ich übersehen mit dem zeiger, den zweiten vorschlag von dir habe ich eben schon ausprobiert habe imm er diesen fehler:</p>
<p>Compiling...<br />
Cc_SLMYs.cpp<br />
d:\hte_wsp\u\vobs\hte\code\common\generic\include\gop.h(75) : error C2440: 'type cast' : cannot convert from 'const class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt;' to 'class G_HashValue'<br />
No constructor could take the source type, or constructor overload resolution was ambiguous<br />
d:\hte_wsp\u\vobs\hte\code\common\generic\include\gop.h(74) : while compiling class-template member function 'unsigned long __cdecl G_Op&lt;class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; &gt;::hash(const cl<br />
ass std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; &amp;)'<br />
d:\hte_wsp\u\vobs\hte\code\common\generic\include\gop.h(75) : error C2512: 'G_HashValue' : no appropriate default constructor available<br />
d:\hte_wsp\u\vobs\hte\code\common\generic\include\gop.h(74) : while compiling class-template member function 'unsigned long __cdecl G_Op&lt;class std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; &gt;::hash(const cl<br />
ass std::basic_string&lt;char,struct std::char_traits&lt;char&gt;,class std::allocator&lt;char&gt; &gt; &amp;)'<br />
Error executing cl.exe.<br />
Creating browse info file...</p>
<p>AnalyseTool.lib - 2 error(s), 0 warning(s)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/918066</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/918066</guid><dc:creator><![CDATA[nooby]]></dc:creator><pubDate>Tue, 15 Nov 2005 00:15:28 GMT</pubDate></item></channel></rss>