May 2019

CppCast Episode 200: Simplifying C++ with Herb Sutter

Episode 200 of CppCast the first podcast for C++ developers by C++ developers. In this episode Rob and Jason are joined by ISO chair Herb Sutter to discuss C++20 and his goal of simplifying the C++ of the future.

CppCast Episode 200: Simplifying C++ with Herb Sutter

by Rob Irving and Jason Turner

About the interviewee:

Herb Sutter is an author, chair of the ISO C++ committee, and a systems languages architect at Microsoft.

strong_typedef - Create distinct types for distinct purposes--Anthony Williams

A common problem with a common solution made easier.

strong_typedef - Create distinct types for distinct purposes

by Anthony Williams

From the article:

One common problem in C++ code is the use of simple types for many things: a std::string might be a filename, a person's name, a SQL query string or a piece of JSON; an int could be a count, an index, an ID number, or even a file handle. In his 1999 book "Refactoring" (which has a second edition as of January 2019), Martin Fowler called this phenomenon "Primitive Obsession", and recommended that we use dedicated classes for each purpose rather than built-in or library types...

Heterogeneous Lookup in Ordered Containers, C++14 Feature--Bartlomiej Filipek

Did you know?

Heterogeneous Lookup in Ordered Containers, C++14 Feature

by Bartlomiej Filipek

From the article: 

If you have a map of strings, like std::map<std::string, int> m; and you want to find some element by m.find("abc"). Do you have to pay the price and construct a std::string object? Can you optimize it?

Let’s have a look at one feature enabled in C++14 that might help optimize such container access...

Quick Q: When should I make explicit use of the `this` pointer?

Quick A: to disambiguate.

Recently on SO:

When should I make explicit use of the `this` pointer?

Usually, you do not have to, this-> is implied.

Sometimes, there is a name ambiguity, where it can be used to disambiguate class members and local variables. However, here is a completely different case where this-> is explicitly required.

Consider the following code:

template<class T>
struct A {
   int i;
};

template<class T>
struct B : A<T> {

    int foo() {
        return this->i;
    }

};

int main() {
    B<int> b;
    b.foo();
}

If you omit this->, the compiler does not know how to treat i, since it may or may not exist in all instantiations of A. In order to tell it that i is indeed a member of A<T>, for any T, the this-> prefix is required.

Note: it is possible to still omit this-> prefix by using:

template<class T>
struct B : A<T> {

    using A<T>::i; // explicitly refer to a variable in the base class

    int foo() {
        return i; // i is now known to exist
    }

};

Core C++ 2019 Trip Report--Anastasia Kazakova

It's trip report time!

Core C++ 2019 Trip Report

by Anastasia Kazakova

From the article:

More and more C++ events, community meetups, and conferences are appearing around the globe. 2019 is definitely looking like a year for new C++ conferences. Take, for example, C++ on Sea (UK, in February) or the upcoming CPPP (France, in June). Even C++ Russia now has two editions per year – one in Moscow and one in St. Petersburg. And, finally, there’s the event we just visited – Core C++, held in Tel Aviv, Israel...

CppCast Episode 199: Constexpr Evaluation with Daveed Vandevoorde

Episode 199 of CppCast the first podcast for C++ developers by C++ developers. In this episode Rob and Jason are joined by Daveed Vandevoorde to discuss his contributions to the C++ standard and his recent work on constexpr evaluation.

CppCast Episode 199: Constexpr Evaluation with Daveed Vandevoorde

by Rob Irving and Jason Turner

About the interviewee:

David ("Daveed") Vandevoorde is a Belgian computer scientist who lives near Princeton, NJ, USA. He is vice-president of engineering at the Edison Design Group (EDG), where he contributes primarily to the implementation of their C++ compiler front end. He is an active member of the C++ standardization committee where he is primarily active in the core language evolution work. His recent work in that context has primarily been about extending the capabilities of “constexpr evaluation”. Daveed is also one of the five members of the committee’s “direction group”. He is the primary author of the well-regarded “C++ Templates: A Complete Guide” (now available in its second edition).

ACCU 2019 Autumn Conference - Call for Proposals Open -- ACCU

The Call for Proposals for the ACCU Autumn 2019 Conference to be held 2019-11-11 to 2019-11-12 at Hilton Hotel in Belfast is now open.

Call for Proposals

by ACCU

About the conference:

The call for proposals is open until 2019-06-16.

This conference abuts the WG21 committee meeting so expect lots of C++ folk to be around.

HPX V1.3 released -- STE||AR Group

The STE||AR Group has released V1.3 of HPX -- A C++ Standard library for parallelism and concurrency.

HPX V1.3 Released

The newest version of HPX (V1.3) is now available for download! This release focuses on performance and stability improvements. Please see here for the full release notes.

    HPX is a general purpose parallel C++ runtime system for applications of any scale. It implements all of the related facilities as defined by the C++ Standard. As of this writing, HPX provides the only widely available open-source implementation of the new C++17 parallel algorithms. Additionally, HPX implements functionalities proposed as part of the ongoing C++ standardization process, such as large parts of the C++ Concurrency TS, Parallelism TS V2, data-parallel algorithms, executors, and many more. It also extends the existing C++ Standard APIs to the distributed case (e.g. compute clusters) and for heterogeneous systems (e.g. GPUs).

    HPX seamlessly enables a new Asynchronous C++ Standard Programming Model that tends to improve the parallel efficiency of our applications and helps reducing complexities usually associated with parellism and concurrency.