C++17 in details: language clarifications

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. Intro You all know this… C++ is a very complex language, and some (or most? :)) parts are quite confusing.

READ MORE...

C++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 understand what are the new features. Let’s start slowly, and today we’ll look at language/library fixes and removed elements.

READ MORE...

Enhancing 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 professional! So, let’s assume my Visual Studio (2013, 2015 or 2017) is already started. What to do next?

READ MORE...

Please 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! Doesn’t that sound awesome? I hope that you answered “Yes” to the question in the introduction.

READ MORE...

Curious 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 at branching performance. The problem Just to recall (first part, second part) I wanted to pack eight booleans (results of a condition) into one byte, 1 bit per condition result.

READ MORE...

Packing 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 could speed things up and go even faster than no packing version! We’ve also used std::vector and std::bitset.

READ MORE...

Packing 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! Updated: 8th May 2017 Read the second part here and also one update. Motivation I started writing this post because I came across a similar problem during my work some time ago.

READ MORE...

final_act - follow-up

Last time I wrote about final_act utility, and it seems I’ve stepped into a bigger area that I wasn’t aware of. Let’s continue with the topic and try to understand some of the problems that were mentioned in the comments. Intro Let’s remind what was the case last time:

READ MORE...

Beautiful code: final_act from GSL

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 utility that helps in that cases. Let’s meet gsl::final_act/finally. Intro Follow-up post here: link.

READ MORE...

C++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 traffic (as it was Saturday). Still, my stats shows that a lot of people clicked and viewed the post.

READ MORE...

C++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 C++18! Disclaimer/Note: this was just an April Fool’s joke! :). Please read the follow-up here! Intro As it appears, the C++ Cometee finally understood that C++17 doesn’t contain the features everyone wanted.

READ MORE...

Windows 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 file on Windows. Also, I did some performance tests. The whole project description was recently published in Visual Studio Magazine.

READ MORE...