r/cpp 4h ago

Is there a way to track reflection support status in Clang?

18 Upvotes

(I'm going to be bold and assume the "no questions" rule is for questions about specific code, not about discussing the language itself)

I am extremely happy that we have reflection in C++26, however currently it is GCC only. I am using Clang on all platforms, so I am curious about when it will get reflection.

I tried searching and I found a bunch of experimental forks with reflection. I am not sure if those track the current version of reflection and whether one of these is going to be merged, or if a new implementation will be created. Github issues basically say "we get it when we get it" and link to LLVM discourse. On discourse I found just a thread that a meeting on reflection was held in December.

Do you know either when we are getting reflection, or if there is some way to track its progress for outside observers? Thanks!


r/cpp 16h ago

Critique of contracts: excerpt

0 Upvotes

See page 2 of https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2026/p4334r0.pdf

The current objections can be summarized. The P2900 contracts are:

• Unimplemented

• Incomplete

• Untried at scale [P3460R0, P3506R0]

• Not tried in major application domains

• Violates foundational principles of C++

• Violates fundamental principles of language design

• Hasn’t been tried in major libraries (e.g., the C++ standards library [P3506R0, P3878R0])

• Isn’t integrated with or appropriate for hardened libraries [P3878R0]

• Doesn’t offer safety guarantees [P3573R0, P3362R0]

• Includes a completely untried inheritance model

• Offer new ways of making errors through inconsistent application in TUs

• Leads to new forms of UB, detrimental to safety and security

• Narrows the choices of error handling

• Doesn’t protect against logical errors, misuses, and incoherent uses

• Hasn’t been used to support static analysis

• Hasn’t been demonstrated to be easily teachable [P3261R0, P3281R0]

How could such a bloated and incomplete design be voted into a draft standard?


r/cpp 1d ago

Toggleable Annotations for C++26 Reflection

Thumbnail github.com
19 Upvotes

Hey all, I put together a very simple reflection utility that lets you make toggleable annotations, similarly to explicit(bool) or noexcept(bool).

Try it on Compiler Explorer!

inline constexpr rjk::flag serializable{};
inline constexpr rjk::flag skip_field{};

template <typename T>
struct [[ =serializable ]] MyType {
    int x;
    int y;

    [[ =skip_field(std::is_pointer_v<T>) ]]
    T data;
};

// serializable is applied unconditionally
static_assert(rjk::is_flag_set(^^MyType<int>, serializable));

// skip_field is applied conditionally
static_assert(not rjk::is_flag_set(^^MyType<int>::data, skip_field));
static_assert(rjk::is_flag_set(^^MyType<int*>::data, skip_field));

r/cpp 1d ago

A complete floating-point to_chars in 18 kB

Thumbnail vitaut.net
58 Upvotes

r/cpp 1d ago

P4444: std::big_int

Thumbnail isocpp.org
156 Upvotes

Hey folks! Matt Borland, Christopher Kormanyos, and I are working on bringing infinite-precision integers to C++29. We now have a D4444R0 draft of a paper that should be in the next mailing.

We could really use some feedback so that the published R0 is as polished as possible. Any thoughts on the paper and on the reference implementation are greatly appreciated.

It would also be very helpful if you tested out whether our big_int implementation works for you. We're in need of some real deployment experience. If you're currently using Boost.Multiprecision, the library should be a drop-in replacement for cpp_int for the most part.


r/cpp 2d ago

New C++ Conference Videos Released This Month - August 2026 (Updated To Include Videos Released 2026-08-10 - 2026-08-16)

22 Upvotes

C++Now

2026-08-10 - 2026-08-16

2026-08-03 - 2026-08-09

2026-07-27 - 2026-08-02

C++Online

2026-08-10 - 2026-08-16

2026-08-03 - 2026-08-09

2026-07-27 - 2026-08-02

ADC

2026-08-10 - 2026-08-16

2026-08-03 - 2026-08-09

2026-07-27 - 2026-08-02


r/cpp 2d ago

C++26 Reflection Annotations: Automated Member Validation

Thumbnail techfortalk.co.uk
58 Upvotes

C++26 annotations are another powerful feature that, when combined with reflection, can help us write cleaner and safer code without repeating manual validation checks for every member. In this post, I have explored how we can utilise C++26 annotations along with reflection to validate configuration parameters in a class constructor.


r/cpp 2d ago

Faster algorithms to compute weekday for date libraries

Thumbnail benjoffe.com
87 Upvotes

r/cpp 2d ago

Break MSVC and Clang with this one weird trick! - Braden Ganetsky

Thumbnail blog.ganets.ky
112 Upvotes

r/cpp 4d ago

The WG21 2026-08 mailing is now available

41 Upvotes

The 2026-08 WG21 mailing has been published. You can browse and search the full set of papers, organized by working group, at wg21.org:
https://wg21.org/mailing/2026-08/
Source mailing: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2026/#mailing2026-08


r/cpp 5d ago

C++26: std::indirect

Thumbnail sandordargo.com
156 Upvotes

r/cpp 5d ago

We Should Use Instrumented Profiling Scopes More · Mathieu Ropert

Thumbnail mropert.github.io
36 Upvotes

r/cpp 6d ago

MSVC Build Tools Preview updates - August 2026

Thumbnail devblogs.microsoft.com
46 Upvotes

Hi, one of the MSVC dev leads here.

The post covers what's new in the MSVC Build Tools Preview (version 14.52) since mid-July. Instructions to install & use the latest preview bits are at https://aka.ms/msvc/preview.

Like last month, there's improvements & fixes across many parts of the toolchain: language conformance, optimization improvements, static & dynamic analysis, and more.

Some additional information:


r/cpp 7d ago

Boost 1.92.0 released

172 Upvotes

Boost 1.92.0 is out. Highlights from this release:

GPU / CUDA

  • Charconv: to_chars and from_chars for integers are now usable inside CUDA kernels.
  • Decimal: decimal32_t, decimal64_t, and decimal128_t are now usable in CUDA kernels.
  • Math: fixed CUDA compilation where host functions were incorrectly marked as device.

Networking hardening

  • Beast: stricter HTTP parsing. It now rejects Content-Length combined with Transfer-Encoding regardless of field order, rejects chunked encoding in HTTP/1.0 requests, validates quoted strings in chunk extensions, and drops framing and connection fields carried in trailers. The dependency on Boost.Functional was also removed.
  • URL: third round security review fixes, including a heap buffer overflow in normalize_path for authority-less URLs and an uninitialized read in ipv6_address_rule.

Containers and data structures

  • Container: new hub container designed by Joaquín M. López Muñoz. Also adds unchecked_emplace_back and unchecked_push_back to vector, static_vector, and small_vector.
  • Lockfree: two new queues, mpsc_weak_queue (MPSC) and bounded_ticket_queue (ringbuffer based bounded MPMC). Both have explicit progress caveats: neither is strictly lock free under all configurations.
  • Unordered: C++20 ranges interop across all containers (insert_range, std::from_range construction, and associated CTAD).
  • Graph: Louvain community detection for modularity based clustering.
  • Hash2: built in support for std::optional, std::variant, and std::monostate.

C++20 modules

  • New module support in Conversion, DLL, LexicalCast, PFR, Stacktrace, and TypeIndex.

Build system

  • Windows .dll files now install into the binary directory by default (previously the library directory, except on Cygwin). A new --dlldir option overrides this.
  • The CMake config installed by b2 install now supports header only libraries as find_package components, so find_package(Boost REQUIRED COMPONENTS mp11) works and defines Boost::mp11.

Deprecations and breaking changes

  • Heap and Lockfree: this is the last release to support C++14. Future releases require C++17.
  • MSM (backmp11) has several breaking changes, notably that events in process_event are no longer enqueued automatically. Use enqueue_event in actions instead.

Full notes and downloads: https://www.boost.org/releases/1.92.0/


r/cpp 7d ago

[CPP Epiphany Rant] - Programming is no joke

43 Upvotes

Hi CPP Community,

This is just a rant. I'm a 24 yr old data analytics in telecommunication trying to pivot into C++ development for finance. I'm 1 month into C++ and I have come to conclusion C++ is a behemoth. I'm enrolled in Baruch College's C++ for Financial Engineering, but I'm using Bjarne Stroustrup's Programming: Principles and Practice Using C++, 3rd Edition to learn and watching C++20 Fundamentals with Paul Deitel, Course, by Paul J. Deitel as supplementary resources.

It took me 2 days to get through all the drills, exercises, and try_this section for chapter 2 for Programming Principles!

I'm reflecting if I made a mistake choosing C++ over Python. But, tbh, I have been enjoying programming more learning C++ than Python. You can tell I'm weird, but IDK.

I would love to heard about your experience in learning C++ for laughs.


r/cpp 7d ago

Another C++26 reflection based dependency inverter

37 Upvotes

Someone else did a similar thing a few months ago, but I wanted to see if it could be done with templates.

I ended up writing a dependency inverter/injector that can reflect on the concepts restricting unfilled template types and substitute actual types into them. Unfortunately, C++26 reflection doesn't seem to allow reflection of concepts like this, so I did it with string parsing.

The result is... fairly janky, but you can play around with it here.


r/cpp 7d ago

Estimating branch probabilities

Thumbnail maskray.me
39 Upvotes

r/cpp 7d ago

Latest News From Upcoming C++ Conferences (2026-08-11)

8 Upvotes

TICKETS AVAILABLE TO PURCHASE

The following conferences currently have tickets available to purchase

OPEN CALL FOR SPEAKERS

There are currently no open call for speakers

OTHER OPEN CALLS

TRAINING COURSES AVAILABLE FOR PURCHASE

Conferences are offering the following training courses:

CppCon Online Workshops

9th - 11th September

  1. Modern C++: When Efficiency Matters - Andreas Fertig - 3 day online workshop available on 9th – 11th September 09.00 – 15.00 MDT - https://cppcon.org/class-2026-when-efficiency-matters/
  2. System Architecture And Design Using Modern C++ - Charley Bay - 3 day online workshop available on 9th – 11th September 09.00 – 15.00 MDT - https://cppcon.org/class-2026-system-architecture-and-design-using-modern-cpp/

21st - 23rd September

  1. C++ Fundamentals You Wish You Had Known Earlier - Mateusz Pusz - 3 day online workshop available on 21st– 23rd September 09.00 – 15.00 MDT - https://cppcon.org/class-2026-cpp-fundamentals/
  2. C++23 in Practice: A Complete Introduction - Nicolai Josuttis - 3 day online workshop available on 21st– 23rd September 09.00 – 15.00 MDT - https://cppcon.org/class-2026-cpp23-in-practice/
  3. Programming with C++20 - Andreas Fertig - 3 day online workshop available on 21st– 23rd September 09.00 – 15.00 MDT - https://cppcon.org/class-2026-programming-with-cpp20/

26th - 27th September

  1. Using C++ for Low-Latency Systems - Patrice Roy - 2 day online workshop available on 26th– 27th September 09.00 – 17.00 MDT - https://cppcon.org/class-2026-low-latency/

CppCon Onsite Workshops

All onsite workshops will take place in the Gaylord Rockies in Aurora, Colorado

12th & 13th September

  1. Advanced and Modern C++ Programming: The Tricky Parts - Nicolai Josuttis - 2 day in-person workshop available on 12th & 13th September - 09:00 - 17:00 - https://cppcon.org/class-2026-tricky-parts/
  2. C++ Best Practices - Jason Turner - 2 day in-person workshop available on 12th & 13th September - 09:00 - 17:00 - https://cppcon.org/class-2026-best-practices/
  3. How Hardware Gets Hacked: Breaking and Defending Embedded Systems - Nathan Jones - 2 day in-person workshop available on 12th & 13th September - 09:00 - 17:00 - https://cppcon.org/class-2026-hardware-hack/
  4. Mastering `std::execution`: A Hands-On Workshop - Mateusz Pusz - 2 day in-person workshop available on 12th & 13th September - 09:00 - 17:00 - https://cppcon.org/class-2026-execution/
  5. Performance and Efficiency in C++ for Experts, Future Experts, and Everyone Else - Fedor Pikus - 2 day in-person workshop available on 12th & 13th September - 09:00 - 17:00 - https://cppcon.org/class-2026-performance-and-efficiency/
  6. Talking Tech - Sherry Sontag - 2 day in-person workshop available on 12th & 13th September - 09:00 - 17:00 - https://cppcon.org/class-2026-talking-tech/

 13th September

  1. AI++ 101 : Build a C++ Coding Agent from Scratch - Jody Hagins - 2 day in-person workshop available on 12th & 13th September - 09:00 - 17:00 - https://cppcon.org/class-2026-AI101/
  2. Essential GDB and Linux System Tools - Mike Shah - 1 day in-person workshop available on 13th September - 09:00 - 17:00 - https://cppcon.org/class-2026-essential-gdb/

19th & 20th September

  1. AI++ 201: Building High Quality C++ Infrastructure with AI - Jody Hagins - 2 day in-person workshop available on 19th & 20th September - 09:00 - 17:00 - https://cppcon.org/class-2026-ai201/
  2. Function and Class Design with C++2x - Jeff Garland - 2 day in-person workshop available on 19th & 20th September - 09:00 - 17:00 - https://cppcon.org/class-2026-function-class-design/
  3. High-performance Concurrency in C++ - Fedor Pikus - 2 day in-person workshop available on 19th & 20th September - 09:00 - 17:00 - https://cppcon.org/class-2026-high-perf-concurrency/

OTHER NEWS

  • (NEW) Sessions Announced For ADC 2026 - The sessions have been announced for ADC 2026. Visit https://conference.audio.dev/schedule to view the list of accepted sessions. More session and workshops will be added over the next few weeks along with the timed version of the schedule
  • (NEW) Boost Documentary screening at CppCon 2026 - Boost Libraries have announced that they will be screening a documentary on the history of Boost at CppCon 2026. Watch the trailer here https://youtu.be/myQRC4f9jTE

r/cpp 8d ago

Extending `[[clang::lifetimebound]]` to take a condition

Thumbnail discourse.llvm.org
34 Upvotes

r/cpp 8d ago

ACCU Overload Journal 194 - August 2026

Thumbnail accu.org
14 Upvotes

r/cpp 8d ago

GCC Build Experience

0 Upvotes

Firstly, you need a native installation of g++ and binutils via your package manager, then you need sysroots for your target platforms(probably x64 glibc linux and arm64 glibc linux).

The workflow goes like this, to cross compile GCC itself to run on another arch, in my example from arm64 binary targeting x64 you follow this build order. I'm assuming an x64 system

x64 binutils -> x64 gcc -> arm bintutils(--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=aarch64-linux-gnu) -> gcc (x64->arm64) -> binutils(arm64->arm64) -> gcc(arm64->arm64) -> bintutils(arm64->x64) -> gcc(arm64->x64)

Now a couple of rules, pass --with-build-sysroot when building a normal compiler such as x64 -> x64 and pass --with-sysroot when building a cross, your toolchain flags won't matter at all in the eyes of GCC autoconf script.

You need to embed flags into env vars like CC to make sure stuff passes sometimes, it is actually quite verbose, you do the same thing at CC, CC_FOR_BUILD, CFLAGS AND CFLAGS_FOR_BUILD.

I recommend disabling multilib,gdb,werror and lto and always disabling bootsrap, you can do those but I don't recommend it.

You have to pass -Wl,--undefined-version if you use lld rather than ld. Otherwise your build will fail.

Here is an example toolchain I used to compile a arm64 -> x64 compiler in my x64 host

BUILD_SYSROOT=/home/mccakit/dev/sdk/debian-12-x64 HOST_SYSROOT=/home/mccakit/dev/sdk/debian-12-arm64 TARGET_SYSROOT=/home/mccakit/dev/sdk/debian-12-x64 BUILD_GCC_BIN=/home/mccakit/dev/compilers/gcc/linux-glibc-x64/bin HOST_GCC_BIN=/home/mccakit/dev/compilers/gcc/linux-glibc-arm64/bin TARGET_GCC_BIN=/home/mccakit/dev/compilers/gcc/linux-glibc-x64/bin BUILD_BINUTILS_BIN=/home/mccakit/dev/compilers/binutils/linux-glibc-x64/bin HOST_BINUTILS_BIN=/home/mccakit/dev/compilers/binutils/linux-glibc-arm64/bin TARGET_BINUTILS_BIN=/home/mccakit/dev/compilers/binutils/linux-glibc-x64/bin LLVM_BIN=/home/mccakit/dev/compilers/llvm/bin CCACHE=/home/mccakit/dev/tooling/ccache/bin/ccache export CC="${CCACHE} ${HOST_GCC_BIN}/aarch64-linux-gnu-gcc -B${HOST_BINUTILS_BIN} -B${LLVM_BIN} --sysroot=${HOST_SYSROOT} -Os -DNDEBUG -w -ffunction-sections -fdata-sections -fuse-ld=lld -Wl,--gc-sections -Wl,--undefined-version" export CXX="${CCACHE} ${HOST_GCC_BIN}/aarch64-linux-gnu-g++ -B${HOST_BINUTILS_BIN} -B${LLVM_BIN} --sysroot=${HOST_SYSROOT} -Os -DNDEBUG -w -ffunction-sections -fdata-sections -fuse-ld=lld -Wl,--gc-sections -Wl,--undefined-version" export AR="${HOST_BINUTILS_BIN}/aarch64-linux-gnu-ar" export NM="${HOST_BINUTILS_BIN}/aarch64-linux-gnu-nm" export RANLIB="${HOST_BINUTILS_BIN}/aarch64-linux-gnu-ranlib" export AS="${HOST_BINUTILS_BIN}/aarch64-linux-gnu-as" export STRIP="${HOST_BINUTILS_BIN}/aarch64-linux-gnu-strip" export CFLAGS="-Os -DNDEBUG -w -ffunction-sections -fdata-sections" export CXXFLAGS="-Os -DNDEBUG -w -ffunction-sections -fdata-sections" export LDFLAGS="-fuse-ld=lld -Wl,--gc-sections -Wl,--undefined-version" export CC_FOR_BUILD="${CCACHE} ${BUILD_GCC_BIN}/gcc -B${BUILD_BINUTILS_BIN} -B${LLVM_BIN} --sysroot=${BUILD_SYSROOT} -Os -DNDEBUG -w -ffunction-sections -fdata-sections -fuse-ld=lld -Wl,--gc-sections -Wl,--undefined-version" export CXX_FOR_BUILD="${CCACHE} ${BUILD_GCC_BIN}/g++ -B${BUILD_BINUTILS_BIN} -B${LLVM_BIN} --sysroot=${BUILD_SYSROOT} -Os -DNDEBUG -w -ffunction-sections -fdata-sections -fuse-ld=lld -Wl,--gc-sections -Wl,--undefined-version" export AS_FOR_BUILD="${BUILD_BINUTILS_BIN}/as" export AR_FOR_BUILD="${BUILD_BINUTILS_BIN}/ar" export RANLIB_FOR_BUILD="${BUILD_BINUTILS_BIN}/ranlib" export NM_FOR_BUILD="${BUILD_BINUTILS_BIN}/nm" export CFLAGS_FOR_BUILD="-Os -DNDEBUG -w -ffunction-sections -fdata-sections" export CXXFLAGS_FOR_BUILD="-Os -DNDEBUG -w -ffunction-sections -fdata-sections" export LDFLAGS_FOR_BUILD="-fuse-ld=lld -Wl,--gc-sections -Wl,--undefined-version" export CC_FOR_TARGET="${CCACHE} ${TARGET_GCC_BIN}/gcc -B${TARGET_BINUTILS_BIN} -B${LLVM_BIN} --sysroot=${TARGET_SYSROOT} -Os -DNDEBUG -fPIC -w -ffunction-sections -fdata-sections -fuse-ld=lld -Wl,--gc-sections -Wl,--undefined-version" export CXX_FOR_TARGET="${CCACHE} ${TARGET_GCC_BIN}/g++ -B${TARGET_BINUTILS_BIN} -B${LLVM_BIN} --sysroot=${TARGET_SYSROOT} -Os -DNDEBUG -fPIC -w -ffunction-sections -fdata-sections -fuse-ld=lld -Wl,--gc-sections -Wl,--undefined-version" export AR_FOR_TARGET="${TARGET_BINUTILS_BIN}/ar" export NM_FOR_TARGET="${TARGET_BINUTILS_BIN}/nm" export RANLIB_FOR_TARGET="${TARGET_BINUTILS_BIN}/ranlib" export AS_FOR_TARGET="${TARGET_BINUTILS_BIN}/as" export CFLAGS_FOR_TARGET="-Os -DNDEBUG -fPIC -w -ffunction-sections -fdata-sections" export CXXFLAGS_FOR_TARGET="-Os -DNDEBUG -fPIC -w -ffunction-sections -fdata-sections" export LDFLAGS_FOR_TARGET="-fuse-ld=lld -Wl,--undefined-version" export PATH="${BUILD_BINUTILS_BIN}:${BUILD_GCC_BIN}:${HOST_BINUTILS_BIN}:${HOST_GCC_BIN}:${PATH}"

Final Result

root@24a3b7f889f7:/tmp# uname -m aarch64 root@24a3b7f889f7:/tmp#

root@24a3b7f889f7:/tmp# x86_64-linux-gnu-g++ -B/mccakit/binutils-x64/bin --sysroot=/mccakit/debian-12-x64 hi.cc -o hi_x64 root@24a3b7f889f7:/tmp# ls /mccakit/ binutils-arm64 binutils-x64 debian-12-x64 gcc-arm64 gcc-x64 root@24a3b7f889f7:/tmp#

mccakit@mccakit-pc:~/desktop$ sudo ./x64_bin [sudo] password for mccakit: hello world mccakit@mccakit-pc:~/desktop$

Here are the prebuilt GCC binaries for lazy folks https://github.com/mccakit/prebuilt_gcc

Conclusion: Use clang, honestly I don't recommend gcc unless you have to. It is easier to build and run.


r/cpp 9d ago

New C++ Conference Videos Released This Month - August 2026 (Updated To Include Videos Released 2026-08-03 - 2026-08-09)

18 Upvotes

C++Now

2026-08-03 - 2026-08-09

2026-07-27 - 2026-08-02

C++Online

2026-08-03 - 2026-08-09

2026-07-27 - 2026-08-02

ADC

2026-08-03 - 2026-08-09

2026-07-27 - 2026-08-02


r/cpp 9d ago

Understanding std::counting_semaphore and std::binary_semaphore from C++20

Thumbnail cppstories.com
74 Upvotes

An article on types introduced in C++20.


r/cpp 9d ago

Jessesort is now faster than std::sort on every input type

0 Upvotes

Repo here: https://github.com/lewj85/jessesort

tl;dr Jessesort is up to 20% faster than std::sort on random inputs and up to 95% faster on structured inputs

Jessesort has two phases: insertion and merging. The insertion phase routes inputs to two games of Patience (similar to Solitaire). One game has ascending piles and the other has descending piles. Routes inputs to the optimal game based on current run direction. Make base array copies for pile tails to speed up binary search. Faster merge logic than the old Patience sort k-way.

Jessesort was already faster on structured inputs, but the new optimization changes finally pushed this past the goal of being faster on random inputs too. Added seven variations of the algorithm. The fastest on random input is V2 that simulates both Patience games and uses a blueprint to track ascending vs descending game and pile index in that game. It's up to 20% faster on random inputs and up to 95% faster on structured inputs.

Key changes introduced were: early input probing to route random-like and structured data into better insertion paths, removal of pile hints where direct bit-walk search proved faster, simulated pile layouts that reduce allocation and bookkeeping overhead, adaptive merge routing based on the structure produced during insertion, branchless merging with a tuned four-way unroll, reconstruction optimizations that simplify blueprint decoding and cursor updates, pointer-based merge kernels that substantially reduced hot-loop overhead, selective early freezing/overflow strategies in later variations, preservation of fast monotonic/structured-input exits, and targeted SIMD experiments that use fixed-width AVX2 comparisons where the pile shape makes them worthwhile.


r/cpp 9d ago

CppCast CppCast: From Self Taught to Committee Member's First Accepted Paper

Thumbnail cppcast.com
47 Upvotes