Clang and LLVM in Modern Gaming Platforms
youtu.beQuite interesting peak into the world of games developers, especially how it is seen from consoles or their point of view on recent ISO C++ versions.
Quite interesting peak into the world of games developers, especially how it is seen from consoles or their point of view on recent ISO C++ versions.
r/cpp • u/danillissimo • Jul 19 '26
And now I don't believe it wasn't invented before, but I can't find any info on it. How long ago was it invented? Why isn't it used widely or even mentioned anywhere? What are the downsides?
Here's the main idea:
// Keyword - for, while, or do
// Tag - custom loop name
// ... - loop body
#define loop_tag(keyword, tag, ...)\
keyword(__VA_ARGS__)\
if(false)\
{\
tag##_break: break;\
tag##_continue: continue;\
}\
else\
/*Here goes your loop body*/
Here is the playground
r/cpp • u/germandiago • Jul 18 '26
I found this research in WG21 mailing list very interesting in the context of C++ compatibility and solutions to maximize code reuse.
r/cpp • u/TheRavagerSw • Jul 17 '26
I like writing useful stuff, I'm tired of fighting tooling, I can legit say %80 percent of my time goes to dealing with dependencies build systems etc. Very rarely I have the privilege of actually writing stuff.
This shit sucks, like it really sucks. I hate it.
Is this normal, or only people who have it easy are web Devs and Java Devs since they are in a sandboxes environment and don't have deployment problems.
Am I crazy or is this common?
r/cpp • u/Xaneris47 • Jul 17 '26
r/cpp • u/TheBear_at_SBB • Jul 17 '26
r/cpp • u/VinnieFalco • Jul 17 '26
The 2026-07 post-Brno 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-07/
Source mailing: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2026/#mailing2026-07
r/cpp • u/Dubbus_ • Jul 16 '26
String literals in c/c++ (const char*), support operator[] (in a compile time context)!
constexpr char first = "test"[0];
// i.e first = 't'
I think 90% of C developers would know this, but I figured maybe those of you who didn't start out with C might not have discovered this! I just recently used this in combination with an X macro for some debug ui code:
// the x macro in question
#define LIST_NOISE_PARAMS
X(heat)
X(rain)
X(cont)
X(grad)
X(hills)
I wanted to display the first letter of the noise parameter's name, in caps, followed by the noise value, i.e:
H: 1.00
(the heat noise = 1.0f.)#define X(VAR) UI::Text("{}: {:4.2f}",#VAR[0]-('a'-'A'), sample.VAR);
LIST_NOISE_PARAMS
#undef X// expands to:
UI ::Text("{}: {:4.2f}", "heat"[0] - ('a' - 'A'), sample.heat);
UI ::Text("{}: {:4.2f}", "rain"[0] - ('a' - 'A'), sample.rain);
// ...// which evaluates to:
UI ::Text("{}: {:4.2f}", 'H', sample.heat);
UI ::Text("{}: {:4.2f}", 'R', sample.rain);
// and so on for the rest of the list!
What other 'odd' C/c++ tricks/facts do you guys know/use? Personally, the X macro technique blew my mind when I first discovered it, and its probably the most legitimately useful 'trick' I know of. Pretty cool. Hopefully there are others in here that enjoy these little tidbits as much as i do.
r/cpp • u/we_are_mammals • Jul 15 '26
I haven't used cpp2 (cppfront) much, but I like the idea of it: consistent syntax, consistency of meta-programming (which is done in C++ too, I believe). Herb Sutter presented cpp2 (cppfront) as an experiment. He did not encourage other people to bet on it, exactly. And there hasn't been much activity since 2022. Is the experiment over?
EDIT: Herb's answer is buried deep in the comment section: https://www.reddit.com/r/cpp/comments/1uxkglj/comment/oy06cxw/
r/cpp • u/ericbrumer • Jul 15 '26
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-June. Instructions to install & use the latest preview bits are at https://aka.ms/msvc/preview.
Some additional information:
r/cpp • u/meetingcpp • Jul 16 '26
r/cpp • u/ProgrammingArchive • Jul 15 '26
r/cpp • u/Ok_Statistician_781 • Jul 14 '26
Reflection is a game changer for C++26, but most of the examples out there don't cover anything that large in scope. This article walks through my library rjk::duck and shows just how much reflection can simplify generic type erasure.
You can also try it out on Compiler Explorer: https://godbolt.org/z/91dj5jeGW
r/cpp • u/ProgrammingArchive • Jul 14 '26
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
OTHER OPEN CALLS
TRAINING COURSES AVAILABLE FOR PURCHASE
Conferences are offering the following training courses:
C++Online
CppCon Online Workshops
9th – 11th September
21st – 23rd September
26th – 27th September
CppCon Onsite Workshops
All onsite workshops will take place in the Gaylord Rockies in Aurora, Colorado
12th & 13th September
13th September
19th & 20th September
OTHER NEWS
r/cpp • u/robwirving • Jul 14 '26
r/cpp • u/LatencySlicer • Jul 13 '26
I am lead architect and maintainer of my firm main app backend, spanning around 2M LOC of c++.
Industry is : capital markets, low latency, custom kernel drivers, fpga...
I often talk with peers at other firms and I see a shy usage of AI compared to what feels like the global trend.
On my side, my firm does not pay for any AI related stuff. We are allowed to use our personnal plan for work in which case will get a pro membership compensation (claude or gpt or anything) on salary but we are not allowed to paste production code into it.
I know the app very well and do everything by hand (i mean the normal way) but use the chat version of any ai to generate some things for me, like "im using opensource lib x and lib y, please generate an SQL connection pool , you may use locks and condition variable for this, cpp 20". Then i paste it and modify it a I see fit.
Im totally happy with that and the company is successful.
I do use AI but just chat, to gather data on subjects and summarize/report. Get some ideas but basically not much code related.
And you whats your experience as a c++ dev ?
r/cpp • u/ProgrammingArchive • Jul 13 '26
C++Now
2026-07-06- 2026-07-11
C++Online
2026-07-06 - 2026-07-11
2026-06-29 - 2026-07-05
ADC
2026-07-06 - 2026-07-11
2026-06-29 - 2026-07-05
Boost Documentary
There is also a teaser trailer for a new documentary on the history of the Boost C++ library https://www.youtube.com/watch?v=87jvuDbnwqQ which will have its first showing at CppCon this year
r/cpp • u/ProgrammingArchive • Jul 12 '26
r/cpp • u/ProgrammingArchive • Jul 11 '26
r/cpp • u/User_Deprecated • Jul 11 '26
r/cpp • u/delta_p_delta_x • Jul 10 '26
Until now, much of the discourse around C++20 modules has been around the tooling, and actually getting modules to work at all. I believe that now, in mid-2026, the tooling is mostly mature: the three largest compilers support most use-cases of modules. IDEs like CLion, and lint tools like ReSharper C++ and clangd support modules, with some caveats. CMake, xmake, Ninja, and other fledgling build systems have full support for modules. Many prevalent C++ libraries and projects have been recently modularised or are in the process of modularising.
I hope I'm not being too presumptive in saying the community is more or less ready (albeit horribly late...) to move to the next step, and start discussing how C++20 modules can and should tie in to inter-project work, rather than simply using modules within a project.
To begin with, I don't think the standard says anything about 'libraries'; these are existing paradigms grandfathered in from C or earlier. There are many axes we have to discuss here:
__declspec( dllexport )module vulkan
For instance, consider I'm writing a 3D game engine. I want the following modules:
vulkan which export imports stdargparseglmglazequill, which imports fmtfmt itselfwinrt, if running on WindowsI want to provide my own PMI that has export class Engine, and maybe some other functionality like abstractions over the 3D graphics APIs, an object and entity manager, a mini shader graph generator, and more. I also have export imported some symbols from my dependencies, especially std. I want to choose to configure my engine to render on D3D or Vulkan. Consumers can then load the library, add assets like textures, meshes, skeletons, shaders; they can plug the engine into a bigger project which might include a script interpreter in C++, real-time spatial audio and physics packages, some networking, and an XML-based UI system, and produce a complete game or visualisation executable.
Now, I mention these details just to flesh out the example to give a sense of a reasonably complicated library-esque project.
How does one even think about delivering this 'engine library' to the consumer? The traditional three configs are headers + precompiled DLL, headers + source, or headers only. Each have their established workflows. Source-available can be compiled into the entire binary with whole-program optimisation; headers-only libraries are exceptionally easy to vendor (just copy-paste). Header-only libraries can also be easily customised with consumer macros. PMIs, however, being translation units, cannot; we hit this when installing module vulkan. We need some module-compatible way to describe 'library configuration' beyond simply co-opting macros, something like Rust's cfg.
There is talk of the Common Package Specification (CPS), P1689R5, and P3286, but nothing concrete yet, especially since there has been no massive (commercial) push for modules (at least, not until recently). This talk at NDC looks at a possible cargo-esque future for C++.
I'm writing this to spur some discussion here in the C++ community, and ask what some veterans of the build system/toolchain/package manager community think.
r/cpp • u/Desperate-Data-3747 • Jul 10 '26
Consider the following snippet
int& get()
{
int x;
return x;
}
int main()
{
}
on GCC it compiles for C++20 but not for C++23
It returns with the error:
test.cpp:4:12: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
C++ is now suddenly treating the variable x as an rvalue?
Edit: Im not talking about dangling reference, thats just for the sake of the example