If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Question fstream logistics

The following code compiles with no errs and works.
However my VC Pro 2005 Intellisense shows a bunch of stuff but does not show anything for-> ::in <-OR-> :ut ON <-std::fstream::

I'm wondering has the template been upgraded (?) or is this just beyond the Intellisense capability ?
When I look in the include files I can't spot them either, but it is compiling (?). I'm not that good at reading ATL so maybe I'm just not spotting them.

Re: Question fstream logistics

The following code compiles with no errs and works.
However my VC Pro 2005 Intellisense shows a bunch of stuff but does not show anything for-> ::in <-OR-> :ut ON <-std::fstream::

Intellisense is just a tool, a tool that can have bugs -- it isn't a C++ compiler.

C++ is a language with complex rules, so it is unlikely that a non-compiler tool that tries to follow these rules and parse source files will get everything correct. Even commercial C++ code parsers and tag generators that are reportedly superior to Intellisense won't get it right all the time (see Visual Assist, for example)

Re: Question fstream logistics

If you trace the inheritance hierarchy of std::fstream, you will find that it is a subclass of std::ios_base, in which these open modes are declared.

Thank you for that verification. I should have done that, I know from the past that can be quite tedious and time consuming, but no excuse.

Originally Posted by Paul McKenzie

Intellisense is just a tool, a tool that can have bugs -- it isn't a C++ compiler.
C++ is a language with complex rules, so it is unlikely that a non-compiler tool that tries to follow these rules and parse source files will get everything correct. Even commercial C++ code parsers and tag generators that are reportedly superior to Intellisense won't get it right all the time (see Visual Assist, for example)
Regards, Paul McKenzie

I figured that might be the case, but glad you verified it. For some reason the forum will not allow me to give you a reputation point for you answer. I surmise you give a lot of good answers and it won't allow past a certain quota.

Re: Question fstream logistics

Originally Posted by Codeplug

Also, you shouldn't be using _T(). Formatted output methods of std::fstream always works on narrow strings/characters. gg

Thanks that's a good point. I have another question on that subject.
1. Do a lot of folks still consider the recompile portability of TCHAR a good thing now days or are more folks leaning towards explicit types for each define?

2. When considering buffer overrun safety what (or does) the std:: templates have in this area. Or should I stick with the newer string safe handling routines like StringCchLength etc