Click here to Skip to main content
Click here to Skip to main content

Some useful additions for the C++ standard library

By , 11 Apr 2000
 
  • Download source files - 3 Kb
  • This is some simple, but useful code for STL users. It defines some TCHAR compatible elements of STL:

    _tstring	- wstring or string
    _tostream	- wostream or ostream
    _tistream	- wistream or istream
    
    _tcout	- wcout or cout
    _tcin	- wcin or cin
    _tcerr	- wcerr or cerr
    _tclog	- wclog or clog
    
    It gives you a std::ostream to dump objects into the debugger window, some string functions and adds support for __int64 types.

    No really fancy stuff, but you may need it :-)

    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here

    About the Author

    Daniel Lohmann
    Germany Germany
    Member
    Daniel Lohmann (daniel@losoft.de) is Assistant Professor at the Distributed Systems and Operating Systems department at Friedrich-Alexander-University Erlangen-Nuremberg, Germany. His main research topic is the design of a highly customizable and scalable operating system product line for deeply embedded systems using static configuration and aspect-oriented techniques. Before joining Universität Erlangen he worked as a freelance trainer and consultant for NT system programming, advanced C++ programming and OOA/OOD. He is interested in upcoming programming techniques like aspect-oriented programming, generative programming and C++ meta coding and has written some nice and handy tools for Windows NT which you can download at his web site.

    Sign Up to vote   Poor Excellent
    Add a reason or comment to your vote: x
    Votes of 3 or less require a comment

    Comments and Discussions

     
    You must Sign In to use this message board.
    Search this forum  
        Spacing  Noise  Layout  Per page   
    GeneralDon't use #define, it confuses debuggersmemberBen Berck17 Jan '02 - 10:26 
    As we all know, #define's are secrets to debuggers, and therefore quite annoying.
     
    The following will not confuse the debuggger:
     
    #include
    #include
    #include
    using namespace std;
     
    typedef basic_ostream tostream;
    #ifdef _UNICODE
    tostream& tcout = wcout;
    #else
    tostream& tcout = cout;
    #endif
     
    int main(int argc, char* argv[])
    {
    tcout << _T("Test 123");
    return 0;
    }

     
    Ben Berck
    Semi-retired C++ guy
    GeneralCode repost: fix angle bracketsmemberBen Berck17 Jan '02 - 10:31 
    Sorry, didn't catch the angle bracket problem when pasting the code.
     
    #include <tchar.h>
    #include <iostream>
    #include <ostream>
    using namespace std;
     
    typedef basic_ostream<TCHAR> tostream;
    #ifdef _UNICODE
    tostream& tcout = wcout;
    #else
    tostream& tcout = cout;
    #endif
     
    int main(int argc, char* argv[])
    {
    tcout << _T("Test 123");
    return 0;
    }

     
    Ben Berck
    Semi-retired C++ guy
    GeneralRe: Code repost: fix angle bracketsmemberChristian Graus17 Jan '02 - 12:49 
    Of course, if we're being picky, using namespace std is a colossally bad idea...

     
    Christian
     
    I have come to clean zee pooollll. - Michael Martin Dec 30, 2001
     
    Sonork ID 100.10002:MeanManOz
    I live in Bob's HungOut now

    GeneralRe: Code repost: fix angle bracketsmemberDaniel Lohmann18 Jan '02 - 0:07 
    Christian Graus wrote:
    Of course, if we're being picky, using namespace std is a colossally bad idea...
     
    Of course. Wink | ;) Blush | :O
     
    --
     
    Daniel Lohmann
     
    http://www.losoft.de

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

    Permalink | Advertise | Privacy | Mobile
    Web03 | 2.6.130523.1 | Last Updated 12 Apr 2000
    Article Copyright 2000 by Daniel Lohmann
    Everything else Copyright © CodeProject, 1999-2013
    Terms of Use
    Layout: fixed | fluid