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
Why? Well, it kind of happened by accident, if I’m honest. While working on a different project, where I’m building a set of utilities (assembler, disassembler, debugger, simulator) for a custom programming language, I needed a parser to create some basic CLI interfaces. I wanted to limit the amount of dependencies and thus didn’t want to reach for Boost’s program_options. Another reason is that I don’t really like it that much.
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.
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.
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.
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:
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.
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.