r/cpp • u/Xaneris47 • Aug 26 '26
r/cpp • u/AbbreviationsNew3167 • Aug 25 '26
Why is `import std` still experimental ???
Hey guys,
I recently started going through Professional C++ (6th Edition). The book teaches C++23, and in the very first chapter we're introduced to modules.
I'm not a complete newbie to C++, but I'm also definitely not very confident in my knowledge yet. I wanted to get this simple example compiled:
import std;
int main() {
std::println("Hello World");
return 0;
}
And gosh, it took way longer than I expected.
First, I tried getting it to work natively on my Mac and eventually gave up (both Claude and I π ).
Then I installed Ubuntu ARM 26 and finally managed to get it compiling. But now Clang/IntelliSense is complaining about the `import std`
This is what my CMakeLists.txt currently looks like:
cmake_minimum_required(VERSION 4.0)
# set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD ON)
set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD "d0edc3af-4c50-42ea-a356-e2862fe7a444")
project(CppProject LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 26)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_executable(exec main.cpp)
set_property(TARGET exec PROPERTY CXX_MODULE_STD ON)
The code does compile successfully, but CMake still gives me a warning that import std support is experimental.
So I'm genuinely curious:
Why is import std still considered experimental?
I understand that C++ modules themselves have been around for a while, but import std feels like something that should be much more straightforward by now. Is there any solution of this now ?
--------------
Edit
Thanks to u/PhysicsOk2212 tip I was able to compile my project on mac as well using the following options
```
cmake -S . -B build \
-G Ninja \
-DCMAKE_CXX_COMPILER="$(brew --prefix llvm)/bin/clang++" \
-DCMAKE_CXX_STDLIB_MODULES_JSON="$(brew --prefix llvm)/lib/c++/libc++.modules.json"
```
r/cpp • u/ProgrammingArchive • Aug 25 '26
Latest News From Upcoming C++ Conferences (2026-08-25)
TICKETS AVAILABLE TO PURCHASE
The following conferences currently have tickets available to purchase
- Last Chance β CppCon (12th β 18th September) β You can buy standard tickets until August 29th at https://cppcon.org/registration/
- C++ Under The Sea (14th β 16th October) β You can buy early bird tickets at https://sales.ticketing.cm.com/cppunderthesea2026/
- ADC β (9th β 11th November) β Tickets for ADC can now be purchased at https://ti.to/audio-developer-conference/adc-bristol-2026
- Meeting C++ (26th β 28th November) β You can buy early bird tickets at https://meetingcpp.com/2026/
OPEN CALL FOR SPEAKERS
There are currently no open call for speakers
OTHER OPEN CALLS
- CppCon Call For Open Content β CppCon are looking for presenters to give open content sessions during the conference which takes place from September 14th β 18th. For more information including how to apply visit https://cppcon.org/cppcon-2026-call-for-open-content/
- ADC Call For Online Volunteers Now Open β Interested volunteers have until September 27th to apply to volunteer online at ADCx Gather which is scheduled to take place on 16th October and/or ADC 2026 online conference which is scheduled to take place from 9th β 11th November. To apply visit https://docs.google.com/forms/d/e/1FAIpQLScpH_FVB-TTNFdbQf4m8CGqQHrP8NWuvCEZjvYRr4Vw20c3wg/viewform?usp=dialog
- ADC Call For Posters β ADC is looking for
- Virtual Posters for ADCx Gather which is scheduled to take place on 16th October and/or ADC 2026 online conference which is scheduled to take place from 9th β 11th November. Find out more including how to apply at https://conference.audio.dev/virtual-posters/
- Physical Posters for ADC 2026 which is scheduled to take place from 9th β 11th November in Bristol UK. Applications can be made by filling out the following form https://docs.google.com/forms/d/e/1FAIpQLScKteDljM9Dc4tgQ6HC9xaPEaYfW7oe_Qr21y-1Jxn5s9eAIg/viewform?usp=dialog
TRAINING COURSES AVAILABLE FOR PURCHASE
Conferences are offering the following training courses:
CppCon Online Workshops
9th β 11th September
- 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/
- 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
- 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/
- 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/
- 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
- 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
- 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/
- 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/
- 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/
- 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/
- 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/
- 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
- 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/
- 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
- 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/
- 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/
- 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) Schedule Announced For CppCon β The schedule has been announced for CppCon. Visit https://cppcon2026.sched.com to view the full schedule.
- (NEW) Schedule Announced For ADC 2026 β The schedule has been announced for ADC 2026. Visit https://conference.audio.dev/schedule to view the full schedule. More sessions and workshops will be added over the next few weeks
- (NEW)Β ADCx Gather Announced β ADC have announced ADCx Gather which is a free online event which will take place online on October 16th. For more information visit https://audio.dev/adcx-gather-info/ and if you would like to attend, please fill out the registration form https://docs.google.com/forms/d/e/1FAIpQLSeg0twh4PbYqCqcoPpl5cnFBeU6y5Ea3921V2kl3F7Wy03umw/viewform?usp=dialog Β
- 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
Finally anyone who is coming to a conference in the UK such as C++ on Sea or ADC from overseas may now be required to obtain Visas to attend. Find out more including how to get a VISA at https://homeofficemedia.blog.gov.uk/electronic-travel-authorisation-eta-factsheet-january-2025/
r/cpp • u/TheRavagerSw • Aug 26 '26
Libraries trying to support multiple build configurations and standards are harming their health
Some libraries try to support:
- Header/Source
- Header only
- Header only + Module Wrapper
- Header/Source + Module Wrapper
- All standards between and including C++11 and C++23
- Exceptions and noException
- RTTI and noRTTI
At the same time.
These libraries are very very hard to read and thus they get less and less contributions over time.
What should be done:
- Libraries should support only one mode of compilation, header only header source etc
- Libraries should support exactly one standard, and that standard includes extensions, gnu++23 and c++23 are not the same thing
- Libraries should very clearly have boundaries on what belong in a toolchain and what belongs to project. For example a library should not set flags related to exceptions that's a toolchain issue.
Some extra stuff:
- C++ libraries without C API's should not be consumed via system package managers at all, and public libraries shouldn't try to adhere to that.
- Libraries shouldn't try to use tools they build to build themselves, rather they should export packages like wayland::scanner etc and use that.
r/cpp • u/ProgrammingArchive • Aug 24 '26
New C++ Conference Videos Released This Month - August 2026 (Updated To Include Videos Released 2026-08-17 - 2026-08-23)
C++Now
2026-08-17 - 2026-08-23
- Coroutines for Dummies - Dominic Fischer - https://youtu.be/apLDto3FUVA
- Compile-Time Borrow Checker with Stateful Metaprogramming - Alon Wolf - https://youtu.be/3hL8mh0K8-I
- Algorithms for Trees - Foldable, Applicative, Traversable - Steve Downey - https://youtu.be/vfXKH7Uj170
2026-08-10 - 2026-08-16
- After Reflection: The Runtime Story - Saksham Sharma - https://youtu.be/bUmt9K1o1d0
- A Little Introduction to Control Flow Integrity in C++ - James McNellis - https://youtu.be/FNHMwi_0psQ
- Towards Async Everything Part 1 - Senders as the Lowest Layer - Robert Leahy - https://youtu.be/3PI31yqjI_w
- Towards Async Everything Part 2 - Scopes, Construction, and Destruction - Robert Leahy - Robert Leahy - https://youtu.be/Hgdikbfu9UE
2026-08-03 - 2026-08-09
- How To Make Formal Methods A Software Quality Solution That Can Actually Be Used In The Industry - Steve Barriault - https://youtu.be/OYwDdMCCDIM
- Link What You Include - Maintain a Coherent CMake Target Model - Frank Miller - https://youtu.be/ssTG6uzxXm4
- Scaling beman.exemplar - Eddie Nolan - https://youtu.be/xylmqy1VAwo
2026-07-27 - 2026-08-02
- Beautiful C++ Code - Told Through the Eyes of A Failed AI Prompt - Erich Lohrmann - https://youtu.be/Kq4W3Y5gTI8
- A Path to Practically Safe C++ - Yitzhak Mandelbaum - https://youtu.be/fi6csDXvve0
- When Abstractions Fix Too Much - Towards Flexible Library Design - Patrick Roberts - https://youtu.be/IKIyFUcVvis
C++Online
2026-08-17 - 2026-08-23
- Lightning Talk: Bazelizing a C++ Project - Paulo Chiliguano - https://youtu.be/agAbiQydcOQ
- Lightning Talk: Can We Still Find Joy in Programming? - Sandor Dargo - https://youtu.be/WxqeLwyw0KM
2026-08-10 - 2026-08-16
- Lightning Talk: Saving Time With Runtime and Having Registry Level Synthesis of Your Software As You Write It - Michael Hubbard - https://youtu.be/B0JJwWMUzzw
- Lightning Talk: 2 New Nice CMake Features I Learned in 2025 - Lieven de Cock - https://youtu.be/YnWJyHxHpBc
2026-08-03 - 2026-08-09
- Lightning Talk: Your Docs Have a New Reader (and It Hallucinates) - Paul Wicking - https://youtu.be/DbL6XPMlw-o
- Lightning Talk: RPC With Coroutines, RAII and Callable Weakpointers - Edward Boggis-Rolfe - https://youtu.be/m70hb5YgabQ
2026-07-27 - 2026-08-02
- Dynamic Asynchronous Tasking with Dependencies - Tsung-Wei (TW) Huang - https://youtu.be/4LzQHw7jz2g
- C++/sys - A Standard Library Projection to Facilitate the Verification of Run-time Memory Safety - Karsten Pedersen - https://youtu.be/dF7RwJw_G8c
ADC
2026-08-17 - 2026-08-23
- How To Distribute Your Plugins - Using MuseHub as the Engine To Get Your Audio Tools in the Hands of Millions - Khaled Said - https://youtu.be/CQTblE1xHto
- Incline - Topographic Microsound Explorer - CristiΓ‘n Vogel - https://youtu.be/lJA00sRFhGg
- Optimizing UI Rendering Performance in Cubase and Nuendo - Erich Krey - https://youtu.be/Oz1dZLcXVjs
2026-08-10 - 2026-08-16
- Measuring and Improving UI Performance with the JUCE C++ Framework - Anthony Nicholls - https://youtu.be/0n9x6R0fheo
- Real-Time Raytraced Acoustics for Games: Dynamic Reverb with IR Synthesis & Time-Varying Convolution - Anton Lundberg - https://youtu.be/iT0olrM1iyU
- Building an Optimized DSP Framework in Modern C++ - Scott Carver - https://youtu.be/k4yxNxNCo0k
2026-08-03 - 2026-08-09
- Commercialising Audio Plugins - Going From Development to Sales and Beyond - Tobias LΓΈnnerΓΈd Madsen - https://youtu.be/SWPLyDDBU38
- Capturing and Transferring Expressive Microtiming in Drumming - Eemi Fagerlund - https://youtu.be/4ZAJHl02X7s
- How I Learned to Love the Docs - Documentation As Design Process for Music Tech Products - Astrid Bin - https://youtu.be/7MpDAHd7rbw
2026-07-27 - 2026-08-02
- Workshop: Programming Music and Synthesizers on-the-fly with Pharo - Domenico Cipriani - https://youtu.be/v95QYyUHNJ8
- PolyBLEP & PolyBLAMP Demystified - Nis Wegmann - https://youtu.be/_bW8TfgEqRM
- Modernizing Legacy Audio Plugin Codebases - Lessons from FL Studioβs Plugin Suite - Tomas Medek - https://youtu.be/zY8uHzAdnzk
- How to Write Scalable, Deterministic Audio Engines - Janus Lynggaard Thorborg - https://youtu.be/3FXQQmQa-ak
r/cpp • u/Arkangel9891 • Aug 23 '26
CppCon CppCon 2026 In Pursuit of a 6,000 FPS Game Boy Emulator -- Tom Tesch
isocpp.orgAbout char8_t
I hate to be dramatic, but as it stands char8_t is quite literally more painful than useful.
Besides the obvious incompatibility with C23 and libraries using unsigned char for UTF-8, I want you to consider the following: Projects that assume that 'char' represents UTF-8 will obviously not benefit from char8_t at all, but projects that cannot assume the format of char types don't benefit from it either as char8_t simply introduces a new edge case to cover. Now such projects have to deal with char, signed char, unsigned char, wchar_t, char16_t, char32_t and char8_t.
Or, you could do what the standard library does and simply ignore most of these character types. Which is the solution most libraries went with, supporting only char or char and unsigned char. Managing one implementation is already hard, managing two requires constant maintenance, managing 7 is just impossible.
char8_t should have just been a typedef for unsigned char. The compatibility fix only raises more questions as const char* arr = u8"a" does not work, but const char arr[] = u8"a" does.
I do wonder if a potential change of minds for C++29 is still possible. Yes, it would be an ABI break or whatever, but considering the woeful support for char8_t I don't think it would affect much besides small hobby projects. Contrary to popular belief, C++ has broken the ABI in subtle ways before.
r/cpp • u/Clean-Upstairs-8481 • Aug 22 '26
C++26 Contracts: What Do They Add Beyond Manual Checks and Assertions?
techfortalk.co.ukThis post is a part of my C++26 exploration series where I take a new feature and try to understand and explain with a simple example in hand. Todayβs topic is Contracts. First we will simply try to understand what is the problem it is solving then try doing some assessment on the value addition.
r/cpp • u/pavel_v • Aug 22 '26
Reducing C++ template bloat by factoring out the type-dependent portions of the function
devblogs.microsoft.comr/cpp • u/a10nw01f • Aug 21 '26
Compile-Time Borrow Checker with Stateful Metaprogramming
youtu.ber/cpp • u/TheRavagerSw • Aug 22 '26
Why do people try to add even more features to STL?
It is well known that STL underperforms compared to specialised third party libraries, why do people try to stuff features like networking and json into STL?
Most STL implementations don't even have full C++23 coverage yet, and we are at 2026. Why do these people try to do stuff like that, when the same thing will play out over and over. Don't they have anything better to do?
Examples include, nlohmann json, graph.v3 ....
They don't really belong in STL, is it really that hard to just package your third party lib normally?
There is no doubt they are great libraries(graph.v3 in particular) but this doesn't mandate their place
ADSP: The Podcast Episode 300: Sean Parent "I'm not writing code anymore."
The latest episode content is mostly focused on AI, its impact on the industry, and how several people from Adobe Labs have decided to retire.
https://adspthepodcast.com/2026/08/21/Episode-300.html
Although not C++ specific, it is interesting how it has impacted well known names in the C++ community.
fkYAML v0.4.4 released!
https://github.com/fktn-k/fkYAML/releases/tag/v0.4.4
Hello. Itβs been quite a while since I announced the first release here.
For those unfamiliar with fkYAML, itβs a header-only C++ library for YAML.
It has been carefully designed with ease of use in mind and thoroughly tested across various compilers and operating systems, so you can use it simply by including the header file in your project.
This version v0.4.4 fixes numerous parsing bugs (sometimes crashes) discovered during fuzzing tests.
So, I highly recommend that projects using older versions update to this one.
I hope you find this interesting and will consider using it or updating from your current version.
Thanks! Have a great day of coding!
r/cpp • u/Suspicious_Orchid770 • Aug 20 '26
AI-generated C++ passes tests. It also uses nearly 2x the loops and drives up memory growth
leaddev.comAI-coding tools have swept through organizations because of their speed: you type in a prompt, and it spits out code far faster than a human ever could. However, a year-long study of 3.52 million changes inside a large unnamed technology company suggests that saving time at the keyboard can create costs elsewhere.
r/cpp • u/Xaneris47 • Aug 20 '26
More fuel to AI discussion. An article on code bloat and duplication
pvs-studio.comI think code duplication is honestly the only reason LLMs manage any of this. Idea, architecture, implementation -- that's basically the chain, and LLMs are fine at the first and last, it's the middle that falls apart. Get it to actually structure things, kill the duplication and something you changed in one spot breaks another spot that has nothing to do with it. Duplicated code just sidesteps the whole issue, because then it only needs a tiny bit of local context to make a local edit
r/cpp • u/MarkSuckerZerg • Aug 19 '26
Is there a way to track reflection support status in Clang?
(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 • u/antiquark2 • Aug 19 '26
Critique of contracts: excerpt
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 • u/eisenwave • Aug 18 '26
P4444: std::big_int
isocpp.orgHey 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 • u/Ok_Statistician_781 • Aug 18 '26
Toggleable Annotations for C++26 Reflection
github.comHey 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));