advanced

Quick Q: How does virtual inheritance solve the “diamond” (multiple inheritance) ambiguity?

Quick A: by making sure only one instance of each parent class is created.

Recently on SO:

How does virtual inheritance solve the “diamond” (multiple inheritance) ambiguity?

You want: (Achievable with virtual inheritance)

  A 
/ \ 
B   C 
\ / 
  D

And not: (What happens without virtual inheritance)

A   A 
|   |
B   C 
\ / 
  D

Virtual inheritance means that there will be only 1 instance of the base A class not 2.

Your type D would have 2 vtable pointers (you can see them in the first diagram), one for B and one for C who virtually inherit A. D's object size is increased because it stores 2 pointers now; however there is only one A now.

So B::A and C::A are the same and so there can be no ambiguous calls from D. If you don't use virtual inheritance you have the second diagram above. And any call to a member of A then becomes ambiguous and you need to specify which path you want to take.

Highlighting the Student and Support Tickets for Meeting C++ 2019

Also available in this year: the programs for students and diversity & support for Meeting C++ 2019

Highlighting the Student and Support Tickets for Meeting C++ 2019

by Jens Weller

From the article:

With the Schedule for Meeting C++ 2019 being complete regarding submitted talks, I want to highlight, that there is an opportunity for folks to attend the conference with a free ticket!

Quick Q: Where and why do I have to put the “template” and “typename” keywords?

Quick A: to help the compiler understand what the programmer wants.

Recently on SO:

Where and why do I have to put the “template” and “typename” keywords?

In order to parse a C++ program, the compiler needs to know whether certain names are types or not. The following example demonstrates that:

t * f;

How should this be parsed? For many languages a compiler doesn't need to know the meaning of a name in order to parse and basically know what action a line of code does...

The Power of Hidden Friends in C++--Anthony Williams

Did you know about them?

The Power of Hidden Friends in C++

by Anthony Williams

From the article:

"Friendship" in C++ is commonly thought of as a means of allowing non-member functions and other classes to access the private data of a class. This might be done to allow symmetric conversions on non-member comparison operators, or allow a factory class exclusive access to the constructor of a class, or any number of things.

However, this is not the only use of friendship in C++, as there is an additional property to declaring a function or function template a friend: the friend function is now available to be found via Argument-Dependent Lookup (ADL). This is what makes operator overloading work with classes in different namespaces...

"Allegro" Means Both Fast and Happy. Coincidence? - Andrei Alexandrescu

The Italian C++ Conference 2019 keynote:

"Allegro" Means Both Fast and Happy. Coincidence?

by Andrei Alexandrescu

About the video:

Sorting and searching. Two fundamental tasks in Computer Science, and definitely among the most studied. Efficient algorithms for sorting and searching are now taught in core undergraduate classes. Are they at their best, or is there more blood to squeeze from that stone? This talk will explore a few less known – but more allegro! – variants of classic algorithms.

Kadane in next-gen C++--Marco Arena

A new interpretation of a classical problem:

Kadane in next-gen C++

by Marco Arena

From the article:

We, programmers, get better results while thinking in patterns. We decompose complex problems in combinations of simpler patterns. However, many problems cannot be solved with known patterns. Here is where creativity kicks in...

Handling errors is canceling operations--Andrzej Krzemieński

Understand why it is done that way.

Handling errors is canceling operations

by Andrzej Krzemieński

From the article:

I actually covered this topic before, in this post, but given my recent experience I feel it needs reiterating and a bit of restructuring. It boils down to the observation that any error handling I have encountered — be it error codes, errno, exceptions, error monad — is about canceling operations that depend, directly or indirectly, on the function that reported failure. This has some consequences on how we look at our program flow and what principles we should follow when responding to failures in our programs...

Submit your talk to Meeting C++ 2019!

The call for submissions is open for Meeting C++ 2019!

New speakers are welcome to submit as there is a dedicated track for this, start speaking at Meeting C++!

Submit your talk to Meeting C++ 2019!

by Jens Weller

From the article:

When Meeting C++ 2019 was announced in the begin of April, there was already a hint that you could submit your talks. And so far a few have done so. Now its time for an official news entry. Submit your talk to Meeting C++ 2019! This year its the 8th edition of Meeting C++!

Speaking at Meeting C++ is a fun experience, you get to attend the speakers dinner, attend the full conference for free and enjoy the luxurious Hotelrooms the Andels offers from Wednesday to Saturday! You can look at last years schedule to get a feel for what your competition might talk about, but have in mind that you don't see the talks that were not submitted! If you want to talk about a C++ topic that wasn't covered yet, or have a unique idea for your talk, please submit! Speakers don't need to buy a ticket and the conference has a contingent of rooms available for speakers & staff.