basics

C++17: Structured Bindings--Marc Gregoire

It is coming!

C++17: Structured Bindings

by Marc Gregoire

From the article:

This is a first post in a series of short articles on new C++17 features. These articles will not contain all little details of the new features being presented, but they give you an idea about what new functionality has been added to C++17.

Quick Q: Initializing a C++11 string with {}

Quick A: It calls the initializer_list constructor that has the same effect in this case.

Recnetly on SO:

Initializing a C++11 string with {}

The {} initialization syntax is known as the uniform initialization syntax, it has a few key differences, but in your code as is they both do the same thing - construct a std::string object from the string literal "Test"

Initializing an object with an assignment is essentially the same as putting the right hand side in parentheses and constructing the object. For example the below two are the same

T obj = a;
T obj(a);

So you should be asking yourself, what is the difference between constructing a string object the following two ways

std::string{"Test"};
std::string("Test");

And the answer is that both the constructions above are the same and call the same constructor for std::string

For more on uniform initialization see https://softwareengineering.stackexchange.com/questions/133688/is-c11-uniform-initialization-a-replacement-for-the-old-style-syntax

Functors in C++-Part I and II--Mayank Jain

And how they are used by the std:

Functors in C++

by Mayank Jain

Part I - Part II

From the article:

Functor or function object is a C++ class which defines the operator ( ). Functor let’s you create objects which “looks like” functions...

5 years of Meeting C++

Meeting C++ exists now for 5 years, lets celebrate on the blog:

5 years of Meeting C++

by Jens Weller

From the article:

Just a little bit more then 5 years ago, Meeting C++ went public. Since then, it has been a wild ride and huge success. Today, Meeting C++ reaches over 50k in social media, the conference it self has grown from 150 to 600 in its 5 editions...

C++ Weekly Episode 70: C++ IIFE in quick-bench.com—Jason Turner

Episode 70 of C++ Weekly.

C++ IIFE in quick-bench.com

by Jason Turner

About the show:

We are commonly taught to const everything that we can in C++. One way to accomplish this goal in the post-C++11 world is to use a immediately invoked lambda (equivalent to an IIFE in the JavaScript world) that generates a value for us, which we assign to a const value. But what impact does this design decision have on the quality of code generated and the performance? In this episode of C++ Weekly we use the new website quick-bench to test the various options available.