Welcome Guest.   Make a donation to an author on the site December 22, 2014, 11:47:10 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
View the new Member Awards and Badges page.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: C++0x: The Dawning of a New Standard  (Read 4550 times)
Ehtyar
Supporting Member
**
Posts: 1,236



That News Guy

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« on: August 22, 2008, 02:55:40 AM »

Hi all.
Some new stuff on C++0x (the next-gen C++) has been release since I've been away and since no one else has posted, here we go...
Here is an article from DevX about C++0x including:
->Overview: C++ Gets an Overhaul
->An Introduction to Concepts
->Simpler Multithreading in C++0x
->The State of the Language
There is also this paper by Bjarne Stroustrup (Inventor of C++) which mouse man tells me is very good reading due to both the ideas expressed, and the information regarding the management of development divulged in its pages.
For the ultra-brave and uber-interested, you can access the Committee's mailings here.

For those of you not quite interested enough to go rummaging around the web, the main benefits thus far are slated to be:
  • enhanced memory model supporting modern machine architectures
  • threading ABI
  • mutexes and locks
  • thread local storage
  • asynchronous message exchange
  • regex support
  • hash table support
  • tuple (ordered list) support
  • improved date and time support
  • miscellaneous improvements for library creators
  • static assertion support
  • variadic template support
  • alignment control
  • delegating and inheriting constructors
  • auto keyword for deducing a type from an initializer
  • decltype keyword as a way of using the type of an expression in a declaration
  • nullptr keyword to describe the null pointer
  • range-based for loops (foreach) (yay)
  • lambda functions (yay)
  • raw string literals
  • UTF8 literals
  • concepts (a type system for template arguments)
  • in-class member initializers
  • shared_ptr<> keyword

Ehtyar.
« Last Edit: August 22, 2008, 03:56:55 PM by Ehtyar » Logged
mouser
First Author
Administrator
*****
Posts: 33,795



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: August 22, 2008, 06:48:26 AM »

Yesterday I read the (59 page) paper "Evolving a language in and for the real world: C++ 1991-2006" by Stroustrup, and can highly recommend it for a variety of reasons.

The article is like an updated, more concise version of his book "The Design and Evolution of C++", which I also recommend, though it's somewhat dated at this point.

The paper is a fascinating combination of technical discussion on language design conflicts, historical explanation for why things are they way they are, and political history of how hard it can be to manage a standards committee.  Some very cool insider stuff.

I'm someone who has been coding in c++ for 20 years and has a love/hate relationship with the language.  As I've discussed elsewhere I am not thrilled with C++0x.  In fact it wouldn't surprise me terribly if the release of c++0x doesn't hasten the demise of the language.

However, I do think that there is an incredible amount to be learned from the decisions and struggles of the C++0x process, and it's must read stuff for anyone interested in the art of programming language design.

(if you are interested in this kind of stuff, do make sure you read the critique of c++ by Ian Joyner that i mention on the other thread).
« Last Edit: August 22, 2008, 06:55:58 AM by mouser » Logged
Ehtyar
Supporting Member
**
Posts: 1,236



That News Guy

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #2 on: August 22, 2008, 07:01:25 AM »

In response to your not being thrilled with C++0x, I must say if C# was portable to a similar to extent as C++, I'd be there in short order. However, as mouse man knows, I am greatly adverse to proprietary languages, and I refuse to be taken up on C# by Microsoft. Perhaps something like D may strike my fancy if/when they get their finger out.

Ehtyar.
Logged
f0dder
Charter Honorary Member
***
Posts: 8,774



[Well, THAT escalated quickly!]

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: August 22, 2008, 08:21:22 AM »

I think stuff like UTF8 literals is a mistake - internationalization resources really should be moved to external files.

I wonder why nullptr is necessary, '0' is clean enough in source code? (but perhaps this is template-magic related).

Dunno about regex being a core part of the language; it's useful, but you won't know about the speed of implementations if you're doing cross-platform stuff, so you're probably better suited using a thing like PCRE...

Threading and TLS support is a big win, I just hope the ABI for it is non-retarded.

foreach and lambda support is going to be cooooool smiley

As a whole, I'm pretty mixed on C++0x. There's a bunch of good stuff in it, a bunch of whatever stuff, and a bunch of stuff that I feel will make the C++ platform somewhat bloated and a lot more effort for vendors to deploy. Also, it's a bit too late, and if you want to do cross-platform code, you probably won't have C++0x available on a lot of the platforms you're writing for...
Logged

- carpe noctem
mwb1100
Supporting Member
**
Posts: 1,357


View Profile Give some DonationCredits to this forum member
« Reply #4 on: August 22, 2008, 01:40:36 PM »

I wonder why nullptr is necessary, '0' is clean enough in source code? (but perhaps this is template-magic related).

Regular old overloading and plain old readability.

I like nullptr.  The rationale from the nullptr proposal (http://www.open-std.org/j...ocs/papers/2004/n1601.pdf):

  • Distinguishing between null and zero. The null pointer and an integer 0 cannot be distinguished well for overload resolution. For example, given two overloaded functions f(int) and f(char*), the call f(0) unambiguously resolves to f(int).1 There is no way to write a call to f(char*) with a null pointer value without writing an explicit cast (i.e., f((char*)0)) or using a named variable.
  • Naming null. Further, programmers have often requested that the null pointer constant have a name (rather than just 0). This is one reason why the macro NULL exists, although that macro is insufficient. (If the null pointer constant had a type-safe name, this would also solve the previous problem as it could be distinguished from the integer 0 for overload resolution and some error detection.)
Logged
Ehtyar
Supporting Member
**
Posts: 1,236



That News Guy

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #5 on: August 22, 2008, 03:46:47 PM »

Dunno about regex being a core part of the language; it's useful, but you won't know about the speed of implementations if you're doing cross-platform stuff, so you're probably better suited using a thing like PCRE...
I imagine unless they actually use PCRE for their implementation, it will be too little too late.

Ehtyar.
Logged
mwb1100
Supporting Member
**
Posts: 1,357


View Profile Give some DonationCredits to this forum member
« Reply #6 on: August 22, 2008, 03:48:32 PM »

Also C++0x will standardize shared_ptr<> which can make managing the lifetime of dynamically allocated objects pretty much as easy to manage as in garbage collected environments like .NET or Java.

shared_ptr's are seriously nice. 

shared_ptrs<> are already available as part of TR1 (which is now in MSVC 9/VS 2008  if you get SP1) or part of Boost.
Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.201s | Server load: 0.07 ]