new features in c++?

E

edware

I read a C++ book some years ago and learned the
basics of C++. And I've almost done no C++ programming
since then. Now I notice stuff like exceptions, templates
and the using namespace statement. Are these things
new additions, or have they been there all along?
 
M

Marcus Kwok

edware said:
I read a C++ book some years ago and learned the
basics of C++. And I've almost done no C++ programming
since then. Now I notice stuff like exceptions, templates
and the using namespace statement. Are these things
new additions, or have they been there all along?

It depends on how many "some years" is. Current C++ was standardized in
1998, and a new standard (sometimes called C++0x) is due to come out
within the next few years. Even though the language was standardized in
1998, it may have been a little while before compiler implementers
caught up. Actually, I'm not even sure if there is a 100% fully
standards-compliant compiler, though from what I have seen the Comeau
compiler comes the closest (it's the only one I know of that supports
the "export" keyword for templates).
 
V

Victor Bazarov

edware said:
I read a C++ book some years ago and learned the
basics of C++. And I've almost done no C++ programming
since then. Now I notice stuff like exceptions, templates
and the using namespace statement. Are these things
new additions, or have they been there all along?

They have existed since November 1997 (and actually some time
before), when the first C++ International Standard was approved.
Many compilers implemented those features before as well.

V
 
D

Diomidis Spinellis

edware said:
I read a C++ book some years ago and learned the
basics of C++. And I've almost done no C++ programming
since then. Now I notice stuff like exceptions, templates
and the using namespace statement. Are these things
new additions, or have they been there all along?

C++ has been gaining features over the years. The following table
(excerpted from
http://www.spinellis.gr/pubs/conf/1999-ESREL-SoftRel/html/chal.html)
illustrates this fact by using the number of pages in Stroustrup's book
"The C++ Programming Language" as a proxy for the size of the language:

Edition Year Pages
------- ---- -----
1st 1986 328
2nd 1991 669
3rd 1997 910

By far the most important addition to C++ has been the template
mechanism, and the standard template library. I find programming in
modern C++ with STL to be a totally different experience than
programming in the 1986 version of the language. Nowadays I seldom use
new and delete; STL containers handle most of my storage management needs.
 
N

nsoma75

edware said:
I read a C++ book some years ago and learned the
basics of C++. And I've almost done no C++ programming
since then. Now I notice stuff like exceptions, templates
and the using namespace statement. Are these things
new additions, or have they been there all along?

when you say some years ago, is it like 10-12 years ago? A decade is a
pre-historic in computer science. :)
 
C

Carlos Martinez

edware said:
I read a C++ book some years ago and learned the
basics of C++. And I've almost done no C++ programming
since then. Now I notice stuff like exceptions, templates
and the using namespace statement. Are these things
new additions, or have they been there all along?

I think exceptions and templates were included in the standard of 1991,
and namespace in the standard of 1998
 
L

loufoque

Marcus Kwok wrote :
Comeau
compiler comes the closest (it's the only one I know of that supports
the "export" keyword for templates).

ICC also supports it.
 
A

Andrew Koenig

C++ has been gaining features over the years. The following table
(excerpted from
http://www.spinellis.gr/pubs/conf/1999-ESREL-SoftRel/html/chal.html)
illustrates this fact by using the number of pages in Stroustrup's book
"The C++ Programming Language" as a proxy for the size of the language:

Edition Year Pages
------- ---- -----
1st 1986 328
2nd 1991 669
3rd 1997 910

This claim is not quite fair. It would be more accurate to say that the
number of pages in the book is a proxy for the size of the language plus the
size of the standard library, as the library accounts for most of the growth
between the second and third editions (and some of the growth betwen the
first and second).
 
J

John Carson

Carlos Martinez said:
I think exceptions and templates were included in the standard of
1991, and namespace in the standard of 1998


There was no C++ standard in 1991. The first C++ standard was 1998.
 
D

Diomidis Spinellis

Andrew said:
This claim is not quite fair. It would be more accurate to say that the
number of pages in the book is a proxy for the size of the language plus the
size of the standard library, as the library accounts for most of the growth
between the second and third editions (and some of the growth betwen the
first and second).

True. I used the term language in a loose sense to mean the language
and the standard library, because this is how most programmers use
modern C++. I stand corrected.
 
W

wkaras

Andrew said:
This claim is not quite fair. It would be more accurate to say that the
number of pages in the book is a proxy for the size of the language plus the
size of the standard library, as the library accounts for most of the growth
between the second and third editions (and some of the growth betwen the
first and second).

I think it's one of the strengths of C and C++ that many capabilites
are
provided in standard libs rather than in the base language. But I
think
that, when comparing the "sizes" of languages, it's more valid to
take into account standard libs and not just the base language.

I think the point has to be taken that C++ has grown quickly and
dramatically. But it's important to keep in mind that older C and
C++ code can still be compiled by a current C++ compiler with
few or no changes. The Standard Committee is also working to
maintain/enhance the usability of C++ by those who don't
have the need/time to "master" the entire language
(see http://www.artima.com/cppsource/cpp0x.html ).

My answer to those who say that C++ is "too" big is, when you
go back to using MS-DOS, I'll go back to using straight C. More
capability always means more complexity. Complexity has to be
dealt with the using good, non-monolithic engineering -- breaking a
design up into layers and components with well-defined,
minimized interfaces. C++ has largely followed this
approach, and the placement of capabilities in libraries
rather than in the base language is a sign of it.
 
C

Carlo Milanesi

John said:
There was no C++ standard in 1991. The first C++ standard was 1998.

Then, how come several compilers accepted the same language?
For instance, in 1992 both Microsoft and Borland were selling compilers
for C++. This language had exceptions and templates.
Which organization wrote the language specification?
And how do you call it, if not "standard"?
 
P

Phlip

Carlo said:
Then, how come several compilers accepted the same language?
For instance, in 1992 both Microsoft and Borland were selling compilers
for C++. This language had exceptions and templates.
Which organization wrote the language specification?
And how do you call it, if not "standard"?

Google /The Annotated C++ Reference Manual/. Without the force of law, it
represented Bjarne Stroustrup's compiler in 1990, so it became the
benchmark from which other implementations deviated.

They call it "The ARM", yet most compiler vendors were doing little more
than getting on the bandwagon. Some didn't support templates, for example.
 
I

Ian Collins

Carlo said:
Then, how come several compilers accepted the same language?
For instance, in 1992 both Microsoft and Borland were selling compilers
for C++. This language had exceptions and templates.
Which organization wrote the language specification?
And how do you call it, if not "standard"?

"The Annotated Reference Manual", commonly known as the ARM was the de
facto standard.
 
H

Herb Sutter

Diomidis Spinellis said:
True. I used the term language in a loose sense to mean the language
and the standard library, because this is how most programmers use
modern C++. I stand corrected.

FWIW, note that if you include the standard library in "the size of the
language," then Java is a couple of orders of magnitude larger and more
complex than C++.

Herb
 
J

Jerry Coffin

[ ... ]
Then, how come several compilers accepted the same language?
For instance, in 1992 both Microsoft and Borland were selling compilers
for C++. This language had exceptions and templates.

What Microsoft was selling in 1992 was Microsoft C/C++
7.0. It most assuredly did NOT support templates or
exception handling.

The first compiler from Microsoft to support templates or
exception handling was Visual C++ 2.0, which didn't come
out until 1994.
Which organization wrote the language specification?
And how do you call it, if not "standard"?

The C++ standard committee was working on a standard.
They had various working papers and a couple of draft
standards before there was an actual standard. Bjarne
Stroustrup also wrote a couple of books that described
the language (more or less) as it was supported by a
couple of specific versions of cfront. The _C++ Annotated
Reference Manual_, for example, corresponded to cfront
2.1, and the language it accepted. While the ARM was
considerably more complete and formal than its
predecessors, it was still quite a ways short of being a
standard.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top