July 2019

Why Static Analysis Can Improve a Complex C++ Codebase

Gradually and imperceptibly we get the situation when C++ projects’ complexity becomes extreme. Unfortunately, now a C++ programmer can’t be on his own.

Why Static Analysis Can Improve a Complex C++ Codebase

by Andrey Karpov

From the article:

Analyzers know more than even professional developers. It has become too difficult to take into account and remember all the nuances when writing code. For instance, if you haven’t specifically read about it, you’ll never guess that calls to memset function for clearing private data sometimes disappear, as from a compiler’s point of view, a call to memset function is redundant. Meanwhile, it is a serious security defect CWE-14 that is detected literally everywhere.

Comparisons in C++20--Barry Revzin

Get familiar with it, it's coming and it's going to help you!

Comparisons in C++20

by Barry Revzin

From the article:

Now that the Cologne meeting is over and we’ve more or less finalized (at least before the NB comments come in) C++20, I wanted to take the time to describe in detail one of the new language features we can look forward to. The feature is typically referred to as operator<=> (defined in the language as “three-way comparison operator” but more colloquially referred to as “operator spaceship”), but I think it has broader scope than that.

We’re not just getting a new operator, we’re significantly changing the semantics of how comparisons work at a language level...

Trip Report: C++ Standards Meeting in Cologne, July 2019--Botond Ballo

Lots happened!

Trip Report: C++ Standards Meeting in Cologne, July 2019

by Botond Ballo

From the article:

Last week I attended a meeting of the ISO C++ Standards Committee (also known as WG21) in Cologne, Germany. This was the second committee meeting in 2019; you can find my reports on preceding meetings here (February 2019, Kona) and here (November 2018, San Diego), and previous ones linked from those. These reports, particularly the Kona one, provide useful context for this post...

Secure Coding in C/C++ with Robert C. Seacord of NCC Group

In episode 35 of The Secure Developer with Robert C. Seacord of NCC Group

 

Secure Coding in C/C++

with Robert C. Seacord of NCC Group

 

In episode 35 of The Secure Developer, Guy is joined by Robert C. Seacord of NCC Group, who champions the continued practice of coding security in C and C++, and offers practical advantages to using various programming languages in the Agile era.

CLion 2019.2 has landed with more support for Embedded Dev, MSVC debugger, Unused Includes, and more

This year's second major update, CLion 2019.2, has just landed!

CLion 2019.2 has landed with new functionality for Embedded Developers, experimental MSVC debugger, updated Unused Includes check, parameter hints, and much more

by Anastasia Kazakova

From the article:

  • For Embedded developers:
    • On-Chip debugging with GDB Server
    • A Peripheral View for ARM Devices
  • In the debugger:
    • Completion for GDB/LLDB commands
    • On-the-fly detection of pending, resolved, and invalid line breakpoints
    • An experimental debugger for the Microsoft Visual C++ toolchain
    • Go to address and ASCII view in Memory View
  • In the editor:
    • The 'Unused Includes' check is back and now more accurate
    • Updated Clang-Tidy brings a set of new checks to CLion
    • Parameter Name Hints added to make your code easier to read
    • Code assistance in ClangFormat config files
  • Performance improvements
  • Syntax highlighting for over 20 new languages
  • Updates to naming convention settings, bundled Shell Script plugin, and VCS support

Advanced Modern C++ Training -- Peter Gottschling

Next open trainings in September and December:

Advanced Modern C++ Training

by Peter Gottschling

About the training

Mastering C++ is an intriguing challenge that can be utterly satisfactory. This complex, multi-paradigm language allows us to write software of highest performance with well-structured and smoothly growing programs. The power of C++ was tremendously raised with the new features of C++11 and C++14 such as type deduction, lambdas, rvalues, initializer lists – to name only a few. And C++17 adds some more interesting feature like folding and structured binding.

To tackle this challenge, we offer this intensive training mainly based on our trainer's book “Discovering modern C++”. You will see, discuss, and apply a wide spectrum of advanced features and dive into the world of modern C++ programming. Open courses are four days long and inhouse training is available from three to five days.

About the trainer:

Peter Gottschling is the author of the advanced C++14 book “Discovering Modern C++” and the German C++17 book “Forschung mit modernem C++”, the Matrix Template Library 4, co-author of the Boost Graph Library and other scientific libraries. He is vice-chair of DIN’s programming language committee and was (the last) head of the German delegation in the ISO committee for C++ standardization. He is managing director of SimuNova and taught C++ in numerous profesional trainings and academic courses.

When:

09-16-2019 to 09-19-2019 in English

12-02-2019 to 12-05-2019 in German

Dates for next year will be posted soon.

Where: Leipzig

 

How To Detect Function Overloads in C++17, std::from_chars Example

How to check if a function can be invoked? SFINAE? if constexpr?<img alt="" data-cke-saved-src="https://3.bp.blogspot.com/-LPhyXKA1CT8/XSQ-b9BNhgI/AAAAAAAAD2w/ooIxhAR8Q3wmu7xqq2-CTsU8bVLnGWvvACLcBGAs/s1600/funcoverload.png" src="https://3.bp.blogspot.com/-LPhyXKA1CT8/XSQ-b9BNhgI/AAAAAAAAD2w/ooIxhAR8Q3wmu7xqq2-CTsU8bVLnGWvvACLcBGAs/s1600/funcoverload.png" 300px;="" height:="" 96px;="" float:="" right;"="" style="height: 74px; width: 230px; float: right;">

How To Detect Function Overloads in C++17, std::from_chars Example

by Bartlomiej Filipek

From the article:

Working with real examples is better in most of the cases, so I like that we could show how the detection pattern works on a real function: std::from_chars. The full check used various of techniques: SFINAE, void_t, decltype, std::declval, std::true_type, std::false_type and partial template specialisation. Plus we even used if constexpr!

What Every C++ Developer Should Know to (Correctly) Define Global Constants--Jonathan Boccara

C++17 to the rescue.

What Every C++ Developer Should Know to (Correctly) Define Global Constants

by Jonathan Boccara

From the article:

Constant values are an everyday tool to make code more expressive, by putting names over values.

For example, instead of writing 10 you can write MaxNbDisplayedLines to clarify your intentions in code, with MaxNbDisplayedLines being a constant defined as being equal to 10.

Even though defining constants is such a basic tool to write clear code, their definition in C++ can be tricky and lead to surprising (and even, undefined) behaviour, in particular when making a constant accessible to several files.

Everything in this article also applies to global variables as well as global constants, but global variables are a bad practice contrary to global constants, and we should avoid using them in the first place...