background preloader

C++/C++0x/C++11 reference - Cppreference

C++/C++0x/C++11 reference - Cppreference
Related:  C++11

Multithreading and Concurrency | Just Software Solutions - Custom Software Development and Website Development in West Cornwall, UK My book, C++ Concurrency in Action contains a detailed description of the C++11 threading facilities, and techniques for designing concurrent code. The just::thread implementation of the new C++0x thread library is available for Microsoft Visual Studio 2005, Microsoft Visual Studio 2008, Microsoft Visual Studio 2010, g++ 4.5.2 and g++ 4.6.1 on Windows, g++ 4.3, 4.4, 4.5 and 4.6 on Linux, and g++ 4.3, 4.4 and 4.5 on MacOSX. Order your copy today. C++ Concurrency in Action and Just::Thread Discounts My book C++ Concurrency in Action was finally published on 29th February 2012, after 4 years of work. It's hard to believe that I can actually hold a copy in my hand; it's just been files on my computer for so long. My book is a tutorial and reference to the thread library from the new C++11 standard. If you haven't already got a copy, you can order one direct from Manning, or from amazon.com, or amazon.co.uk. Discount on Just::Thread | Stumble It! | Submit to Reddit | Submit to DZone The problem

C++ Concurrency in Action C++ Concurrency in Action is a reference and guide to the new C++ 11 Standard for experienced C++ programmers as well as those who have never written multithreaded code. This book will show you how to write robust multithreaded applications in C++ while avoiding many common pitfalls. About the Technology Multiple processors with multiple cores are the norm these days. About the Book Without assuming you have a background in the subject, C++ Concurrency in Action gradually enables you to write robust and elegant multithreaded applications in C++11. Written for C++ programmers who are new to concurrency and others who may have written multithreaded code using other languages, APIs, or platforms. What's Inside Written for the new C++11 Standard Programming for multiple cores and processors Small examples for learning, big examples for practice About the Author Anthony Williams is a UK-based developer and consultant with many years experience in C++.

C++11 FAQ C++11 / C++0x Documentation « Punch Card You want to improve your “old” C++ code base by allowing new features or bug fixes to be enhanced with C++11? The questions you will face on the way are manifold. First, what exactly allows me C++11 to do? Where is some documentation? As a preparation for a lecture I’m holding in the next semester I was compiling a list of links to C++11 / C++0x documentation sites and as some kind of personal archive I will post them here: General C++11 / C++0x FAQ New Features (Overview) Compiler Support Standard Library Documentation I will update this list as I find new sources. -Martin Like this: Like Loading... C++11 multithreading tutorial – part 2 C++11 multithreading tutorial - part 2 Posted on February 27, 2012 by Sol The code for this tutorial is on GitHub: In my last tutorial about using threads in C++11 we’ve seen that the new C++11 threads syntax is remarkably clean compared with the POSIX pthreads syntax. Using a few simple concepts we were able to build a fairly complex image processing example avoiding the subject of thread synchronization. We’ll start with a quick remainder of how we can create a group of threads in C++11. Compiling the above program on Mac OSX Lion with clang++ or with gcc-4.7 (gcc-4.7 was compiled from source): On a modern Linux system with gcc-4.6.x we can compile the code with: Some real life problems are embarrassingly parallel in their nature and can be well managed with the simple syntax presented in the first part of this tutorial. Other problems by their nature require some level of synchronization between threads. What has happened ???

Open Multi-Methods for C++11, Part 1 Introduction This article is the first in a series about open multi-methods for C++11. In this installment, I will explain what they are, how they fit in the object-oriented paradigm, and make controversial statements. Subsequent articles will present a new library that implements open multi-methods, using the facilities provided by C++11 (in particular, variadic templates). The library's salient features are: fast, constant time dispatch using compact tables; arbitrary number of virtual and non virtual arguments; access to the next most specific specialization; and support for shared libraries and dynamic loading. The series will conclude with an in-depth presentation of the internals of the library. If you are impatient, you can grab the code from GitHub and read the documentation. Polymorphism and Poly-polymorphism Object-oriented programming (OOP) rests on three pillars: encapsulation, inheritance and polymorphism. I used to teach C++ classes when OOP was still a new thing. Conclusion

Cppcheck Cppcheck is a static analyzer for C and C++ code. It is open-source, free, cross-platform and easy-to-use. The project's website: Cppcheck is an open-source, free tool distributed under the GNU General Public License. Daniel Marjamäki is the project's manager (his profile on StackOverflow). Cppcheck's capabilities At the moment of writing this article, the most recent version of Cppcheck is 1.60.1 which supports the following languages: C89, C99, C11, C++03, C++11; and provides the following plugins to integrate into various development environments: Cppcheck's scope of use One of the basic advantages of the Cppcheck analyzer is that it is easy-to-use. Figure 1. Just select "Check directory" in the menu and specify the path to your project. Figure 2. Well, I was not quite honest when saying that Cppcheck doesn't need any customization. When analysis is over, you can study the diagnostic messages. Figure 3. Diagnostics Examples of diagnostics Sample 1. .. .. .. ..

C++11 FAQ Morgan Stanley | Columbia University | Texas A&M University home | C++ | FAQ | technical FAQ | C++11 FAQ | publications | TC++PL | Tour++ | Programming | D&E | bio | interviews | applications | glossary | compilers Modified September 5, 2014 This document is written by and maintained by Bjarne Stroustrup. Translations: I have contributed to the new, unified, isocpp.org C++ FAQ maintained by The C++ Foundation of which I am a director. C++11 is the ISO C++ standard ratified in 2011. A late working paper is available. Before its official ratification, we called the upcoming standard C++0x. All official documents relating to C++11/C++0x can be found at the ISO C++ committee's website. Caveat: This FAQ will be under construction for quite a while. Purpose The purpose of this C++11 FAQ is To give an overview of the new facilities (language features and standard libraries) offered by C++11 in addition to what is provided by the previous version of the ISO C++ standard. Lists of questions B. Yes:

Ten C++11 Features Every C++ Developer Should Use This article discusses a series of features new to C++11 that all developers should learn and use. There are lots of new additions to the language and the standard library, and this article barely scratches the surface. However, I believe some of these new features should become routine for all C++ developers. You could probably find many similar articles evangelizing different C++11 features. This is my attempt to assemble a list of C++ features that should be a norm nowadays. Table of contents: auto Before C++11 the auto keyword was used for storage duration specification. auto i = 42; auto l = 42LL; auto p = new foo(); Using auto usually means less code (unless your type is int which is one letter shorter). std::map<std::string, std::vector<int>> map; for(auto it = begin(map); it ! You should note that auto cannot be used as the return type of a function. template <typename T1, typename T2> auto compose(T1 t1, T2 t2) -> decltype(t1 + t2) { return t1+t2; } auto v = compose(2, 3.14);

Catch 1.0 - level of indirection - level of indirection Since Catch first went public, two and a half years ago, at time of this writing, I've made a point of describing it as a "developer preview". Think of it as you might a Google beta and you won't go far wrong. I did this because I knew that there was a lot that needed doing - and in particular that some of the public interfaces would be subject to change. That time has come. As of today the version of Catch available on the Master branch on GitHub is 1.0 and I would encourage you to update to it if you're already using an older version. What's new? Output One of the biggest changes is in the console reporter's output. ClassTests.cpp:28: FAILED: REQUIRE( s == "world" ) with expansion: "hello" == "world" That indentation is applied after a wrap too, so long lines of output are much more clearly separated from the surrounding context. But there's a lot more to the new look. Naming and tags The trouble was test names needed to be short and simple otherwise they got very long. Variadic macros .

Easy C++ benchmarking - Nick Bruun For a long time, hardware was the biggest restriction we faced when trying to squeeze performance out of our software, especially when writing I/O bound software such as server applications. If we go back ten years, such applications would by far spend most of its time waiting for sockets or disks to become ready for work, especially when bound by 10 Mbit/s uplinks and 5,400 RPM disks. The result? Times have changed though. A first world problem I've spent a lot of the last half year working on/off on a piece of software, where this is definitely true. Performance of what is essentially just an HTTP server is relatively easy to test as a whole. Unit testing has become a de facto standard in our industry, and I've been very happy with adopting it for this project, as I'm easily able to rule out most bugs in the code -- if there is a bug, it's probably my own logic that's the problem, not the code itself. A solution -- or close enough Give it a go

GitHub - ericniebler/range-v3: Experimental range library for C++11/14/17 Three Optimization Tips for C++

Related: