Re: Cross platform C++ base library?
- From: "David Ching" <dc@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 18 Dec 2008 06:06:30 -0800
Thanks G. At this point I think just using the base classes from a cross platform framework like Qt (QtCore) or wxWidgets (wxBase) is my best bet.
Cheers,
David
"Giovanni Dicanio" <giovanniDOTdicanio@xxxxxxxxxxxxxxxxx> wrote in message news:u4N3j6QYJHA.4272@xxxxxxxxxxxxxxxxxxxxxxx
Hi David,
as a result of a web search, I found a class similar to CString, but whose implementation is done using STL. This way, you should have both the cross-platform feature (because the class is built on top of STL), and the CString-like public interface:
CString-like Class Using STL
http://www.developer.com/net/cplus/article.php/627611
(I seem to recall that in the past I read something similar of that on CodeProject, but I'm not sure...)
Unfortunately, I'm not aware of "simplified" versions of std::vector, std::map and tr1::shared_ptr.
My first reaction to STL was that of a disagreement (starting from the naming convention; in fact, I prefer camelCasing or PascalCasing to c_linux_hacker_casing :)
Moreover, I really don't like std::map having 'first' and 'second'; I would much more prefer 'Key' and 'Value' (like in C# BCL Dictionary container) as naming choice!
However, I learnt the basics of STL containers like vector and map, and now I'm glad to use these STL containers (excluding the naming conventions).
For example, I like the non-linear factor (1.5X) policy of vector capacity growing (instead I think that MFC's CArray implements the poor arithmetic growing factor).
But I'm not an STL guru, e.g. I've not learnt to use STL allocators, yet.
However, I believe that you are a bright programmer and you can master STL as well! :)
If you really don't like STL, you could just use STL as the core to implement classes with an MFC-like interface (e.g. a David::CArray, David::CList, etc. based on std::vector, std::list, etc.). So, you can continue using the MFC-like interfaces, and you also have cross-platform thanks to STL implementation "under the hood".
(In this case, you just need to program the STL containers only once, when you write the *implementation* of your custom classes like David::CArray, then you forget about STL, and you use the usual MFC-like public interfaces of your custom classes.)
My 2 cents,
Giovanni
.
- Follow-Ups:
- Re: Cross platform C++ base library?
- From: Giovanni Dicanio
- Re: Cross platform C++ base library?
- References:
- Cross platform C++ base library?
- From: David Ching
- Re: Cross platform C++ base library?
- From: Giovanni Dicanio
- Cross platform C++ base library?
- Prev by Date: Re: Cross platform C++ base library?
- Next by Date: Re: How to Locate a registry entry created by Windows Installer
- Previous by thread: Re: Cross platform C++ base library?
- Next by thread: Re: Cross platform C++ base library?
- Index(es):
Relevant Pages
|