"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.

Meeting C++ 2019: vote on the talks!

See which talks have been submitted, and help to decide which make it to the conference:

The voting on which talks should make it to Meeting C++ 2019 has begun

by Jens Weller

From the article:

With today, you can start to vote on all 120 submitted talks for Meeting C++ 2019!

With 120 talks submitted by 82 speakers, there is a lot to vote on. You don't have to vote on all talks, the order of talks is randomized, so as long as enough folks vote on a few talks, every talk should get a fair number of votes. You can vote for every talk between 0 - 5, where 5 is the best vote you can give. Also its possible to leave a comment and feedback for the speaker. The deadline to cast your votes is the last day of June.

CopperSpice: C++ ISO Standard

New video on the CopperSpice YouTube Channel:

C++ ISO Standard

by Barbara Geller and Ansel Sermersheim

About the video:

This was an interesting video for us since it covers how the C++ Standard is developed and the ISO process. We encourage everyone to watch this video and hope you gain an appreciation as we discovered for the work the committee members do on our behalf.

Please take a look and remember to subscribe!

Generic Interfaces with Generic Lambdas using C++ for SYCL—Georgi Mirazchiyski

This blog post offers a generic description of using lambdas in C++ and how it's possible to use them with SYCL, an open standard interface for programming heterogeneous hardware using C++.

Generic Interfaces with Generic Lambdas using C++ for SYCL

by Georgi Mirazchiyski

From the article:

C++ Lambdas, first introduced in C++11, are an important part of the way that the SYCL standard is defined and implemented. SYCL is required to handle different types and pass around functions so lambdas are a good fit allowing anonymous function objects to be passed to SYCL kernels. We talk about how we use lambdas in our guides and documentation, but never about how lambdas work or even how to use them in SYCL, so in this blog post we will examine how they can be used in SYCL.

CppCast Episode 201: Pattern Matching with Michael Park

Episode 201 of CppCast the first podcast for C++ developers by C++ developers. In this episode Rob and Jason are joined by Michael Park to discuss his Pattern Matching library and standards proposal.

CppCast Episode 201: Pattern Matching with Michael Park

by Rob Irving and Jason Turner

About the interviewee:

Michael Park is a software engineer at Facebook, working on the C++ libraries and standards team. His focus for C++ is to introduce pattern matching to facilitate better code.

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...

Quick Q: Differences between std::make_unique and std::unique_ptr with new

Quick A: mostly for exception safety.

Recently on SO:

Differences between std::make_unique and std::unique_ptr with new

The motivation behind make_unique is primarily two-fold:

make_unique is safe for creating temporaries, whereas with explicit use of new you have to remember the rule about not using unnamed temporaries.

foo(make_unique<T>(), make_unique<U>()); // exception safe

foo(unique_ptr<T>(new T()), unique_ptr<U>(new U())); // unsafe*

The addition of make_unique finally means we can tell people to 'never' use new rather than the previous rule to "'never' use new except when you make a unique_ptr".

There's also a third reason:

make_unique does not require redundant type usage. unique_ptr<T>(new T()) -> make_unique<T>()

None of the reasons involve improving runtime efficiency the way using make_shared does (due to avoiding a second allocation, at the cost of potentially higher peak memory usage).

Quick Q: With arrays, why is it the case that a[5] == 5[a]?

Quick A: See below

Recently on SO:

With arrays, why is it the case that a[5] == 5[a]?

The C standard defines the [] operator as follows:

a[b] == *(a + b)

Therefore a[5] will evaluate to:

*(a + 5)

and 5[a] will evaluate to:

*(5 + a)

a is a pointer to the first element of the array. a[5] is the value that's 5 elements further from a, which is the same as *(a + 5), and from elementary school math we know those are equal (addition is commutative).