?

Log in

 

The new C++0x standard - Advanced C++ Community

About The new C++0x standard

Previous Entry The new C++0x standard Aug. 27th, 2009 @ 09:19 am Next Entry

What are your favorite features in the upcoming C++0x standard?

My personal favorites are:

  • rvalue references - I once said that the STL containers should be defined to move things around with the swap operation instead of by using the copy constructor so that auto_ptr would work. My opinion is vindicated by rvalue references and the requirement that the STL containers use move construction.
  • Variadic templates - So much stupid ugliness in Boost is because you can't have templates with variable numbers of arguments. This fixes that.

Current Location: 2237 NW 62nd ST, 98107
Current Mood: curiouscurious
Tags:
Leave a comment
[User Picture Icon]
From:nponeccop
Date:August 27th, 2009 04:28 pm (UTC)
(Link)
My favourites are:

- anonymous functions
- auto/decltype
[User Picture Icon]
From:fastb
Date:August 27th, 2009 04:41 pm (UTC)
(Link)
Just from a quick glance, I'm going with:

- lambda functions
- "auto" types
- range for statement

And on a minor note,

- template right-angle bracket fix. Good grief, this took long enough to fix.
(Deleted comment)
[User Picture Icon]
From:jtootf
Date:August 27th, 2009 04:59 pm (UTC)
(Link)
Template aliases!

+1

Concepts, while a long time in coming, will make writing template libraries much nicer.

http://lambda-the-ultimate.org/node/3518
(Deleted comment)
[User Picture Icon]
From:jtootf
Date:August 27th, 2009 06:38 pm (UTC)
(Link)
tempus fugit: will C++0x be better than e.g. D?
(Deleted comment)
[User Picture Icon]
From:jtootf
Date:August 27th, 2009 07:07 pm (UTC)
(Link)
I agree completely
[User Picture Icon]
From:ataxi
Date:August 28th, 2009 01:25 am (UTC)
(Link)
I agree with your last para but I'd still like to see some syntactic unity across multiple problem domains. I wouldn't mind seeing a genuine attempt at "one curly-bracket language to rule them all" with different compilation / runtime variants for different purposes.
[User Picture Icon]
From:ataxi
Date:August 28th, 2009 01:25 am (UTC)
(Link)
Of course those attempts already exist, but hey it'd be nice if they worked and/or were adopted widely.
[User Picture Icon]
From:omnifarious
Date:August 28th, 2009 02:10 am (UTC)

What I like about C++

(Link)

What I like about C++ is an extension of what I like about C. C has been described as structured assembly language. C was designed so that no feature extracted a runtime penalty that wasn't fairly small, and relatively obvious. Additionally C was designed so that you could describe almost anything that was happening on the machine's lowest level.

C++ shares many of these features. Yes, there are features that extract a runtime penalty that is a bit higher and not quite so obvious. Virtual functions and exceptions being good examples. But mostly it's the same idea as C.

I want a language like that. I want few or no hidden runtime costs for anything I express in the language. And I want the language to be complete enough that I can talk about things that happen at the level of reading and writing individual bits and bytes in specific locations in memory.

There are no languages I know of that give those features aside from C, C++ and possibly Ada. I think those are crucial to understanding the success of C and C++.

I definitely think there is room for a language in this niche. C++ has many features that are constrained by its history and way more complex than they need to be. The problem is that anybody who has ever aimed to replace it has misunderstood the fundamental attraction and made features like garbage collection be fundamental to the language when they have inobvious runtime costs and can significantly interfere with controlling what happens at the very lowest level.

[User Picture Icon]
From:eatdave13
Date:August 27th, 2009 05:13 pm (UTC)
(Link)
concepts :(
[User Picture Icon]
From:eatdave13
Date:August 27th, 2009 05:14 pm (UTC)
(Link)
Initialization lists are beyond rad though. Man that's gonna make some pretty code.
[User Picture Icon]
From:_candide_
Date:August 30th, 2009 01:07 am (UTC)
(Link)
I love the new per-element iteration syntax, which is one of the main purposes of the 'auto' keyword.

Why mess around with a container's iterator types in a way that creates unwieldy loops when the compiler can do it for you better than you can? ;)
(Leave a comment)
Top of Page Powered by LiveJournal.com