473,386 Members | 1,886 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

new features in c++?

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?
Apr 26 '06 #1
17 1735
edware <er***@hotmail.com> wrote:
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).

--
Marcus Kwok
Replace 'invalid' with 'net' to reply
Apr 26 '06 #2
edware wrote:
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
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Apr 26 '06 #3
Marcus Kwok wrote:
edware <er***@hotmail.com> wrote:
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,


Actually, _current_ C++ is circa 2003, when some corrections were made
to the Standard.
[...]


V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Apr 26 '06 #4
edware wrote:
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/19...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.

--
Diomidis Spinellis
Code Quality: The Open Source Perspective (Addison-Wesley 2006)
http://www.spinellis.gr/codequality
Apr 26 '06 #5
Victor Bazarov <v.********@comacast.net> wrote:
Marcus Kwok wrote:
It depends on how many "some years" is. Current C++ was standardized
in 1998,


Actually, _current_ C++ is circa 2003, when some corrections were made
to the Standard.


Ah, thanks for the correction.

--
Marcus Kwok
Replace 'invalid' with 'net' to reply
Apr 26 '06 #6

edware wrote:
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. :)

Apr 26 '06 #7
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.

Apr 26 '06 #8
"Diomidis Spinellis" <dd*@aueb.gr> wrote in message
news:e2**********@volcano1.grnet.gr...
C++ has been gaining features over the years. The following table
(excerpted from
http://www.spinellis.gr/pubs/conf/19...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).
Apr 26 '06 #9
edware wrote:
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
Apr 26 '06 #10
"Carlos Martinez" <cm****@nospam.tid.es> wrote in message
news:e2*********@news.hi.inet
edware wrote:
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

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

--
John Carson
Apr 26 '06 #11
Andrew Koenig wrote:
"Diomidis Spinellis" <dd*@aueb.gr> wrote in message
news:e2**********@volcano1.grnet.gr...
C++ has been gaining features over the years. The following table
(excerpted from
http://www.spinellis.gr/pubs/conf/19...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).


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.
Apr 26 '06 #12

Andrew Koenig wrote:
"Diomidis Spinellis" <dd*@aueb.gr> wrote in message
news:e2**********@volcano1.grnet.gr...
C++ has been gaining features over the years. The following table
(excerpted from
http://www.spinellis.gr/pubs/conf/19...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).


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.

Apr 26 '06 #13
John Carson wrote:
"Carlos Martinez" <cm****@nospam.tid.es> wrote in message
news:e2*********@news.hi.inet
edware wrote:

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.


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

--
Carlo Milanesi
http://digilander.libero.it/carlmila
Apr 26 '06 #14
Carlo Milanesi wrote:
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.

--
Phlip
http://www.greencheese.us/ZeekLand <-- NOT a blog!!!
Apr 26 '06 #15
Carlo Milanesi wrote:
John Carson wrote:
"Carlos Martinez" <cm****@nospam.tid.es> wrote in message
news:e2*********@news.hi.inet
edware wrote:

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.

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.

--
Ian Collins.
Apr 26 '06 #16
Diomidis Spinellis <dd*@aueb.gr> wrote:
Andrew Koenig wrote:
"Diomidis Spinellis" <dd*@aueb.gr> wrote in message
news:e2**********@volcano1.grnet.gr...
C++ has been gaining features over the years. The following table
(excerpted from
http://www.spinellis.gr/pubs/conf/19...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).


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

---
Herb Sutter (www.gotw.ca) (www.pluralsight.com/blogs/hsutter)

Convener, ISO WG21 (C++ standards committee) (www.gotw.ca/iso)
Architect, Developer Division, Microsoft (www.gotw.ca/microsoft)
Apr 29 '06 #17
In article <44**********************@news.tiscali.it>,
ca********************@libero.it says...

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

--
Later,
Jerry.

The universe is a figment of its own imagination.
May 5 '06 #18

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Kl | last post by:
Hi, python is really easy to learn in my opinion. There are loads of tutorials/books on the web talking about the most common python features. The problem comes when they add something new to the...
18
by: 5460lqh | last post by:
who can tell me which two features in the C++ language are most usefule, and which two features that you think are the most over-rated or the most misused and why you think so? Thanks very much!
2
by: zhaoyandong | last post by:
One of my interviewers ask me "Two favorite features of C++, and over-rated, and misued features" Could anybody give me some advice on this? Thanks
18
by: Michael B Allen | last post by:
Is it considered a bad idea to use a C99 only feature? It has been almost 6 years right? Specifically I'm interested in variadic macros. All of my code is C89 (or less) except for my debugging...
8
by: Servé Lau | last post by:
I've read the new features that are coming to the next VC and they all sound fine. But I was missing new standard C++ features, will the features like export still not be implemented? What...
6
by: aron t | last post by:
Hi, I am good php programmer and want to learn asp.net. Can someone tell me what are the best and the worst features of ASP.NET? thanks
0
by: Shawn Cutter | last post by:
I am beginning work on a somewhat complex project and I need to decide what route to take before beginning the project. The main issue with this project is that it needs to be modular and support...
148
by: BillJosephson | last post by:
Want to do OOP. Does c++ have all the abilities of java, or is it some subset? Thanks...
7
by: Fister | last post by:
I'm reading Professional C# (Wrox) and stumbled across: "Some features are supported by.NET but not by C#, and you might be surprised to learn that some features of the C# language are not...
5
by: bearophileHUGS | last post by:
I often use Python to write small programs, in the range of 50-500 lines of code. For example to process some bioinformatics data, perform some data munging, to apply a randomized optimization...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.