January 2018

Pimpl vs Abstract Interface - a practical tutorial—Bartlomiej Filipek

In the article we describe how to limit compilation dependencies. Two methods are discussed: pimpl approach and via abstract interfaces

Pimpl vs Abstract Interface - a practical tutorial

by Bartlomiej Filipek

From the article:

In the post I covered the pimpl pattern. I discussed the basic structure, extensions, pros and cons and alternatives. Still, the post might sound a bit “theoretical”. Today I’d like to describe a practical usage of the pattern. Rather than inventing artificial names like MyClass and MyClassImpl you’ll see something more realistic: like FileCompressor or ICompressionMethod.

Spectre mitigations in MSVC—Andrew Pardoe

If you are a developer whose code operates on data that crosses a trust boundary then you should consider recompiling your code with the /Qspectre switch:

Spectre mitigations in MSVC

by Andrew Pardoe

From the article:

Microsoft is aware of a new publicly disclosed class of vulnerabilities, called “speculative execution side-channel attacks,” that affect many operating systems and modern processors, including processors from Intel, AMD, and ARM...

CopperSpice: Templates and Open Source

New videos on the CopperSpice YouTube Channel:

C++ Templates in the real world

by Barbara Geller and Ansel Sermersheim

About the video:

Template techniques for accomplishing real world tasks in C++, including some not taught in textbooks. We also present an example of avoiding circular dependencies in template definitions.

Copyright Copyleft

by Barbara Geller and Ansel Sermersheim

About the video:

A practical and acessible look at some common open source licenses. If you write, read, or use software this is important material.

Please take a look and remember to subscribe!

Slides of the 9th of January 2018 BeCPP Meeting—Marc Gregoire

BeCPP_Logo_282x64.pngOn January 9th 2018, the Belgian C++ Users Group had their next event sponsored by Barco.

Slides of the 9th of January 2018 BeCPP Meeting

About the event:

This was our users group biggest event ever. We had around 140 attendees!
Here are the presentations:

  • "Threads are evil" (Frederik Vannoote)
  • "Legacy code refactoring case" (Roeland Van Lembergen)
  • "Boost.Asio C++ (Network) Programming" (Lieven de ####)

If you couldn’t attend the event in person, or if you would like to go over the material again, you can download them from the BeCPP website.

PVS-Studio 6.21 release: support for CWE (Common Weakness Enumeration) was added

PVS-Studio is a tool for bug detection in the source code of programs, written in C, C++, and C#. It works in Windows and Linux environment.

PVS-Studio 6.21 Release

by PVS-Studio Team

What's new:

  • Support for CWE (Common Weakness Enumeration) was added to C/C++/C# analyzers.
  • HTML log with source code navigation can now be saved from Visual Studio plug-ins and the Standalone tool.
  • WDK (Windows Driver Kit) projects for Visual Studio 2017 are now supported.
  • PVS-Studio plug-in for SonarQube was updated for the latest LTS version 6.7.
  • V1007. The value from the uninitialized optional is used. Probably it is a mistake.

CppCast Episode 133: Meltdown and Spectre with Matt Godbolt

Episode 133 of CppCast the only podcast for C++ developers by C++ developers. In this episode Rob and Jason are joined by Matt Godbolt to talk about the Meltdown and Spectre vulnerabilities and how they affect C++ Programmers.

CppCast Episode 133: Meltdown and Spectre with Matt Godbolt

by Rob Irving and Jason Turner

About the interviewee:

Matt is a developer at trading firm DRW. Before that he's worked at Google, run a C++ tools company, and spent over a decade in the games industry making PC and console games. He is fascinated by performance and created Compiler Explorer, to help understand how C++ code ends up looking to the processor. When not performance tuning C++ code he enjoys writing emulators for 8-bit computers in Javascript.

How a weak_ptr might prevent full memory cleanup of managed object—Bartlomiej Filipek

Tricky weak_ptr and shared_ptr interaction:<img alt="" data-cke-saved-src="https://2.bp.blogspot.com/-2XIQxeCUBFc/Wi2JGz_EcXI/AAAAAAAADNU/vEkN6ZtXR-Yon5YuZWBxk-6kjmHD1011ACLcBGAs/s1600/control_block.png" src="https://2.bp.blogspot.com/-2XIQxeCUBFc/Wi2JGz_EcXI/AAAAAAAADNU/vEkN6ZtXR-Yon5YuZWBxk-6kjmHD1011ACLcBGAs/s1600/control_block.png" right;"="" style="float: right; width: 230px; height: 199px;">

How a weak_ptr might prevent full memory cleanup of managed object

by Bartlomiej Filipek

From the article:

It appears that in some cases memory allocated for the object controlled by smart_ptr might not be released until all weak pointers are also ‘dead’.