background preloader

C++

Facebook Twitter

C++11. C++11 (formerly known as C++0x) is the most recent version of the standard of the C++ programming language. It was approved by ISO on 12 August 2011, replacing C++03.[1] The name follows the tradition of naming language versions by the year of the specification's publication. Work is currently under way on the C++14 and C++17 standards.[6] Changes from the previous version of the standard[edit] The modifications for C++ involve both the core language and the standard library. In the development of every utility of the 2011 standard, the committee has applied some directives: Attention to beginners is considered important, because they will always compose the majority of computer programmers, and because many beginners would not intend to extend their knowledge of C++, limiting themselves to operate in the aspects of the language in which they are specialized.[1] Extensions to the C++ core language[edit] Core language runtime performance enhancements[edit] Has a trivial default constructor.

Visual C++ Team Blog. Check out the new C++ AMP book by Kate Gregory and Ade Miller - Visual C++ Team Blog. The C++ AMP book by Kate Gregory and Ade Miller is available in print or online from your favorite retailer! What is in it for you? Among other things, you will discover how to: Gain greater code performance using graphics processing units (GPUs)Choose accelerators that enable you to write code for GPUsApply thread tiles, tile barriers, and tile static memoryDebug C++ AMP code with Microsoft Visual Studio®Use profiling tools to track the performance of your code I was able to corner Ade Miller long enough to answer a few questions: Q1: “C++ AMP” in 140 characters or less?

“A hardware agnostic data parallel programming model for C++.” That’s pretty terse :). Q2. I’ve had a longstanding interest in GPU programming. Q3. I’d been writing code for CUDA and Thrust so I was already pretty familiar with the data parallel model. Q4. I think it’s fair to say that was the work Kate and I did on performance (chapters 7-9). Q5. Q6. Don’t worry too much about some of the darker corners of the language. Resource Acquisition Is Initialization. Benefits[edit] The advantages of RAII as a resource management technique are that it provides encapsulation, exception safety (for stack resources), and locality (it allows acquisition and release logic to be written next to each other).

Resource management therefore needs to be tied to the lifespan of suitable objects in order to gain automatic allocation and reclamation. Resources are acquired during initialization, when there is no chance of them being used before they are available, and released with the destruction of the same objects, which is guaranteed to take place even in case of errors. Typical uses[edit] Another typical example is interacting with files: We could have an object that represents a file that is open for writing, wherein the file is opened in the constructor and closed when execution leaves the object's scope. C++ example[edit] The following C++11 example demonstrates usage of RAII for file access and mutex locking: Notes[edit] References[edit] External links[edit]

GoingNative 2012.