6 private links
Return value optimization, simply RVO, is a compiler optimization technique that allows the compiler to construct the return value of a function at the call site.
Self-contained C/C++ profiler library for Linux
The idea behind it is as follows: classes should not define any of the special functions (copy/move constructors/assignment, and the destructor) unless they are classes dedicated to resource management.
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");
}
Silicon is a high performance, middleware oriented, C++14 http web framework. It brings to C++ the high expressive power of other web frameworks based on dynamic languages without introducing run-time overhead. Its compile-time static metaprogramming paradigm allows to match the performances of servers written in C.
This post walks through a complete, compile time implementation of a Snake game using C++ template metaprogramming.
In languages such as python, there is an in operator that is used to check if element is in a range:
if 5 in [1, 2, 3, 4, 5]: print("There is a 5")
What’s nice about this, is the almost english type readability of it. Let’s look at how we can implement such an operator in C++14.
Named operator made easy:
https://github.com/klmr/named-operator
This is an advanced blog post more geared to library writers who want to improve error messages due to substitution failure. It discuss how substitution failures can be transported so the correct information can be presented to the user. Lets first look at the problem.