• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Special features in new C++0x

 
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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++ ?
 
author
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the information...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic