/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

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.

Better worker threads with c++23 cooperative thread interruption

In this post, I’m gonna discuss how C++23 helps to write better worker threads and saves you the effort to manually manage thread termination. What are worker threads? I’m sure that every one has written a worker thread one time or another and it’s impossible not to find (at least) one in any bigger code base. Usually, worker threads are responsible for performing background tasks, like doing some calculations in an asynchronous manner, performing network downloads, job dispatchers, IPC message brokers etc.

My C++ setup for personal projects

Here’s a quick overview of my repo setup for any new C++ projects that I create. I’m gonna start with an empty repo and bring it up to an initial stage where all my preferred tooling is available and ready. Empty repo scaffolding Here’s the link to the repo, if you’re not interested in the walk through. Build system Starting with an empty git repo, first thing I like to do is just to create main.

#2 WebAssembly and C++: Standalone programming - fun with graphics

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.

#1 WebAssembly and C++: Baby steps

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.

Generative AI can code! What are you going to do about it?

I’m sharing my thoughts on generative AI and how it potentially affects lives of software engineers. This one is gonna be a bit different. I hesitated to write this post. This blog is rather small with a narrow scope of topics and I definitely don’t dabble in non-technical writing. I also don’t like to follow the click-baity fad - which is definitely happening around AI now. Recently, approximately 1/3 of hacker news topics is related to AI and ChatGPT in one way or another.