Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Special features in new C++0x

 
Vijitha Kumara
Bartender
Pie
Posts: 3918
10
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anthony,

Any special features in the new facilities you'd like to highlight or any simplifications provided for concurrency in C++ ?
 
Anthony Aj Williams
author
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Vijitha Kumara
Bartender
Pie
Posts: 3918
10
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the information...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic