Friday, September 17, 2010

Missing _tstring and _tfstream in tchar.h

I wonder why Microsoft did not put these very useful and important TCHAR equivalents of string and fstream -

typedef std::basic_string <TCHAR> _tstring;
typedef std::basic_fstream<TCHAR, std::char_traits<TCHAR> > _tfstream;

If you work with TCHARs and need to use string and fstream, put the above two definitions in your common header file and use _tstring and _tfstream instead!

0 comments:

Post a Comment