wood burning stoves*
The moose likes C / C++ and the fly likes Special features in new C++0x Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Languages » C / C++
Bookmark "Special features in new C++0x " Watch "Special features in new C++0x " New topic
Author

Special features in new C++0x

Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3817

Hi Anthony,

Any special features in the new facilities you'd like to highlight or any simplifications provided for concurrency in C++ ?


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Anthony Aj Williams
author
Ranch Hand

Joined: Jun 10, 2011
Posts: 56
Vijitha Kumara wrote:Any special features in the new facilities you'd like to highlight or any simplifications provided for concurrency in C++ ?


There are lots of great language features that have been added to C++0x. The two that I think will have the most direct impact on code I write will be the new use of auto for type deduction of variables, the introduction of lambda functions.

These facilities work really well with the new C++0x thread library --- you can pass a lambda to the std::thread constructor, or to std::async to start a thread, and you can use auto to capture the future from std::async without having to type out the type of the returned future:



As far as concurrency facilities go, std::async is my favourite, but I wouldn't like to give up the RAII lock classes std::lock_guard<> and std::unique_lock<> when dealing with mutexes --- it's just so much easier using them than explicitly locking and unlocking mutexes.


Author of C++ Concurrency in Action http://www.stdthread.co.uk/book/
just::thread C++11 thread library http://www.stdthread.co.uk
Just Software Solutions Ltd http://www.justsoftwaresolutions.co.uk
15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3817

Thanks for the information...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Special features in new C++0x
 
Similar Threads
RMI & JNI in JDK 1.4
young HACKER's training: pass gen :)))
any free ebook containing new features of sjcp 1.5?
web service in struts
young HACKER's training: pass gen :)))