/images/p1.jpg

Hi, I'm Tomasz

I'm a professional C++ software engineer with over a decade of hands on development experience with variety of technologies (mostly Linux & embedded systems). This is my blog.

Find me on social media

Quickest way to learn is to be inquisitive about everything!

It starts with “how?” std::variant is a new addition to C++ standard library adopted from ominous boost libraries. Just as a reminder, std::variant is a type safe union with a very cool visitor interface, thanks to which handling its state is very convenient. The type itself wouldn’t be very special to me until I stumbled upon this sentence on cppreference As with unions, if a variant holds a value of some object type T, the object representation of T is allocated directly within the object representation of the variant itself.

Interview question: merging intervals

Let’s write a calendar app Recently I stumbled upon a very common interview question (I think it can be found both in AlgoExpert database as explained in this mock interview) and CoderPad examples database. The gist of the problem is that you’re asked to write a calendar app, which given two calendars will return a list of free time slots between the two. Each calendar is a list of meetings.

C++11's user defined literals are super cool!

What are user defined literals? This is a small feature added with c++11 revision which I think is super fancy. In short, you can define your own unit system when declaring variables and each literal’s value, prior to its usage will be put through the operator appropriate to the types and suffixes used. cppreference page describes everything in great details. This sounds a bit unclear but the examples will summarise everything, I promise.

Testing in golang with "Is" framework

Today’s post is gonna be a short one. I’d like to recommend a framework which I used personally on a number of occasions. Golang comes with a great environment and a set of tools. Tests are first class citizens. Why would you need additional framework for your tests then? Purely for convenience. is API is is a mini framework, at the moment of writing this post, the API is comprised of four functions:

Standard algorithms and execution policies

What are execution policies? C++17 has brought some interesting additions to STL algorithms. One of which are execution policies. This is a set of tags that some STL algorithms accept as first argument (there’s an additional overload provided), instructing how container elements will be accessed and processed. C++17 added three distinct execution policies and one more came along with C++20. As of now, the list contains the following: class sequenced_policy, class parallel_policy, class parallel_unsequenced_policy, class unsequenced_policy.

Why CMake sucks?

CMake has become a de facto industry standard as a natural ancestor superseding autotools. But is it actually an improvement? Personally, after spending signifficant amount of time with CMake projects, I’m inclined to conclude that no, not really. Below, I present why CMake sucks and why you shouldn’t use it for any of your projects. Just as a disclaimer, I’m presenting my personal views here, which are very subjective. You’re entitled to have your own opinions.

Interview question that became a meme

How to reverse a linked list? Yep! This headline says it all. For some reason, for quite a while, this was (hopefully it’s no longer) a very popular problem given during technical interviews. Why that might be? Probably because it’s a simple problem to solve, interviewers don’t have to prepare themselves to use it and it has a couple of solutions so, it’s a good conversation starter about algorithms and performance in regards to time & space complexity.