/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

How to create your own cloud-init alpine image for Proxmox

Recently I’ve converted one of my old PCs into a Proxmox server. In case you don’t know, Proxmox is essentially a virtual machines management environment. I didn’t really know if I’ll find it useful, just wanted to experiment a bit and maybe learn about terraform. Since then, I’m finding my virtual machines server quite useful. I can run my own small kubernetes cluster (k3s), docker registry, VPN gateway… all sorts of things.

C++ quick tips: Deleted free functions

I’m sure that we all know about the = delete keyword introduced in c++11 and its application to class member functions. I’m not sure though if everyone knows that = delete can be applied to free standing functions as well. Free standing functions application Main reason to have this feature is to limit the number of overloads and narrow down implicit conversion. std::cref and std::ref are a good example. cppreference for std::ref lists several overloads.

#4 WebAssembly and C++: What's WASI and why do we need it?

This post is part of a WebAssembly series focused on WASM and C++. The goal is to gain a thorough understanding of how WebAssembly works, how to use it as a compilation target for C++ code and hopefully have fun along the way. So, stick with me for this exciting journey. Recap So far, in this series, we’ve learned what WASM is, how to execute it in JavaScript engines (like browsers or node.

Bidirectional mapping between enum values and types

Recently, while working with a glue code integrating low level C APIs in C++ I stumbled upon a problem where I needed to map enum values to types (and vice-versa). Problem definition Imagine you’ve got a factory function: 1 2 3 4 5 6 7 8 9 10 11 12 enum class FactoryTypes { TypeA, TypeB, TypeC, }; struct NonCovariantTypeA {}; struct NonCovariantTypeB {}; struct NonCovariantTypeC {}; // TODO what to return here?

Implementing basic type lists in C++

In this post I’m gonna implement a simple type list along with a set of basic operations that can be performed on it. Tuples? Isn’t it just a tuple? Not really, it’s something simpler than that. Tuple is a set of values of arbitrary types. Tuples are immutable as well (there’s std::tuple_cat with which operations like append and prepend could be implemented but this will result with a new instance of tuple with extended set of contents).

C++ quick tips: shared_ptr aliasing constructor

C++20 provides a small addition to shared_ptr constructor overloads set which is called an aliasing constructor. Quoting after cppreference: The aliasing constructor: constructs a shared_ptr which shares ownership information with the initial value of r, but holds an unrelated and unmanaged pointer ptr. If this shared_ptr is the last of the group to go out of scope, it will call the stored deleter for the object originally managed by r…

#3 WebAssembly and C++: Passing strings between C++ and Javascript

This post is part of a WebAssembly series focused on WASM and C++. The goal is to gain a thorough understanding of how WebAssembly works, how to use it as a compilation target for C++ code and hopefully have fun along the way. So, stick with me for this exciting journey. Wherever mentioned, working WASM examples will be embedded directly on the page. If your browser supports it, you should be able to see them running.