Best of C++April 2026

  1. 1
    Article
    Avatar of hnHacker News·6w

    GitHub - fabienmillet/WiiFin: Jellyfin Client for Wii

    WiiFin is an experimental open-source homebrew Jellyfin client for the Nintendo Wii, written in C++ using GRRLIB and MPlayer CE. It supports authentication, library browsing (movies, TV, music), video/audio playback via server-side transcoding, HTTPS via mbedTLS, Wiimote IR input, and playback progress reporting. Ships as a ready-to-use .dol and installable .wad file. Build requires devkitPro with devkitPPC. Direct-play is not supported and audio is stereo-only.

  2. 2
    Article
    Avatar of lobstersLobsters·7w

    GitHub - LaurieWired/tailslayer: Library for reducing tail latency in RAM reads

    Tailslayer is a C++ library that reduces tail latency in RAM reads caused by DRAM refresh stalls. It works by replicating data across multiple independent DRAM channels with uncorrelated refresh schedules, using undocumented channel scrambling offsets compatible with AMD, Intel, and Graviton processors. When a read request arrives, it issues hedged reads across all replicas and uses whichever responds first. The library exposes a template-based HedgedReader API where users provide a signal function (to determine when to read) and a work function (to process the result). It handles address calculation and core pinning internally, acting as a hedged vector with logical indices.

  3. 3
    Video
    Avatar of lowlevelgamedevLow Level Game Dev·6w

    Worst C++ beginner mistake. Stop optimizing your code!

    A beginner-focused guide arguing against premature optimization in C++. Using a game resource analogy and a Minecraft clone example, it demonstrates that optimizing before measuring is wasteful and often harmful. Key points include: only optimize when you have a measured performance problem, micro-optimizations like pass-by-value vs const-reference are usually irrelevant because the compiler handles them, and distinguishing between performance (how fast code runs) and efficiency (how well resources are used). The core advice is to keep code simple, correct, and easy to extend rather than chasing theoretical performance gains.

  4. 4
    Article
    Avatar of faunFaun·6w

    Async Logging Is Not a Silver Bullet — What Actually Limits Performance

    Async logging is commonly assumed to make logging cheaper, but it only redistributes the cost rather than eliminating it. The real pipeline includes a capture step (copying or serializing data) before enqueuing, which is required for correctness due to data lifetime issues with deferred formatting. Formatting often dominates logging cost, and moving it to a background thread doesn't make it faster. A single backend thread creates a hard throughput ceiling, and queues only delay when overload becomes visible. An alternative approach — optimizing formatting on the caller thread and only offloading I/O asynchronously — avoids lifetime issues, reduces copying, and produces more predictable behavior.

  5. 5
    Article
    Avatar of collectionsCollections·4w

    GCC 16: hierarchical C++ errors, HTML diagnostics, and analyzer improvements

    GCC 16.1 is the first stable release of the GCC 16 series. Key changes include C++20 as the new default dialect, experimental C++26 features (reflection, contracts, expansion statements, std::simd), and a new experimental Algol 68 frontend. Hierarchical C++ error messages are now on by default, providing nested output for template and function signature mismatches. SARIF support is updated toward 2.2, and experimental HTML diagnostic output is available. The static analyzer has been substantially reworked with initial C++ support, though scaling for larger codebases is deferred to GCC 17. Early benchmarks on Fedora 44 show measurable performance gains over GCC 15.

  6. 6
    Article
    Avatar of quuxplusoneArthur O'Dwyer·5w

    auto{x} != auto(x)

    C++23 introduced `auto(x)` as a decay-copy cast expression via P0849, but `auto{x}` behaves differently due to brace-initialization semantics. While `auto(x)` makes a copy of `x` (equivalent to `T(x)`), `auto{x}` constructs a `T` from an initializer list `{x}`, which for types like `std::vector<std::any>` means wrapping `x` as an element rather than copying it. MSVC currently gets this wrong by calling the copy constructor in both cases. The post also covers edge cases: `return auto(x)` does not implicitly move unlike `return (x)`, multi-argument `auto(...)` is invalid, and `auto a = {1,2,3}` remains a historical inconsistency in the language. The practical takeaway is to use parentheses for copies in generic code and curly braces only when initializing from a sequence of elements.

  7. 7
    Article
    Avatar of infoqInfoQ·5w

    C++26: Reflection, Memory Safety, Contracts, and a New Async Model

    The C++26 standard draft is finalized, introducing four major features: compile-time reflection enabling zero-overhead metaprogramming and code generation; memory safety improvements (bounds checking, elimination of undefined behavior for uninitialized variables) that work by recompiling existing code without rewrites — already fixing 1,000+ bugs at Google and reducing segfaults by 30%; contracts with preconditions, postconditions, and a native assertion mechanism replacing the C assert macro; and std::execution, a unified framework for structured concurrency and parallelism using schedulers, senders, and receivers that integrates with C++20 coroutines. GCC and Clang have already implemented most features.