6 private links
How should you prefer to pass smart pointers, and why?
So what does this have to do with make_shared? An std::shared_ptr is a relatively complex beast that has to do atomic reference counting and efficient destruction dispatching and things like that. As such, a relatively large amount of code is instantiated for each std::shared_ptr<> type.
Implementing f() to make the following snippet compile without the static_assert being fired looks impossible, doesn't it?
// <insert solution here>
int main () {
constexpr int a = f ();
constexpr int b = f ();
static_assert (a != b, "fail");
}
The wait-free and lock-free circular queue is a useful technique for time and memory sensitive systems. The wait-free nature of the queue gives a fixed number of steps for each operation. The lock-free nature of the queue enables two thread communication from a single source thread (the Producer) to a single destination thread (the Consumer) without using any locks.
The power of wait-free and lock-free together makes this type of circular queue attractive in a range of areas, from interrupt and signal handlers to real-time systems or other time sensitive software.
Videos about c++
Each C++ expression (an operator with its arguments, a literal, a variable name, etc) is characterized by two independent properties: a type and a value category. Each expression has some non-reference type, and each expression belongs to exactly one of the three primary value categories.
One of the new features in C++11 aimed at increased code efficiency is the emplace family of methods in containers. std::vector, for example, has an emplace_back method to parallel push_back, and emplace to parallel insert.
Namely, how can we merge multiple type-erased interfaces into one single interface. A similar question is also asked in the end of the first talk: How to apply type erasure to types with overlapping interfaces?
In this post we will learn C++ templates in depth: Class and function templates, template parameters, variadic templates, all with in depth examples.
Starting a thread in C++11 is as simple as declaring and instantiating a new object. We will analyze a simple multithreaded application to demonstrate how we can use the threads from the C++ standard library.
Memoization is a pretty well-known optimization technique which consists in “remembering” (i.e.: caching) the results of previous calls to a function, so that repeated calls with the same parameters are resolved without repeating the original computation.
This article examines various aspects of type declaration and deduction in both current standard
C++ as well as the forthcoming revised standard (C++0x), with an eye towards helping developers
understand how and why the effective type of a variable can be different from what's “obvious.”
Readers will find the article most useful if they are familiar with the basic rules for template argu
ment deduction, are aware of the difference between lvalues and rvalues, and have had some
exposure to the new C++0x features lvalue and rvalue references,
auto
variables, and lambda
expressions
Really good explanation of lambda implementations in c++