Developer forums (C::B DEVELOPMENT STRICTLY!) > CodeCompletion redesign

std::endl : wrong completion

(1/4) > >>

killerbot:
For the first time (I think), CB::CC allowed me to complete std::endl. But it putted :

--- Code: ---std::endl()
--- End code ---

The "()" shouldn't be there.

blueshake:
it is something related to auto assert "()",can you turn off this,and try again.if it work ,there maybe is something wrong with the parse for token "endl".

killerbot:
note that this does not happen during the completion of std::cout !

ollydbg:

--- Quote from: killerbot on August 26, 2010, 10:02:13 pm ---note that this does not happen during the completion of std::cout !

--- End quote ---
simple answer:
cout is regarded as a variable, and endl is regarded as a function( several token named "endl" exist under std namespace, but all of them were functions). see the image below:





This is due some parser problem... let me check it if I have time. :D

Loaden:
Let's see iostream file (LINE: 536)

--- Quote ---// [27.6.2.7] standard basic_ostream manipulators
  /**
   *  @brief  Write a newline and flush the stream.
   *
   *  This manipulator is often mistakenly used when a simple newline is
   *  desired, leading to poor buffering performance.  See
   *  http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#2 for more
   *  on this subject.
  */
  template<typename _CharT, typename _Traits>
    inline basic_ostream<_CharT, _Traits>&
    endl(basic_ostream<_CharT, _Traits>& __os)
    { return flush(__os.put(__os.widen('\n'))); }
--- End quote ---
This is a function!

But in:ostream.tcc (LINE: 361 or 384)

--- Quote ---#if _GLIBCXX_EXTERN_TEMPLATE
  extern template class basic_ostream<char>;
 extern template ostream& endl(ostream&);
  extern template ostream& ends(ostream&);

--- End quote ---
Here is a variable.

Navigation

[0] Message Index

[#] Next page

Go to full version