C++ 17 Features
In my last C++ summary (for 2016) I wrote that the draft for C++17 is the most important thing that happened. I’ve put a list of features of the new standard, and today I’d like to expand the topic so...
View ArticleConst, 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...
View ArticleHow 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...
View ArticleModernize: 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...
View ArticleOn 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...
View ArticleC++ 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...
View ArticleWindows File Tests
You want to transform one file into another, input into output. What API will you choose on Windows? WinApi? C++ Streams or good old stdio?Last year in September I looked at four ways of processing a...
View ArticleC++18 Next Year!
I have a great news! During the last meeting in Kona, the committee not only made final notes on the C++17 standard! There’s also a groundbreaking news that behind the curtains they planned...
View ArticleC++18, Why not?
As you’ve might already notice I’ve made a little joke on Saturday, which was the April Fools’ Day. I got the courage to announce C++18 next year! :) While it was a bit funny, I didn’t expect much...
View ArticleBeautiful code: final_act from GLS
Sometimes there’s a need to invoke a special action at the end of the scope: it could be a resource releasing code, flag set, code guard, begin/end function calls, etc. Recently, I’ve found a beautiful...
View Articlefinal_act - follow-up
Last time I wrote about final_act utility, and it seems I’ve opened a bit bigger box that I’ve previously assumed. Let’s continue with the topic and try to understand some of the problems that were...
View ArticlePacking Bools, Performance tests
Imagine you have an array of booleans (or an array of ‘conditions’), and you want to pack it - so you use only one bit per boolean. How to do it? Let’s do some experiments!MotivationThe...
View ArticlePacking bools, Parallel and More
Let’s continue with the topic of packing boolean arrays into bits. Last time I’ve shown a basic - single threaded version of this ‘super’ advanced algorithm. By using more independent variables, we...
View ArticleCurious case of branch performance
When doing my last performance tests for bool packing, I got strange results sometimes. It appeared that one constant generated different results than the other. Why was that? Let’s have a quick look...
View ArticlePlease stop with performance optimizations!
As you might notice from reading this blog, I love doing performance optimizations. Let’s take some algorithm or some part of the app, understand it and then improve, so it works 5x… or 100x faster!...
View ArticleEnhancing Visual Studio with Visual Assist
How does your typical coding session in Visual Studio look like? What’s the first thing you do when you’re about to start coding?Yes… let’s check Gmail, Youtube, Reddit, etc… :)OK, please be more...
View ArticleC++17 in details: fixes and deprecation
The new C++ Standard - C++17 - is near the end to be accepted and published. There’s already a working draft, and not that long ago it went to the final ISO balloting. It’s a good occasion to learn and...
View ArticleC++17 in details: language clarfications
The second part of my series about C++17 details. Today I’d like to focus on features that clarify some tricky parts of the language. For example copy elision and expression evaluation order.IntroThe...
View ArticleModern C++ Programming Cookbook Review
Since May 2017 we got one more book about Modern C++! A Few weeks ago I got a copy from Packt Publishing, and today I’d like to write a few words about the book. In short: it’s a very good book! :)But...
View ArticleC++17 in details: Templates
For C++17 everyone wanted to have concepts, and as you know, we didn't get them. But does it mean C++17 doesn’t improve templates/template meta-programming? Far from that! In my opinion, we get...
View Article