Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

STL and Microsoft. Is it possible? :-)

3 views
Skip to first unread message

N. Mikhailov

unread,
Oct 1, 1996, 3:00:00 AM10/1/96
to

Hi,

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

Bill Nickles

unread,
Oct 1, 1996, 3:00:00 AM10/1/96
to

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 |

Jay Ferguson

unread,
Oct 1, 1996, 3:00:00 AM10/1/96
to


I'm getting 4.2 .
What is STL?
Jay Ferguson
HRB Systems

Bill Nickles

unread,
Oct 1, 1996, 3:00:00 AM10/1/96
to

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)

JAY FERGUSON

unread,
Oct 1, 1996, 3:00:00 AM10/1/96
to

Path: news.xnet.com!news.sprintlink.net!news-chi-8.sprintlink.net!news-stock.gsl.net!news.gsl.net!news-penn.gsl.net!news.gsl.net!news-peer.gsl.net!news.gsl.net!news.sgi.com!news.mathworks.com!www.nntp.primenet.com!nntp.primenet.com!uwm.edu!news.cse.psu.edu!news3.cac.psu.edu!hrbicf!hrbicf!nntp
Newsgroups: comp.lang.c++
Subject: Re: STL and Microsoft. Is it possible? :-)
Message-ID: <325126...@hrb.com>
From: Jay Ferguson <j...@hrb.com>
Date: Tue, 01 Oct 1996 10:10:48 -0400
References: <32514B...@mathematik.uni-stuttgart.de> <325111...@servtech.com>
Organization: HRB/E-SYSTEMS
Nntp-Posting-Host: parula.hrb.com
X-Mailer: Mozilla 3.0b7Gold (WinNT; I)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 25

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
-----------------------------------------------------------------

John Lockwood

unread,
Oct 2, 1996, 3:00:00 AM10/2/96
to

Bill Nickles <nic...@servtech.com> wrote:

>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. ;-)


Andrew

unread,
Oct 3, 1996, 3:00:00 AM10/3/96
to

> > > 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.
SNIP

> 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)

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

Jason Shankel

unread,
Oct 4, 1996, 3:00:00 AM10/4/96
to

>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.)

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.


Sami Kallio

unread,
Oct 7, 1996, 3:00:00 AM10/7/96
to

sha...@crl.com (Jason Shankel) writes:

> 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


Alf P. Steinbach

unread,
Oct 7, 1996, 3:00:00 AM10/7/96
to

Sami Kallio wrote:
> 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.

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

Jason Shankel

unread,
Oct 8, 1996, 3:00:00 AM10/8/96
to

>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.

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.


N. Mikhailov

unread,
Oct 10, 1996, 3:00:00 AM10/10/96
to Sami Kallio

Sami Kallio wrote:
>
> I'm wondering if it is possible to get the system work or should
> we abandon STL for now. No, you should abandon ANSI non-compatible compiler. :-)
Indeed, I mean MSVC.

Nick

0 new messages