C++ Jobs and Predictions

There are probably billions of lines of code written in C++ already. New code is being written every day. But will this trend continue? Will you be able to find a C++ job in five years? Let’s have a quick view. The Story This post was motivated by a recent video from J.

READ MORE...

On Toggle Parameters

I got very interested in one topic that recently appeared on on Andrzej’s Blog: Toggles in functions. I though that maybe is worth to express my opinion as a separate blog post. Please take a look. Intro As Andrzej wrote in the article the whole point is how to improve the code around functions like:

READ MORE...

Modernize: Sink Functions

One of the guidelines from Modern C++ is to avoid using raw new and delete. Instead, you should use a smart pointer, a container or other RAII object. Today I’d like to focus on so-called ‘sink functions’ that takes ownership of input parameters. How can we modernize code around such calls?

READ MORE...

How To Stay Sane with Modern C++

Have you seen my recent blog post with the list of C++17 features? Probably this is not the best measurement, but it got only ~30% of the average read (while other articles might get like 70, or even 90%). I am not complaining, the list is crazy and contains probably too many details of the new standard.

READ MORE...

Const, Move and RVO

C++ is a surprising language. Sometimes simple things are not that simple in practice. Last time I argued that in function bodies const should be used most of the time. But two cases were missed: when moving and when returning a value. Does const influence move and RVO? Intro Just to recall, we’re talking here about using const for variables inside function bodies.

READ MORE...

C++ 17 Features

This year we’ll get a new version of C++: C++17! In this mega long article I’ve built a list of all features of the new standard. Have a look and see what we get! Intro Language Features New auto rules for direct-list-initialization static_assert with no message typename in a template template parameter Removing trigraphs Nested namespace definition Attributes for namespaces and enumerators u8 character literals Allow constant evaluation for all non-type template arguments Fold Expressions Unary fold expressions and empty parameter packs Remove Deprecated Use of the register Keyword Remove Deprecated operator++(bool) Removing Deprecated Exception Specifications from C++17 Make exception specifications part of the type system Aggregate initialization of classes with base classes Lambda capture of *this Using attribute namespaces without repetition Dynamic memory allocation for over-aligned data __has_include in preprocessor conditionals Template argument deduction for class templates Non-type template parameters with auto type Guaranteed copy elision New specification for inheriting constructors (DR1941 et al) Direct-list-initialization of enumerations Stricter expression evaluation order constexpr lambda expressions Different begin and end types in range-based for [[fallthrough]] attribute [[nodiscard]] attribute [[maybe_unused]] attribute Ignore unknown attributes Pack expansions in using-declarations Structured Binding Declarations Hexadecimal floating-point literals init-statements for if and switch Inline variables DR: Matching of template template-arguments excludes compatible templates std::uncaught_exceptions() constexpr if-statements SFINAE Tag dispatching if constexpr Library Features Merged: The Library Fundamentals 1 TS (most parts) Removal of some deprecated types and functions, including std::auto_ptr, std::random_shuffle, and old function adaptors Merged: The Parallelism TS, a.

READ MORE...

C++ Status at the end of 2016

Another year and another C++ Status! It’s hard to believe, but it’s my fifth time I am writing this summary. And, as usually, C++ language is very alive. The biggest news for the year? Of course, it must be: the final draft for C++17!. What else have happened? See my full report below.

READ MORE...

2016 Blog Summary

Another year of blogging! Was it good or bad? What’s the plan now? What were the most popular posts? First of all, please answer those quick questions: Bartek’s Coding Blog in 2016 The Story Keeping things short I’d like to point out four major things that happened this year:

READ MORE...

Async Remote Book Review

As you might already know, I work remotely. That’s why I try to follow and read guidelines/articles that relate to that style of working. Recently, I got very curious when I saw a new book called “*Async Remote*” from the Arkency team. Let’s see what it offers. Warning: the book is not only about remote!

READ MORE...

Debugging Tips Extra stuff

In June I’ve listed 11 tips that can save your time when doing debugging. As it appears, the article wasn’t that horrible :) I got a chance to update the content, extend the text and publish it on Visual Studio Magazine! Instead of original 11, there are now 9 separate articles:

READ MORE...

Variadic Templates and a Factory Function

Variadic Templates from C++11 is probably not a feature that you use on a daily basis. But recently, I’ve come across one refactoring example where I’ve decided to give a try and apply variadics. Intro When I was doing some work in some old UI code I’ve noticed several similar lines of code that looked like that:

READ MORE...