Follow up: resize + assign is often faster than reserve + emplace_back for vector

published at 05.03.2026 15:34 by Jens Weller
Save to Instapaper Pocket

Last week I've posted about some test code to explore the question if resize + assign is faster than reserve + emplace_back.

Is resize + assign faster then reserve + emplace_back for vector?

published at 26.02.2026 18:06 by Jens Weller
Save to Instapaper Pocket

This question I've been asked by Farid Mehrabi on LinkedIn. And after quickly coming up with two tests for this on quick-bench, I've got interesting results with you to share!

Atomics in C++26?

published at 04.12.2025 18:05 by Jens Weller
Save to Instapaper Pocket

Did you know there is an C++26 addition to <atomic>?

Binary Trees: using unique_ptr

published at 20.11.2025 22:38 by Jens Weller
Save to Instapaper Pocket

Recently I've looked at binary trees, comparing a bare pointer version with new/delete against a binary tree that stores its nodes into a vector and uses indexes instead of pointers.

Looking at binary trees in C++

published at 22.10.2025 13:55 by Jens Weller
Save to Instapaper Pocket

I'm in the process of preparing a quick talk on trees in C++ for Meeting C++ 2025. In order to see what the web offers, I've searched exactly for this, "trees in C++".

More Blog entries