I will aprreciate any information on how MSVC++ 4.0-4.2 supports templates,
particularly STL.
I found in Microsoft WWW page some strange explanations on using STL with MSVC++.
It doesn't support default argument in templates, so you should write
vector<int,alloc = int> v;
It seems not to instantiate templates 'on demand', etc.
Q1: Does Microsoft supply STL with MSVC++? If yes, which version? Original HP one?
Q2: If it is original HP version, are the users supposed to add some features to it?
In other words, should I do what vendors like Rogue Wave have already done?
Q3: Who has working experience with the using of STL with MSVC++? I personally fear
that as MSVC++ haven't been supporting templates for a long time, they cannot fully
support STL now...
Q4: Who has working experience with the using of Tools.h++ with MSVC++? Can it work?
Thanks in advance
Nick
> Thanks in advance
> Nick
I have used, or attempted to use, the STL included with VC++ 4.2 and
have decided to scrap it. After several calls to MS, I decided that
their workarounds were unacceptable. MS rewrote it for this version.
Recent posts to this group suggest using the versions shipped with 4.0
or 4.1.
----------------------------------------------------------------
Bill Nickles | we...@rfc.comm.harris.com
Software Engineer |
Harris RF Communications |
I'm getting 4.2 .
What is STL?
Jay Ferguson
HRB Systems
Standard Template Library.
Originally written by HP, and "improved" by Microsquash for VC 4.2. The
main purpose is to provide common templates to make code portable
between compilers / OSes. If you don't have any major objections to the
Microsoft Foundation Classes, use them. (Microsquash's library of
classes ready to use)
Bill Nickles wrote:
>
> N. Mikhailov wrote:
> >
> > Hi,...
>
> > Thanks in advance
> > Nick
>
> I have used, or attempted to use, the STL included with VC++ 4.2 and
> have decided to scrap it. After several calls to MS, I decided that
> their workarounds were unacceptable. MS rewrote it for this version.
> Recent posts to this group suggest using the versions shipped with 4.0
> or 4.1.
>
> ----------------------------------------------------------------
> Bill Nickles | we...@rfc.comm.harris.com
> Software Engineer |
> Harris RF Communications |
I'm getting 4.2 .
What is STL?
Jay Ferguson
HRB Systems
-----------------------------------------------------------------
CorpSoft BBS, Romeoville IL : (815)886-9388 v.34 33600 (ringdown)
20 Gig's : 21 CDROM's : RIME/FIDO/I-net/Intelec
-----------------------------------------------------------------
>If you don't have any major objections to the
>Microsoft Foundation Classes, use them. (Microsquash's library of
>classes ready to use)
My only objection to them is that they're toys, albeit high quality,
Fisher Price toys. ;-)
Actually I thought that they were improved by the standards commity, not
microsoft. They are still not much different, you just have to use
vector<BYTE, allocator<BYTE> > instead of vector<BYTE> (or list, etc.) If
you want to use the old stl, just copy the includes somewere and use
#include <vector.h> for stl instead of #include <vector> for Standard C++
Library.
Andrew Lenharth
lenh...@premier1.net
Yes, the STL that comes with 4.2 conforms more accurately to the STL
specification approved by the committee.
This is not the problem with 4.2 (in fact, I would almost prefer using 4.2's
implementation if it worked as advertised).
The problem is, as far as I can tell, the 4.2 implementation is just plain
broken. There's code in there that is just flat out illegal C++. I have a
theory as to why this is true.
If you have a template class, I have found under MSVC, you cannot be sure that
it works, or even compiles, unless you actually utilize every member function.
Member functions that are not utilized, I've noticed, can even contain syntax
errors.
I'm willing to bet that they implemented this STL and only performed some basic
tests on it, letting egregious errors slip.
> Yes, the STL that comes with 4.2 conforms more accurately to the STL
> specification approved by the committee.
> This is not the problem with 4.2 (in fact, I would almost prefer using 4.2's
> implementation if it worked as advertised).
> The problem is, as far as I can tell, the 4.2 implementation is just plain
> broken. There's code in there that is just flat out illegal C++. I have a
> theory as to why this is true.
> If you have a template class, I have found under MSVC, you cannot be sure that
> it works, or even compiles, unless you actually utilize every member function.
> Member functions that are not utilized, I've noticed, can even contain syntax
> errors.
> I'm willing to bet that they implemented this STL and only performed some basic
> tests on it, letting egregious errors slip.
We are currently trying to use STL with Visual C++ 4.2. I have
noticed several problems with it, on things that work with other
compilers. For example, operator != does not work with list and
deque iterators, though it it works with vector
iterators. However, I have managed to bypass most of the problems
and to get my tests work. I have still not been able to compile
and test the whole system, so I'm not sure if it works.
I'm wondering if it is possible to get the system work or should
we abandon STL for now. If someone has experience on this, please
help. BTW, we are not using template classes with STL containers.
--
///////////////////////////
/ Sami Kallio, s...@iki.fi
You're not bound to the STL implementation supplied with the
compiler. Why not use the HP implementation from VC++ 4.0? Or
some other implementation?
- Alf
I am currently using MSVC 4.2 with HP STL (not MS-STL).
It works fine.
The procedure is:
1. Use the HP STL that comes with MSVC 4.1. This is a rather easy distinction
to make since 4.2 STL has a master stl.h header and each individual header is
missing the '.h' (i.e. #include<map> instead of #include<map.h>). But the HP
imlementation all have '.h' headers.
2. Modify bool.h to #include<yvals.h> INSTEAD of defining bool and true and
false.
That's pretty much it.
I'm using a pretty good sampling of the containers (set, vector, map, list,
deque) as well as the queue adaptor and a few of the algorithms. I have not
performed an exhaustive examination of the whole library, but I have yet to run
across a problem with HP.
Nick