Articles & Books

fixing c++ with epochs -- Vittorio Romeo

This article covers a possible mechanism that would allow the C++ committee to make breaking changes to the language syntax while still fully preserving backwards compatibility. This would allow dangerous or obsolete constructs to be removed from C++, increasing safety and approachability of the language.

fixing c++ with epochs

by Vittorio Romeo

From the article:

Imagine that you have been designing a programming language for over 30 years and that it gradually became widely used across the globe. Some of the decisions you made at the beginning were excellent and contributed to the success of your project. Some others, however, were not the best: over the years you and your users realized that the world would have been a better place if those choices you made eons ago were slightly different. [...]

What if I told you that I could fix all of your problems? Even better, what if I told you that backward-compatibility will never be broken and that migration to newer versions of your language could be automated?

C++17 In Detail - Available in Print!

Another book available in Print that describes C++17 features!

See the article that shows more about this release:

C++17 In Detail - Print Version!

by Bartlomiej Filipek

About the book:

C++17 is a major update to the language and brings many exciting additions and improvements that will change your pre for the better. This book shows you all of the significant changes in the new Standard.

I spent hundreds of hours investigating how the new features work to ensure this book is helpful and practical. It will not only save you time but will guide you through lots of nuances of the language and the Standard Library.

If you have experience with C++11/14 and you want to advance to the latest C++ Standard, then pick up the book and start reading.

 

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.

New new() - The C++17's Alignment Parameter for the operator new() -- Bartlomiej Filipek

C++17's new and handy new operator that supports overaligned objects!

New new() - The C++17's Alignment Parameter for Operator new()

by Bartlomiej Filipek

From the article:

The whole deal about the new functionality is that you can forgot about the limitation of over-aligned data. It lets you write regular modern C++ code without worrying about specialized allocators or raw memory handling functions like std::aligned_alloc() or _aligned_malloc().

Back to Basics at CppCon 2019

It started!

Back to Basics at CppCon 2019

by Arthur O’Dwyer

From the article:

Tomorrow I’ll be flying out to Denver, Colorado, for CppCon 2019. This will be my busiest CppCon yet! Besides giving my “STL From Scratch” weekend course for the third year in a row, this year I’m also the chair of CppCon’s new “Back to Basics” track...

C++ Core Guidelines: Profiles--Rainer Grimm

To continue in the next one.

C++ Core Guidelines: Profiles

by Rainer Grimm

From the article:

Informally, profiles are a subset of rules of the C++ core guidelines for specific concerns such as type safety, bounds safety, and lifetime safety. Thanks to the guideline support library, they can be checked...

Cppcon-Tool Time 2019--Jon Kalb

Will you attend?

Tool Time 2019

by Jon Kalb

From the article:

Similar to tech labs at some other events, we’re offering the opportunity for anyone, from an author/creator, to a vendor, to a super-user, to represent a tool (app, library, framework, or service) and run their own table answering questions or showing demos...

C++17 - The Complete Guide now complete and available -- Nicolai M. Josuttis

A new the latest book by Nicolai M. Josuttis is now complete and available.

C++17 - The Complete Guide

by Nicolai M. Josuttis

About the book:

The book is a full description of all language and library features that were introduced and modified with C++17.

It contains plenty of examples and many hints from using these new features in practice.

It is availble at your local book store or here.