r/cpp • • Apr 08 '26

Optimize norm gathering asm in C++

Thumbnail blog.serenedb.com
25 Upvotes

We replaced SereneDB's AVX2 gather intrinsics with pure C++ and it actually beat intrinsics on x86_64.

The trick is combining сlang's auto-vectorization for dense data with #pragma unroll to let out-of-order execution handle sparse data. The post covers the assembly breakdown and some compiler traps that can make your code slower.

Happy to answer any questions below!

If you enjoy C++ systems optimization star us we appreciate your support!


r/cpp • • Apr 07 '26

Inside Boost.Container: comparing different deque implementations

67 Upvotes

I put together a comparison of std::deque internals across libc++, libstdc++, MSVC STL, and boost::container::deque (Boost 1.90). The article looks at the internal data structures, member layouts, sizeof(deque), and includes some benchmarks on common operations.

Boost 1.90 shipped a complete rewrite of its deque — the old SGI-derived layout was replaced with a more compact design (32 bytes vs the previous 80). The article digs into what changed, how the new implementation compares to the three standard library implementations, and how much block size alone affects performance across all of them.

https://boostedcpp.net/2026/03/30/deque/

Note: thanks to the info provided by u/HowardHinnant, I've update the article with additional info about the noexcept-ness of default and move constructors across implementations.


r/cpp • • Apr 07 '26

How to achieve P90 sub-microsecond latency in a C++ FIX engine

Thumbnail akinocal1.substack.com
68 Upvotes

r/cpp • • Apr 07 '26

Range-Validated Quantity Points - mp-units

Thumbnail mpusz.github.io
31 Upvotes

Physical units libraries have always been very good at preventing dimensional errors and unit mismatches. But there is a category of correctness that they have universally ignored: domain constraints on quantity point values.

A latitude is not just a length divided by a radius. It is a value that lives in [-90°, 90°]; anything outside that range is physically meaningless. An angle used in bearing navigation wraps cyclically around a circle; treating it as an unbounded real number ignores a fundamental property of the domain. A clinical body-temperature sensor should reject a reading of 44 °C at the API boundary, not silently pass it downstream.

No units library — before this work — has provided a way to attach this kind of constraint to a quantity point at the type level, have it enforced automatically, and express different flavors (clamp, wrap, reflect, check) without any runtime polymorphism.

This article describes the motivation in depth, the design we arrived at, and the open questions we would love the community's help to answer.


r/cpp • • Apr 07 '26

Latest News From Upcoming C++ Conferences (2026-04-07)

11 Upvotes

This is the latest news from upcoming C++ Conferences. You can review all of the news at https://programmingarchive.com/upcoming-conference-news/

TICKETS AVAILABLE TO PURCHASE

The following conferences currently have tickets available to purchase

OPEN CALL FOR SPEAKERS

There are currently no open calls.

OTHER OPEN CALLS

There are currently no open calls.

TRAINING COURSES AVAILABLE FOR PURCHASE

Conferences are offering the following training courses:

LAST CHANCE TO REGISTER

  1. Performance and Safety in C++ Crash Course - Jason Turner - 1 day online workshop available on Thursday 9th April 12:00 - 20:00 UTC - https://cpponline.uk/workshop/performance-and-safety-in-cpp-crash-course/ - £345/$460/€400 (£90/$120/€105 for students)
  2. Stop Thinking Like a Junior - The Soft Skills That Make You Senior - Sandor Dargo - Half Day online workshop available on Friday 10th April 13:00 - 16:30 UTC - https://cpponline.uk/workshop/stop-thinking-like-a-junior/ - £172.50/$230/€200 (£45/$60/€55 for students)
  3. Jumpstart to C++ in Audio - Learn Audio Programming & Create Your Own Music Plugin/App with the JUCE C++ Framework - Jan Wilczek - 1 day online workshop available on both Tuesday 14th April 13:00 - 20:00 UTC - https://cpponline.uk/workshop/jumpstart-to-cpp-in-audio/ - £150/$200/€175 (£90/$120/€105 for students)
  4. Essential GDB and Linux System Tools - Mike Shah - 1 day online workshop available on Friday 17th April 13:00 - 21:00 UTC - https://cpponline.uk/workshop/essential-gdb-and-linux-system-tools/ - £345/$460/€400 (£90/$120/€105 for students)

C++Online One Day Workshops - £345/$460/€400 (£90/$120/€105 for students)

  1. Performance and Safety in C++ Crash Course - Jason Turner - 1 day online workshop available on Thursday 9th April 12:00 - 20:00 UTC - https://cpponline.uk/workshop/performance-and-safety-in-cpp-crash-course/
  2. Essential GDB and Linux System Tools - Mike Shah - 1 day online workshop available on Friday 17th April 13:00 - 21:00 UTC - https://cpponline.uk/workshop/essential-gdb-and-linux-system-tools/
  3. Concurrency Tools in the C++ Standard Library - Mateusz Pusz - 1 day online workshop available on Friday 24th April 09:00 - 17:00 UTC - https://cpponline.uk/workshop/concurrency-tools-in-the-cpp-standard-library/
  4. C++ Software Design - Klaus Iglberger - 1 day online workshop available on Thursday 30th April 09:00 - 17:00 UTC - https://cpponline.uk/workshop/cpp-software-design/
  5. Safe C++ - Klaus Iglberger - 1 day online workshop available on Friday 1st May 09:00 - 17:00 UTC - https://cpponline.uk/workshop/safe-cpp/
  6. Safe and Efficient C++ for Embedded Environments - Andreas Fertig - 1 day online workshop available on Tuesday 12th May 09:00 - 17:00 UTC - https://cpponline.uk/workshop/safe-and-efficient-cpp-for-embedded-environments/
  7. Mastering std::execution (Senders/Receivers) - Mateusz Pusz - 1 day online workshop available on Friday 15th May 09:00 - 17:00 UTC - https://cpponline.uk/workshop/mastering-stdexecution-senders-receivers/
  8. How C++ Actually Works - Hands-On With Compilation, Memory, and Runtime - Assaf Tzur-El - One day online workshop that runs over two days on May 18th - May 19th 16:00 - 20:00 UTC - https://cpponline.uk/workshop/how-cpp-actually-works/
  9. AI++ 101 - Build an AI Coding Assistant in C++ - Jody Hagins - 1 day online workshop available on Friday 22nd May 09:00 - 17:00 UTC - https://cpponline.uk/workshop/ai-101/

C++Online One Day Beginner Workshops - Reduced from £345 to £150/$200/€175 (£90/$120/€105 for students)

  1. Jumpstart to C++ in Audio - Learn Audio Programming & Create Your Own Music Plugin/App with the JUCE C++ Framework - Jan Wilczek - 1 day online workshop available on both Tuesday 14th April 13:00 - 20:00 UTC & Tuesday 28th April 07:00 - 14:00 UTC - https://cpponline.uk/workshop/jumpstart-to-cpp-in-audio/
  2. From Hello World to Real World - A Hands-On C++ Journey from Beginner to Advanced - Amir Kirsh - 1 day online workshop available on Thursday 21st May 08:30 - 16:30 UTC - https://cpponline.uk/workshop/from-hello-world-to-real-world/

C++Online Half Day Workshops - £172.50/$230/€200 (£45/$60/€55 for students)

  1. Stop Thinking Like a Junior - The Soft Skills That Make You Senior - Sandor Dargo - Half Day online workshop available on Friday 10th April 13:00 - 16:30 UTC & Friday 8th May 20:00 - 23:30 UTC - https://cpponline.uk/workshop/stop-thinking-like-a-junior/
  2. Splice & Dice - A Field Guide to C++26 Static Reflection - Koen Samyn - Half Day online workshop available on Monday 25th May 09:00 - 12:30 UTC - https://cpponline.uk/workshop/splice-and-dice/

C++Online Two Day Workshops - £690/$920/€800 (£180/$240/€210 for students)

  1. AI++ 201 - Build a Matching Engine with Claude Code - Jody Hagins - 2 day online workshop available on April 20th - April 21st 13:00 - 21:00 UTC & May 28th - May 29th 09:00 - 17:00 UTC - https://cpponline.uk/workshop/ai-201/

Eleven of these workshops had previews at the main C++Online Conference which took place on the 11th - 13th March. You can watch these preview sessions here: https://www.youtube.com/playlist?list=PLHG0uo5c6V3KIeoLqvBbIqy5AXt_Me_cm

Anyone who purchased a C++Online Main Conference ticket can also get a discount of however much they paid to attend the main conference. 

Also if anyone is from a lower-income background or live in a country where purchasing power is limited, then it is recommended to reach out to C++Online on info@cpponline.uk as they will be able to give you a discount.

OTHER NEWS


r/cpp • • Apr 07 '26

C++ History Collection: Software Preservation Group

Thumbnail softwarepreservation.computerhistory.org
17 Upvotes

r/cpp • • Apr 07 '26

Future of Boost.Graph Workshop, Paris, France, May 6th 2026

37 Upvotes

Dear C++ and Graph community,

We are working towards the revitalizing of the Boost.Graph library and we would like to reconnect with our user base. To this end, I organize a small workshop in Paris on May 6th 2026, 09h-18h.

The goal is to bring together a small group (10-15 people) of researchers, open-source implementers, and industrial users for a day of honest conversation. If you have used Boost.Graph or another C++ graph library in production/research, you should feel invited and welcome. Three questions will anchor the discussions:

  1. What types of graphs and data structures do you use in practice?
  2. What performance, scalability, and interpretability requirements matter most to you?
  3. What algorithms are missing today that Boost.Graph could offer?

And of course expect loooong discussions about API ergonomics and documentation ;)

The format is a mix of short lightning talks in the morning and structured discussions in the afternoon, ending with a concrete prioritized roadmap.

I opened a Github Discussion to allow the community to reach us, even if not able to attend, so please feel free to chime in with your ideas, suggestions, complaints and wish-list: https://github.com/boostorg/graph/discussions/466

If you can not attend because you are far away, please show yourself: remote attendance is possible and I plan to organize similar events in different cities/countries in the future to allow for in-person presence <3

Thanks again,


r/cpp • • Apr 07 '26

The "macro overloading" idiom – Arthur O'Dwyer

Thumbnail quuxplusone.github.io
30 Upvotes

r/cpp • • Apr 06 '26

The cover of C++: The Programming Language raises questions not answered by the cover

Thumbnail devblogs.microsoft.com
135 Upvotes

r/cpp • • Apr 07 '26

Introducing Sparrow-IPC: A modern C++ implementation of Arrow IPC

Thumbnail medium.com
18 Upvotes

We’re excited to announce the release of Sparrow-IPC: a modern, open-source C++20 library that implements the Apache Arrow IPC protocol on top of Sparrow.

Sparrow-IPC passes 100% of the Apache Arrow IPC integration tests, ensuring full compatibility with existing Arrow tools and pipelines.

The library supports compression, the Arrow stream format, and the Arrow file format.

Some examples

Serialize record batches to a memory stream

std::vector<uint8_t> serialize_batches_to_stream(const std::vector<sp::record_batch>& batches)
{
    std::vector<uint8_t> stream_data;
    sp_ipc::memory_output_stream stream(stream_data);
    sp_ipc::serializer serializer(stream);

    // Serialize all batches using the streaming operator
    serializer << batches << sp_ipc::end_stream;

    return stream_data;
}

Pipe a source of record batches to a stream:

class record_batch_source
{
public:
    std::optional<sp::record_batch> next();
};

void stream_record_batches(std::ostream& os, record_batch_source& source)
{
    sp::serializer serial(os);
    std::optional<sp::record_batch> batch = std::nullopt;
    while (batch = source.next())
    {
        serial << batch;
    }
    serial << sp_ipc::end_stream;
}

Incremental deserialization:

void deserializer_incremental_example(const std::vector<std::vector<uint8_t>>& stream_chunks)
{
    // Container to accumulate all deserialized batches
    std::vector<sp::record_batch> batches;

    // Create a deserializer
    sp_ipc::deserializer deser(batches);

    // Deserialize chunks as they arrive using the streaming operator
    for (const auto& chunk : stream_chunks)
    {
        deser << std::span<const uint8_t>(chunk);
        std::cout << "After chunk: " << batches.size() << " batches accumulated\n";
    }

    // All batches are now available in the container
    std::cout << "Total batches deserialized: " << batches.size() << "\n";
}

r/cpp • • Apr 07 '26

CppCast CppCast: Building a Compiler Inside the C++ Compiler with Daniel Nikpayuk

Thumbnail cppcast.com
25 Upvotes

r/cpp • • Apr 06 '26

Seergdb v2.7 released for Linux.

17 Upvotes

r/cpp • • Apr 06 '26

New C++ Conference Videos Released This Month - April 2026

24 Upvotes

CppCon

2026-03-30 - 2026-04-05

C++Online

2026-03-30 - 2026-04-05

ADC

2026-03-30 - 2026-04-05

Meeting C++

2026-03-30 - 2026-04-05


r/cpp • • Apr 07 '26

Can your AI rewrite your code in assembly?

Thumbnail lemire.me
3 Upvotes

r/cpp • • Apr 06 '26

QxOrm 1.5.1 and QxEntityEditor 1.2.9 released (Qt ORM/ODM)

Thumbnail forum.qt.io
8 Upvotes

r/cpp • • Apr 05 '26

C++ Jobs - Q2 2026

56 Upvotes

Rules For Individuals

  • Don't create top-level comments - those are for employers.
  • Feel free to reply to top-level comments with on-topic questions.
  • I will create top-level comments for meta discussion and individuals looking for work.

Rules For Employers

  • If you're hiring directly, you're fine, skip this bullet point. If you're a third-party recruiter, see the extra rules below.
  • Multiple top-level comments per employer are now permitted.

    • It's still fine to consolidate multiple job openings into a single comment, or mention them in replies to your own top-level comment.
  • Don't use URL shorteners.

    • reddiquette forbids them because they're opaque to the spam filter.
  • Use the following template.

    • Use **two stars** to bold text. Use empty lines to separate sections.
  • Proofread your comment after posting it, and edit any formatting mistakes.

Template

**Company:** [Company name; also, use the "formatting help" to make it a link to your company's website, or a specific careers page if you have one.]

**Type:** [Full time, part time, internship, contract, etc.]

**Compensation:** [This section is optional, and you can omit it without explaining why. However, including it will help your job posting stand out as there is extreme demand from candidates looking for this info. If you choose to provide this section, it must contain (a range of) actual numbers - don't waste anyone's time by saying "Compensation: Competitive."]

**Location:** [Where's your office - or if you're hiring at multiple offices, list them. If your workplace language isn't English, please specify it. It's suggested, but not required, to include the country/region; "Redmond, WA, USA" is clearer for international candidates.]

**Remote:** [Do you offer the option of working remotely? If so, do you require employees to live in certain areas or time zones?]

**Visa Sponsorship:** [Does your company sponsor visas?]

**Description:** [What does your company do, and what are you hiring C++ devs for? How much experience are you looking for, and what seniority levels are you hiring for? The more details you provide, the better.]

**Technologies:** [Required: what version of the C++ Standard do you mainly use? Optional: do you use Linux/Mac/Windows, are there languages you use in addition to C++, are there technologies like OpenGL or libraries like Boost that you need/want/like experience with, etc.]

**Contact:** [How do you want to be contacted? Email, reddit PM, telepathy, gravitational waves?]

Extra Rules For Third-Party Recruiters

Send modmail to request pre-approval on a case-by-case basis. We'll want to hear what info you can provide (in this case you can withhold client company names, and compensation info is still recommended but optional). We hope that you can connect candidates with jobs that would otherwise be unavailable, and we expect you to treat candidates well.

Previous Post


r/cpp • • Apr 04 '26

Has QString any advantage over C++26?

57 Upvotes

C++26 is a different language compared with when Qt introduced QString and QStringView. For example C++17 introduced std::string_view. Is there any advantage left over what std offers? What about compatibility, could a potential Qt 7 just drop their own code and make QString* a type alias of std::string*?


r/cpp • • Apr 04 '26

C++Online 2026 Keynote - Is AI Destroying Software Development? - David Sankel

Thumbnail youtu.be
34 Upvotes

r/cpp • • Apr 04 '26

Options for Organizing Partitions

Thumbnail abuehl.github.io
11 Upvotes

I'm looking forward to getting grilled. Thanks in advance for your time and your patience!


r/cpp • • Apr 03 '26

A Critique Of The Two Trivial Relocatability Papers

Thumbnail gist.github.com
70 Upvotes

r/cpp • • Apr 03 '26

Trying to implement fiber in C++20 coroutine

22 Upvotes

https://github.com/felixaszx/coro-fiber

I did some experiments with this. The result is very surprising. I tested this on my Ryzen 7700X (8c/16t) Windows 11.

This is barely optimized. But, its is able to outperform boost::fiber in single-thread context switching (~20ns vs ~60ns, LLVM 21, std=c++20, the timer takes ~20ns). And even with the work stealing algorithm across all 16 threads trying to steal 1 fiber, it can still maitain at ~22ns of context switching.

I guess this is really uncommon since most of the time we expect our fiber to have some real workload rather than infinitely yielding to some other fibers. I am looking for some advices about how to improve the scheduler, right now it is just doing round robin locally or steal from other thread's queue if empty.


r/cpp • • Apr 03 '26

Parallel C++ for Scientific Applications: Distributed Parallelism with HPX (2nd Part)

Thumbnail youtube.com
10 Upvotes

In this week’s lecture, Dr. Hartmut Kaiser focuses on the implementation of distributed parallelism using HPX to solve large linear algebra systems (LLAS) equations. The lecture highlights essential foundational concepts by revisiting both the SPMD and CSP models from previous discussions, setting the stage for advanced problem-solving in high-performance environments.
A core discussion demonstrates how to implement a Jacobi method for distributed computation, specifically addressing the practical challenges of managing data dependencies across partitions. Finally, critical strategies for optimizing performance are explored, offering a comprehensive approach to handling complex, distributed mathematical operations.
If you want to keep up with more news from the Stellar group and watch the lectures of Parallel C++ for Scientific Applications and these tutorials a week earlier please follow our page on LinkedIn https://www.linkedin.com/company/ste-ar-group/
Also, you can find our GitHub page below:
https://github.com/STEllAR-GROUP/hpx


r/cpp • • Apr 03 '26

Baseline C++ Habits to Always Follow?

63 Upvotes

I come from a C background and now am working with a large codebase in C++. The biggest "culture" shock is the absolute mind-numbing amount of choices to accomplish a task which I have heard a lot about. And I know a lot of opinions are thrown out there (some good, some bad, but mostly subjective). I want to see if there is an overwhelming consensus on stuff that every style of C++ should adopt and if anybody could list at least some pillars of good habits that devs here almost always agree on?

I know the mature decision is to prioritize readability and use the right abstraction when it is needed, but what are some core things I need to memorize? The only things I know that is (almost) universally agreed upon:

  1. never use malloc()/free() or any C-like string manipulation (theres always a better C++ alternative that does the same thing)
  2. never use using namespace std;
  3. do not use new/delete justifiable in rare cases? (again, not quite sure)

But in other cases, for example, brace initializing vs assignment has some debate even though I know brace initialization prevents narrowing but overwhelming developers I talked to still prefer using '=' for readability, same with classic for loops instead of using something from <algorithm>. I guess it boils down to: which features should you absolutely use in almost any case vs use it when the occasion comes?

tl;dr If C++ was a culture, which things are absolutely taboo vs justifiable in certain contexts?


r/cpp • • Apr 02 '26

the most useful resource i've come across for learning cpp

31 Upvotes

For context, before I learnt cpp, I primarily used python and java.

When I was first starting out in learning cpp, I felt completely lost -- because I felt none of the resources usually mentioned online filled the gap of getting a dev familiar with a high-level language up to speed on the core concepts of modern cpp. Overwhelmingly, resources were meant for complete beginner programmers, and these resources barely mapped onto existing mature code bases that I was supposed to work on.

Even courses like "cpp for java developers" focused overwhelmingly on things like arrays, vectors, strings. like ??? pedagogically, it makes no sense to focus on these things - I can just read cppreference, they are standard data structures.

I finally stumbled onto this criminally underrated playlist of 5 short videos that explain the core concepts you need to know

  • Value/reference semantics
  • RAII (with an intro to smart pointers)
  • Move semantics

I still consider myself a novice in cpp after working with it for about a year now, but these 5 videos were honestly enough for me to start understanding and contributing to existing cpp codebases. Obviously, there was a lot of learning that I did after from various sources, but I didn't even KNOW that these were the core concepts that I should've been focused on to start going deeper before I stumbled across that playlist.

For instance, learncpp.com often gets mentioned on this subreddit but

  • RAII is first mentioned on chapter 19 (!!)
  • Moves are talked about in chapter 22

Just thought I should share.