Topic: Q: What is standard C++ library ?
Author: abell@mindspring.com (Andrew Bell)
Date: 1996/08/14 Raw View
jcoffin@taeus.com (Jerry Coffin) wrote:
>In article <4umrto$pq7@mulga.cs.mu.OZ.AU>, fjh@mundook.cs.mu.OZ.AU
>says...
>One caveat: there's no attempt to convert a structured exception to
>any particular kind of C++ exception. The only way you can catch
>structured exceptions is with a `catch(...)'.
True to a point. If you call _set_se_handler (I think that's the
name) with a pointer to your own function, you can then have that
function throw some exception which you can catch. I created a
StructuredException class, which got thrown from my structured
exception handler, that would spit out a text description of the
particular type of exception. The call to one's structured exception
handler also provides other information (in an EXCEPTION_POINTER
structure, if I remember correctly), but I didn't get around to
processing that.
This is largely off-topic for comp.std.c++, but I think we're close to
the end of this part of the thread anyway.
Andrew Bell
abell@mindspring.com
[ comp.std.c++ is moderated. To submit articles: try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
[ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu ]
Author: abell@mindspring.com (Andrew Bell)
Date: 1996/08/09 Raw View
Rich Paul <linguist@cyberspy.com> wrote:
>[Borland's] new throws an exception by default (MSVC does not ... and it has a
>broken set_new_handler ) and a catch(...) will only catch things that
>were thrown ... MSVC will catch GPF's thinking they're c++ exceptions.
You would prefer they crash your program? Structured exception
handling is a nice way to deal with accidental NULL pointer
dereferencing, stack overflows, etc.; at least you can exit
gracefully. It may be a little overactive, though, since some of us
do have code that can handle the IEEE results for divide by zero et
al.
The only other bad thing is that I've seen comments indicating that
the thrown item includes some dynamically allocated data that must be
deleted or you have a memory leak (not that big a deal, probably, but
even so...); anybody got more details on this? (Including possibly a
"Wrong again, Andrew...")
Andrew Bell
abell@mindspring.com
---
[ comp.std.c++ is moderated. To submit articles: Try just posting with your
newsreader. If that fails, use mailto:std-c++@ncar.ucar.edu
comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
Comments? mailto:std-c++-request@ncar.ucar.edu
]
Author: fjh@mundook.cs.mu.OZ.AU (Fergus Henderson)
Date: 1996/08/12 Raw View
abell@mindspring.com (Andrew Bell) writes:
>Rich Paul <linguist@cyberspy.com> wrote:
>>[Borland's] new throws an exception by default (MSVC does not ... and it has
>>a broken set_new_handler ) and a catch(...) will only catch things that
>>were thrown ... MSVC will catch GPF's thinking they're c++ exceptions.
>
>You would prefer they crash your program?
Just to keep this thread somewhat on topic: as far as the C++ draft working
paper is concerned, an implementation is perfectly entitled to do whatever
it likes when you dereference a null pointer, etc.; treating GPFs as
C++ exceptions is not required by the DWP, but it's certainly permitted.
It is one of those issues that is considered "quality of implementation".
In my opinion, converting GPFs or the equivalent into C++ exceptions is a
something that would probably make it easier to write robust programs,
so think it is a good idea.
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh@128.250.37.3 | -- the last words of T. S. Garp.
---
[ comp.std.c++ is moderated. To submit articles: try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
[ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu ]
Author: jcoffin@taeus.com (Jerry Coffin)
Date: 1996/08/13 Raw View
In article <4umrto$pq7@mulga.cs.mu.OZ.AU>, fjh@mundook.cs.mu.OZ.AU
says...
[ ... ]
> In my opinion, converting GPFs or the equivalent into C++ exceptions
> is a something that would probably make it easier to write robust
> programs, so think it is a good idea.
One caveat: there's no attempt to convert a structured exception to
any particular kind of C++ exception. The only way you can catch
structured exceptions is with a `catch(...)'. Depending on viewpoint,
this may or may not be a significant shortcoming. (I'm personally not
convinced it could reasonably do anything else, but others are likely
to disagree with me on that.)
--
Later,
Jerry.
[ comp.std.c++ is moderated. To submit articles: try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
[ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu ]
Author: Rich Paul <linguist@cyberspy.com>
Date: 1996/08/14 Raw View
Fergus Henderson wrote:
> In my opinion, converting GPFs or the equivalent into C++ exceptions is a
> something that would probably make it easier to write robust programs,
> so think it is a good idea.
I would agree, if there was a documented type that was thrown on GPF ...
what galls me is that the only way to catch one is a catch(...), which
leaves you with no information as to what happened, where, or why!
I always use exactly one catch(...), in my main program, and if it gets
triggered it means that the program doesn't ship ... obviously something
is being thrown that I haven't even thought of. Not certianly a program
that GPF's should not ship (contrary to popular wisdom<G> and general
practice), but one needs information on what happened and where to fix
the problem.
--
#include <legalbs/standarddisclaimer>
Rich Paul | If you like what I say, tell my
C++, OOD, OOA, OOP, | employer, but if you don't,
OOPs, I forgot one ... | don't blame them. ;->
---
[ comp.std.c++ is moderated. To submit articles: try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
[ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu ]
Author: Rich Paul <linguist@cyberspy.com>
Date: 1996/08/08 Raw View
Patrick Horgan wrote:
> The latest Visual C++ compiler from Microsoft, (version 4.2) has much of the
> standard stuff including header files with no extensions, template stuff,
> the standard string class, etc...it's the most complete I've seen from anyone
> so far.
Borland includes bool, explicit, and many of the template things. It
includes both it's old string class ( which looks very much like the
standard, unlike CString ) and the Rogue Wave version of the new.
Their new throws an exception by default (MSVC does not ... and it has a
broken set_new_handler ) and a catch(...) will only catch things that
were thrown ... MSVC will catch GPF's thinking they're c++ exceptions.
I can't recall if they actually provide header files without extensions,
but i do know that #include<string> works ... perhaps they expand this
in their code. Either way is complient.
--
#include <legalbs/standarddisclaimer>
Rich Paul | If you like what I say, tell my
C++, OOD, OOA, OOP, | employer, but if you don't,
OOPs, I forgot one ... | don't blame them. ;->
---
[ comp.std.c++ is moderated. To submit articles: Try just posting with your
newsreader. If that fails, use mailto:std-c++@ncar.ucar.edu
comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
Comments? mailto:std-c++-request@ncar.ucar.edu
]
Author: Peter Liu <peterl@HK.Super.NET>
Date: 1996/07/30 Raw View
I've seen people talking about std C++ library. I also saw a book
called The (draft) std C++ library.
1. Is std C++ library the draft of the ANSI/ISO C++ standard ?
2. What is the version of C++ standard that support std C++ library ?
3. Is STL (Standard Template Library) parts of std C++ library ?
4. Does or will MSVC++ support std C++ library ? How about Borland,
Watcom, Symatec, etc...?
5. How can I can the std C++ library source ? for free ?
6. Does std C++ library has advanced features like: Garbage Collector,
Complex Number, Matrix Classes, Reference Count ? Dream on!
--
Peter Liu
Email: peterl@hk.super.net
Hong Kong
---
[ comp.std.c++ is moderated. To submit articles: Try just posting with your
newsreader. If that fails, use mailto:std-c++@ncar.ucar.edu
comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
Comments? mailto:std-c++-request@ncar.ucar.edu
]
Author: clamage@Eng.Sun.COM (Steve Clamage)
Date: 1996/07/31 Raw View
Peter Liu <peterl@HK.Super.NET> writes:
>I've seen people talking about std C++ library. I also saw a book
>called The (draft) std C++ library.
That book was written while the standard library was still being
developed. The development is still continuing, but is nearly
complete. The current library differs in important ways from
the version presented by the original version of that book.
I imagine the book will be revised once the standard is complete.
>1. Is std C++ library the draft of the ANSI/ISO C++ standard ?
Yes.
>2. What is the version of C++ standard that support std C++ library ?
There is not yet a C++ standard, and when it is published there
will be only one version. See the FAQ referenced below.
>3. Is STL (Standard Template Library) parts of std C++ library ?
Yes, although not exactly in the forms you usually find.
>4. Does or will MSVC++ support std C++ library ? How about Borland,
>Watcom, Symatec, etc...?
I'm sure they all will, especially after the standard is complete.
>5. How can I can the std C++ library source ? for free ?
Try GNU (Free Software Foundation).
>6. Does std C++ library has advanced features like: Garbage Collector,
No.
>Complex Number,
Yes.
>Matrix Classes,
No, but it has several array classes, and you can make arrays of arrays.
>Reference Count ?
Not as such.
--
Steve Clamage, stephen.clamage@eng.sun.com
---
[ comp.std.c++ is moderated. To submit articles: try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
[ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu ]
Author: vandevod@cs.rpi.edu (David Vandevoorde)
Date: 1996/07/31 Raw View
>>>>> "PL" == Peter Liu <peterl@HK.Super.NET> writes:
PL> I've seen people talking about std C++ library. I also saw a book
PL> called The (draft) std C++ library.
That book is quite outdated (although I hear it's still useful).
PL> 1. Is std C++ library the draft of the ANSI/ISO C++ standard ?
The future C++ standard (now scheduled for late 1998, I believe;
perhaps even 1999) will most likely consist of 27 chapters and a
few appendices. The things that will be described in chapters 17
through 27 will correspond to what is called the `standard C++
library'.
PL> 2. What is the version of C++ standard that support std C++
PL> library ?
0.98pl11 beta 4.
(Just joking. AFAIK, there is no published version number for these
things.)
PL> 3. Is STL (Standard Template Library) parts of std C++ library ?
Yes. (In some form.)
PL> 4. Does or will MSVC++ support std C++ library ? How about
PL> Borland, Watcom, Symatec, etc...?
They probably will. Right now, none could even handle the specs of
_draft_ standard library. However, many vendors (including Borland)
have some arrangement with Rogue Wave to use their approximate
implementation of the draft standard C++ library (Microsoft is the
one exception I know of).
PL> 5. How can I can the std C++ library source ? for free ?
The closest you could get to a free source would be the gcc libraries.
PL> 6. Does std C++ library has advanced features like: Garbage
PL> Collector, Complex Number, Matrix Classes, Reference Count ? Dream
PL> on!
No standard garbage collector, matrix classes or references counting.
Complex numbers are available, as is a very basic numerical array class.
Daveed
---
[ comp.std.c++ is moderated. To submit articles: Try just posting with your
newsreader. If that fails, use mailto:std-c++@ncar.ucar.edu
comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
Comments? mailto:std-c++-request@ncar.ucar.edu
]
Author: tim@bartok.Princeton.EDU (Tim Hollebeek)
Date: 1996/08/01 Raw View
Steve Clamage (clamage@Eng.Sun.COM) wrote:
: Peter Liu <peterl@HK.Super.NET> writes:
: >6. Does std C++ library has advanced features like:
: >Matrix Classes,
: No, but it has several array classes, and you can make arrays of arrays.
Which is unfortunate, since matrices aren't just arrays of arrays.
---------------------------------------------------------------------------
Tim Hollebeek | Disclaimer :=> Everything above is a true statement,
Electron Psychologist | for sufficiently false values of true.
Princeton University | email: tim@wfn-shop.princeton.edu
----------------------| http://wfn-shop.princeton.edu/~tim (NEW! IMPROVED!)
---
[ comp.std.c++ is moderated. To submit articles: Try just posting with your
newsreader. If that fails, use mailto:std-c++@ncar.ucar.edu
comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
Comments? mailto:std-c++-request@ncar.ucar.edu
]
Author: duncan@rcp.co.uk (Duncan Booth)
Date: 1996/08/02 Raw View
In article <xsoenlttc09.fsf@avs.cs.rpi.edu>, vandevod@cs.rpi.edu (David Vandevoorde) wrote:
>PL> 4. Does or will MSVC++ support std C++ library ? How about
>PL> Borland, Watcom, Symatec, etc...?
>
>They probably will. Right now, none could even handle the specs of
>_draft_ standard library. However, many vendors (including Borland)
>have some arrangement with Rogue Wave to use their approximate
>implementation of the draft standard C++ library (Microsoft is the
>one exception I know of).
>
The current version of MSVC++ (4.2) claims to support the standard C++
library.Here is the relevant bit of the documentation:
BEGIN QUOTE
The Standard C++ Library has been added to Visual C++ in version 4.2. It
encompasses the latest ANSI C++ extensions (as of June 1996), including the
Standard Template Library and a new iostream library. The Standard C++ Library
provides new functionality, such as numerous algorithms that manipulate C++
objects, and a migration path for developers who want to move to the new
standard iostream. For more information, see Issues Surrounding iostream and
the Standard C++ Library.
For information on which .LIB files will be linked in when you build, see C
Run-Time Libraries.
Note The C++ standard is an evolving piece of work. We have tried to provide
the most complete and up-to-date implementation of the Standard C++ library in
the industry. Because of this, parts of our documentation may not match our
implementation exactly. If you run into problems compiling your code based on
the documentation, please look closely at the header files. For the latest
discussion of technical issues concerning the C++ Standard Library, see
Microsoft Frequently Asked Questions in the PSS Web site at
http://www.microsoft.com/support/products/developer/visualc.htm.
END QUOTE
A brief examination appears to show that the documentation is running slightly
ahead of the implementation: the standard library objects don't appear in
namespace std, and the documentation of classes like basic_string show the
templates with default arguments, but the implementation doesn't appear to
have default arguments (I'm not even sure whether the compiler accepts default
template arguments --- I may have the syntax wrong, but it seems to swallow
defaults when I declare the template, but blows up when I try to use them).
Duncan Booth
Duncan Booth duncan@rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?
---
[ comp.std.c++ is moderated. To submit articles: Try just posting with your
newsreader. If that fails, use mailto:std-c++@ncar.ucar.edu
comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
Comments? mailto:std-c++-request@ncar.ucar.edu
]
Author: vandevod@cs.rpi.edu (David Vandevoorde)
Date: 1996/08/04 Raw View
>>>>> "DB" == Duncan Booth <duncan@rcp.co.uk> writes:
DB> In article <xsoenlttc09.fsf@avs.cs.rpi.edu>,
DB> vandevod@cs.rpi.edu (David Vandevoorde) wrote:
PL> 4. Does or will MSVC++ support std C++ library ? How about
PL> Borland, Watcom, Symatec, etc...?
>>
>> They probably will. Right now, none could even handle the specs of
>> _draft_ standard library. However, many vendors (including Borland)
>> have some arrangement with Rogue Wave to use their approximate
>> implementation of the draft standard C++ library (Microsoft is the
>> one exception I know of).
DB> The current version of MSVC++ (4.2) claims to support the standard C++
DB> library.Here is the relevant bit of the documentation:
Oh yes, I didn't mean the contrary; just that Microsoft is one of the
rare implementors that do not license the library from Rogue Wave
(I think they buy it from P.J. Plauger).
[...]
DB> A brief examination appears to show that the documentation is running
DB> slightly ahead of the implementation: the standard library objects
DB> don't appear in namespace std,
I suspect this is due to Microsoft's rather incomplete (incorrect?) support
of namespaces (namespaces and templates are evil friends ;-).
[...]
Daveed
---
[ comp.std.c++ is moderated. To submit articles: try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ FAQ: http://reality.sgi.com/employees/austern_mti/std-c++/faq.html ]
[ Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu ]
Author: patrick@broadvision.com (Patrick Horgan)
Date: 1996/08/05 Raw View
In article <xsoenlttc09.fsf@avs.cs.rpi.edu>, vandevod@cs.rpi.edu (David Vandevoorde) writes:
> PL> 4. Does or will MSVC++ support std C++ library ? How about
> PL> Borland, Watcom, Symatec, etc...?
>
> They probably will. Right now, none could even handle the specs of
> _draft_ standard library. However, many vendors (including Borland)
> have some arrangement with Rogue Wave to use their approximate
> implementation of the draft standard C++ library (Microsoft is the
> one exception I know of).
>
The latest Visual C++ compiler from Microsoft, (version 4.2) has much of the
standard stuff including header files with no extensions, template stuff,
the standard string class, etc...it's the most complete I've seen from anyone
so far.
--
Patrick J. Horgan patrick@broadvision.com Have horse will ride.
Opinions mine, not my employer's except by most bizarre coincidence.
---
[ comp.std.c++ is moderated. To submit articles: Try just posting with your
newsreader. If that fails, use mailto:std-c++@ncar.ucar.edu
comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
Comments? mailto:std-c++-request@ncar.ucar.edu
]
Author: duncan@rcp.co.uk (Duncan Booth)
Date: 1996/08/05 Raw View
In article <4tsf18$9hf@spider.rmplc.co.uk>, duncan@rcp.co.uk (Duncan Booth) wrote:
>A brief examination appears to show that the documentation is running slightly
>ahead of the implementation: the standard library objects don't appear in
>namespace std, and the documentation of classes like basic_string show the
>templates with default arguments, but the implementation doesn't appear to
>have default arguments (I'm not even sure whether the compiler accepts default
>template arguments --- I may have the syntax wrong, but it seems to swallow
>defaults when I declare the template, but blows up when I try to use them).
>
Just a brief follow up on my own post. It looks like Microsoft partially
support default template arguments, but not completely. In the program below,
the line which I have commented out will not compile when uncommented even
though the line above it will compile. This appears to be a glitch in the
compiler but unfortunately it was a glitch I hit when I made my previous post.
I would like confirmation though that I have not misunderstood some obscure
aspect of the standard that might outlaw this.
====
#include <string>
#include <iostream>
class A { public: static const string s; };
const string A::s = "an A\n";
class B { public: static const string s; };
const string B::s = "a B\n";
template<class X, class C = B> class D {
public:
X *pX;
typedef C DEFARG;
C *pC;
D() {
cout << pC->s;
cout << DEFARG::s;
// cout << C::s; // MSVC doesn't like this line.
};
};
class Xyzzy { };
D<Xyzzy, A> t1;
D<Xyzzy> t2;
int main(int argc, char **argv)
{
return 0;
}
===
Duncan Booth duncan@rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?
---
[ comp.std.c++ is moderated. To submit articles: Try just posting with your
newsreader. If that fails, use mailto:std-c++@ncar.ucar.edu
comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
Comments? mailto:std-c++-request@ncar.ucar.edu
]