Re: C++ Standard Library
From: Joseph M. Newcomer (newcomer_at_flounder.com)
Date: 04/11/04
- Next message: ed: "files in the resources?"
- Previous message: Hai Ly Hoang: "Web-browser style toolbar"
- In reply to: Daniel James: "Re: C++ Standard Library"
- Next in thread: Mark Rance: "Re: C++ Standard Library"
- Reply: Mark Rance: "Re: C++ Standard Library"
- Reply: Daniel James: "Re: C++ Standard Library"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 10 Apr 2004 23:49:12 -0400
Surprisingly, not only does my customer base not want STL, they don't usually want
istreams or ostreams. They see no advantage to these. While I don't entirely agree with
this view, it is the set of rules I typically have to live with.
Check out my essay on CStrings on my MVP Tips site. If you'd like to contribute to that,
I'll put a section in on std::string under your byline. You can show examples of using
8-bit and 16-bit characters under std::string, and how to move them in and out of CString.
This would put a lot of string knowledge in one place.
joe
On Sat, 10 Apr 2004 16:34:48 +0100, Daniel James <wastebasket@nospam.aaisp.org> wrote:
>In article news:<qhaf7097nt7fdfvsqtmb158l9p6f3pl3t9@4ax.com>, Joseph M.
>Newcomer wrote:
>> The last time I looked at STL ...
>
>We're not really talking about "STL", which was a novel and innovative
>3rd-party library from a guy named Stepanov at HP, mostly to do with
>templated container classes and algorithms that operated on them, and
>which worked well only on C++ compilers with rather better template
>support than Visual C++ 5 could offer at the time.
>
>We're talking about the standard C++ runtime library as documented in
>ISO/IEC 14882. Standard C++ compilers *have* to support this library in
>a standard way (and Visual C++ 7.1 (or whatever it's officially called)
>does it quite well).
>
>It's no longer something any C++ programmer can afford not to
>intimately acquianted with, IMHO.
>
>> ... it seemed mired in 8-bit characters.
>
>The standard library handles 8-bit characters well, and it handles
>16-bit wide characters well. std::string is a narrow string,
>std::wstring is a wide string. The standard library also provides
>automatic mechanisms through the IOStream classes for conversion
>between external UTF-8 characters and internal wide chars as characters
>are read and written.
>
>What it doesn't do is support 32-bit Unicode (UCS4) characters, or
>provide character and string types which can be compiled as either wide
>or narrow (though you can use std::basic_string <TCHAR> if you want).
>
>> Note that one of the significant changes in CString in VS7 is that
>> you can have a mix of Unicode CStrings and 8-bit CStrings, ...
>
>The standard library has always supported this (at least since the
>published ISO standard).
>
>> ... my customer base doesn't want STL.
>
>If they want standard C++ they get the Standard Library. End of story.
>
>I write all back-end modules in standard C++ (so that they're portable
>to other platforms, should the need arise), but in MFC apps (which
>aren't portable anyway) I use CString in GUI classes because so much of
>the encapsulation of the Windows API makes heavy use of it. I convert
>between std:string and CString when passing text data between the
>back-end and the GUI. This conversion sometimes involves copying of
>string data, but that's seldom a (performance) problem, as the
>operation of the GUI isn't time-critical anyway.
>
>Cheers,
> Daniel.
>
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
- Next message: ed: "files in the resources?"
- Previous message: Hai Ly Hoang: "Web-browser style toolbar"
- In reply to: Daniel James: "Re: C++ Standard Library"
- Next in thread: Mark Rance: "Re: C++ Standard Library"
- Reply: Mark Rance: "Re: C++ Standard Library"
- Reply: Daniel James: "Re: C++ Standard Library"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|