News

Stricter Expression Evaluation Order in C++17--Bartlomiej Filipek

Do you know the rules?

Stricter Expression Evaluation Order in C++17

by Bartlomiej Filipek

From the article:

C++ has many dark corners and many caveats that can cause you to scratch your head in confusion. One of the issues we had until C++17 was the evaluation order of expressions. In this blog post, I’ll show you the new rules that we got in C++17 that made this complicated term much simpler and practical.

Here are the main points for today:

  • What’s the case with make_unique vs unique_ptr<T>(new T) in a function call.
  • What are the new rules for C++17?
  • Are all bugs fixed and now well defined?

Let’s go.

Bringing back the Meeting C++ employer listing

Relaunching another part of Meeting C++ recruiting: the employer listing.

Bringing back the Meeting C++ employer listing

by Jens Weller

From the article

Meeting C++ brings back the listing of C++ employers to its website as part of Meeting C++ recruiting. The companies will be visible in the listing it self, but also have their logos displayed in the job section next to every job advert posted to Meeting C++! Additionally, the companies are also listed in the CV/resume sharing form of Meeting C++.

CppCon 2020 Dealing with Embedded Limitations--Panel Discussion hosted by Ben Saks

Registration is now open for CppCon 2021, which starts on October 24 and will be held both in person and online. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from our most recent in-person conference in 2019 and our online conference in 2020. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2021 to attend in person, online, or both!

Dealing with Embedded Limitations

Panel Discussion hosted by Ben Saks

Summary of the talk:

Many embedded systems have requirements on latency, memory usage, and resource consumption. This is especially true of safety-critical and security-related systems. Many programmers and organizations worry that using C++ features will prevent them from meeting these requirements. Some avoid using specific features such as exception handling, while others avoid using C++ entirely.

This panel will discuss the challenges and benefits of using C++ in embedded contexts. We will explore ways that embedded systems can leverage the power of Modern C++ features to meet their guarantees. We will discuss which concerns are based in fact and which concerns are based on misconceptions.
Feel free to bring your own questions about anything that you believe inhibits your use of modern C++ on an embedded system. We will discuss pre-selected questions as well as audience submissions.

Boost Version 1.77.0 released

Are you going to update?

Boost Version 1.77.0 released

From the release:

New Libraries
A C++14 reflection library, from Peter Dimov. Provides macros for describing enumerators and struct/class members, and primitives for querying this information.
Lambda2:
A C++14, dependency-free, single header lambda library, from Peter Dimov. Allows simple function objects to be constructed via expressions such as _1 + 5, _1 % 2 == 0, _1 > _2, or _1 == ' ' || _1 == '\t'...

CppCon 2019 Some Programming Myths Revisited--Patrice Roy

Registration is now open for CppCon 2021, which starts on October 24 and will be held both in person and online. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from our most recent in-person conference in 2019 and our online conference in 2020. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2021 to attend in person, online, or both!

Some Programming Myths Revisited

by Patrice Roy

Summary of the talk:

We have been taught, or we ourselves have taught, things that we took for granted as being "good practice" in programming. Such things often stem from the "wisdom of the ancients" (although computer science being young as sciences come, some of the "ancients" are still among us and thriving today, and we're so lucky to have them!), and are in effect part of our "myths".

However, being as grounded in the science-that-there-was as these recommendations are, our ideas have evolved, so have our programming languages, and it can be interesting to revisit some of these taken-for-granted ideas.

In C++, particularly in what some call "modern C++", we find a language that is different enough from its forebears to make revisiting our "myths" interesting. How do such things as "goto considered harmful" or "only one return per function", for example, hold as "wisdom" with respect to modern C++? Do they still help us write better programs or should be rethink them under the light of modern languages and practice?

The aim of this talk is to examine what some commonly heard recommendations or advices with respect to programming practice mean in the context of "modern" C++. We will take a small set of such advices, present them in context, show how well (or how badly) they suit today's C++, and try to rephrase them if this seems advantageous.

Moving a project to C++ named Modules--Cameron DaCamara

If you can, start using them!

Moving a project to C++ named Modules

by Cameron DaCamara

From the article:

There is a lot of hype (and perhaps restraint) to using modules in projects. The general blocker tends to be build support, but even with good build support there is a distinct lack of useful resources for practices around moving projects to using named modules (not just header units). In this blog we will take a small project I created, analyze its components, draft up a plan for modularizing it, and execute that plan...

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

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

HPX V1.7.1 Released

The newest version of HPX (V1.7.1) is now available for download! This release fixes minor problems found after the version 1.7.0. It fixes a bug in the internals of actions, adds a version check to the new Asio dependency, and slightly improves the performance of spinlocks among other minor changes. Importantly, the experimental hpx::execution::simdpar execution policy introduced in 1.7.0 was renamed to hpx::execution::par_simd for consistency with the standard parallel execution policies. While this is a breaking change in a patch release, we felt it was important to make this adaptation as soon as possible. The full list of improvements, fixes, and breaking changes can be found in the 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 one of 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 features related parallelism and concurrency as specified by the upcoming C++20 Standard, the C++ Concurrency TS, Parallelism TS V2, data-parallel algorithms, executors, senders/receivers 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 parallelism and concurrency.

 

CppCon 2020 The Surprising Costs of void() (and Other Not-Quite-Innocuous Evils)--Patrice Roy

Registration is now open for CppCon 2021, which starts on October 24 and will be held both in person and online. To whet your appetite for this year’s conference, we’re posting videos of some of the top-rated talks from our most recent in-person conference in 2019 and our online conference in 2020. Here’s another CppCon talk video we hope you will enjoy – and why not register today for CppCon 2021 to attend in person, online, or both!

The Surprising Costs of void() (and Other Not-Quite-Innocuous Evils)

by Patrice Roy

Summary of the talk:

There are some things that might pass us by without us noticing them as evil or, as they have come to be known, Bad Code Smells.

Many of these little things are acceptable in some cases, and thus pass unnoticed in some code reviews. They are respectful of language rules, and thus pass unnoticed through the compiler's virtual hands. They might even lead to working code... and if it works, it's fine, no?

The idea for this talk came about when discussing with colleagues about such suspicious code and coding patterns, and hearing such questions as "but why is that a problem?". It's about those little evils that creep in code and poison our practice in subtle ways (making memory consumption higher than it should be, making execution slower than it should be, making reuse harder than it should be, etc.).

How to Parallelise CSV Reader - C++17 in Practice--Bartlomiej Filipek

Would do it the same way?

How to Parallelise CSV Reader - C++17 in Practice

by Bartlomiej Filipek

Friom the article:

At C++Stories (and in my C++17 book) you can find several articles on Parallel Algorithms introduced in C++17. The examples included in those posts were usually relatively straightforward. How about writing something larger?

In this text, you’ll see how to build a tool that works on CSV files, parses lines into sales records and then performs calculations on the data.

You’ll see how easy it is to add parallel execution to selected algorithms and have a performance improvement across the whole application (for example 4.5x on 6 cores, including file loading). In the end, we’ll discuss problems that we found along the way and possible future enhancements.

Here’s the plan:

  • How to build an application that loads CSV files
  • How to efficiently use parallel algorithms
  • How to use std::filesystem library to gather required files
  • How to use other C++17 library features like std::optional, conversion routines - std::from_chars and string_view
  • Where to add [[nodiscard]] and improve code readability

Let’s go...