Note that there are some explanatory texts on larger screens.

plurals
  1. POcode compiles on Sun Studio but gives error on gcc
    text
    copied!<p>I have this code which gets compiles using Sun Studio but gives error in g++</p> <pre><code>DBManager &amp; DBManager::operator &gt;&gt; (UtlString &amp;value) { //## begin DBManager::operator&gt;&gt;%921890065.body preserve=yes if(_state == DBMRan){ _reader &gt;&gt; static_cast&lt;std::string&gt;(value); } return *this; //## end DBManager::operator&gt;&gt;%921890065.body } DBManager.cpp:263: error: no match for âoperator&gt;&gt;â in â((DBManager*)this)-&gt;DBManager::_reader &gt;&gt; std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;(((const std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;&amp;)((const std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;*)(&amp;((jda::UtlString*)value)-&gt;jda::UtlString::&lt;anonymous&gt;))))â DBReader.h:50: note: candidates are: virtual DBReader&amp; DBReader::operator&gt;&gt;(char&amp;) DBReader.h:51: note: virtual DBReader&amp; DBReader::operator&gt;&gt;(unsigned char&amp;) DBReader.h:52: note: virtual DBReader&amp; DBReader::operator&gt;&gt;(short int&amp;) DBReader.h:53: note: virtual DBReader&amp; DBReader::operator&gt;&gt;(short unsigned int&amp;) DBReader.h:54: note: virtual DBReader&amp; DBReader::operator&gt;&gt;(int&amp;) DBReader.h:55: note: virtual DBReader&amp; DBReader::operator&gt;&gt;(unsigned int&amp;) DBReader.h:56: note: virtual DBReader&amp; DBReader::operator&gt;&gt;(long int&amp;) DBReader.h:57: note: virtual DBReader&amp; DBReader::operator&gt;&gt;(long long int&amp;) DBReader.h:58: note: virtual DBReader&amp; DBReader::operator&gt;&gt;(long unsigned int&amp;) DBReader.h:59: note: virtual DBReader&amp; DBReader::operator&gt;&gt;(long long unsigned int&amp;) DBReader.h:60: note: virtual DBReader&amp; DBReader::operator&gt;&gt;(float&amp;) DBReader.h:61: note: virtual DBReader&amp; DBReader::operator&gt;&gt;(double&amp;) DBReader.h:62: note: virtual DBReader&amp; DBReader::operator&gt;&gt;(DBDateTime&amp;) DBReader.h:63: note: virtual DBReader&amp; DBReader::operator&gt;&gt;(DBBlob&amp;) DBReader.h:64: note: virtual DBReader&amp; DBReader::operator&gt;&gt;(std::string&amp;) DBReader.h:65: note: virtual DBReader&amp; DBReader::operator&gt;&gt;(DBNullIndicator&amp;) otlv4.h:35416: note: otl_connect&amp; operator&gt;&gt;(otl_connect&amp;, otl_stream&amp;) </code></pre> <p>As you can see in above error message that DBReader class has operator>> which takes std::string by reference and UtlString class is derived from std::string so static_cast should not be a problem but still compiler complains that there is no matching method. Also can anyone tell me how to remove â charachter appearing in error message.</p> <p>Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload