Why everyone hates on C/C++ source generation?
It allows me to do magical reflection-related things in both C and C++
* it's faster than in-language metaprogramming (see zig's metaprog for example, slows down hugely the compiler) (and codegen is faster because the generator can be written in C itself and run natively with -O3 instead of being interpreted by the language's metaprogramming vm, plus it can be easily be executed manually only when needed instead of at each compilation like how it happens with in language metaprog.).
* it's easier to debug, you can print stuff during the codegen, but also insert text in the output file
* it's easier to read, write and maintain, usually procedural meta programming in other languages can get very "mechanical" looking, it almost seems like you are writing a piece of the compiler (for example
pub fn Vec(comptime T: type) type {
const fields = _std.builtin.Type.StructField{
.{ .name = "x", .type = T, .defaultvalue = null, .iscomptime = false, .alignment = 0 },
.{ .name = "y", .type = T, .defaultvalue = null, .iscomptime = false, .alignment = 0 },
.{ .name = "z", .type = T, .defaultvalue = null, .iscomptime = false, .alignment = 0 },
.{ .name = "w", .type = T, .defaultvalue = null, .iscomptime = false, .alignment = 0 },
};
return @Type(.{ .Struct = .{
.layout = .auto,
.fields = fields0..,
.decls = &.{},
.istuple = false,
}});
}
versus sourcegen noscript that simply says "struct {name} ..."
\* it's the only way to do stuff like SOA for now.. and c++26 reflection looks awful (and super flow)
However I made a post about it on both r/CProgramming and r/cpp and everyone hated on it
https://redd.it/1pgoc4y
@r_cpp
It allows me to do magical reflection-related things in both C and C++
* it's faster than in-language metaprogramming (see zig's metaprog for example, slows down hugely the compiler) (and codegen is faster because the generator can be written in C itself and run natively with -O3 instead of being interpreted by the language's metaprogramming vm, plus it can be easily be executed manually only when needed instead of at each compilation like how it happens with in language metaprog.).
* it's easier to debug, you can print stuff during the codegen, but also insert text in the output file
* it's easier to read, write and maintain, usually procedural meta programming in other languages can get very "mechanical" looking, it almost seems like you are writing a piece of the compiler (for example
pub fn Vec(comptime T: type) type {
const fields = _std.builtin.Type.StructField{
.{ .name = "x", .type = T, .defaultvalue = null, .iscomptime = false, .alignment = 0 },
.{ .name = "y", .type = T, .defaultvalue = null, .iscomptime = false, .alignment = 0 },
.{ .name = "z", .type = T, .defaultvalue = null, .iscomptime = false, .alignment = 0 },
.{ .name = "w", .type = T, .defaultvalue = null, .iscomptime = false, .alignment = 0 },
};
return @Type(.{ .Struct = .{
.layout = .auto,
.fields = fields0..,
.decls = &.{},
.istuple = false,
}});
}
versus sourcegen noscript that simply says "struct {name} ..."
\* it's the only way to do stuff like SOA for now.. and c++26 reflection looks awful (and super flow)
However I made a post about it on both r/CProgramming and r/cpp and everyone hated on it
https://redd.it/1pgoc4y
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community
Recursion
Recursion is when you explain recursion using recursion.
#recursion #programming
https://redd.it/1ph7bdy
@r_cpp
Recursion is when you explain recursion using recursion.
#recursion #programming
https://redd.it/1ph7bdy
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community
CLion 2025.3 released
https://blog.jetbrains.com/clion/2025/12/2025-3-release/
https://redd.it/1phdx0v
@r_cpp
https://blog.jetbrains.com/clion/2025/12/2025-3-release/
https://redd.it/1phdx0v
@r_cpp
The JetBrains Blog
CLion 2025.3 Is Here, and It’s Epic: Faster Language Engine, Unique Constexpr Debugger, DAP Support, and Much More | The CLion…
This is one of our largest updates ever, featuring advanced capabilities and refinements to deliver a smoother workflow.
I built an open-source Order Matching Engine from scratch to understand how real exchanges work
My main goals were:
Learn how real-world matching systems work
Study low-latency design tradeoffs
Build something useful for other devs learning system design
I’d genuinely love feedback on:
Architecture decisions
Performance bottlenecks
What features would make this more production-ready
GitHub: https://github.com/PIYUSH-KUMAR1809/order-matching-engine
https://redd.it/1phdp7g
@r_cpp
My main goals were:
Learn how real-world matching systems work
Study low-latency design tradeoffs
Build something useful for other devs learning system design
I’d genuinely love feedback on:
Architecture decisions
Performance bottlenecks
What features would make this more production-ready
GitHub: https://github.com/PIYUSH-KUMAR1809/order-matching-engine
https://redd.it/1phdp7g
@r_cpp
GitHub
GitHub - PIYUSH-KUMAR1809/order-matching-engine
Contribute to PIYUSH-KUMAR1809/order-matching-engine development by creating an account on GitHub.
New C++ Conference Videos Released This Month - December 2025
CppCon
2025-12-01 - 2025-12-07
Optimize Automatic Differentiation Performance in C++ - Steve Bronder - [https://youtu.be/\_YCbGWXkOuo](https://youtu.be/_YCbGWXkOuo)
Is Your C++ Code Leaking Memory? Discover the Power of Ownership-Aware Profiling - Alecto Irene Perez - https://youtu.be/U23WkMWIkkE
The Dangers of C++: How to Mitigate Them and Write Safe C++ - Assaf Tzur-El - [https://youtu.be/6eYCMcOYbYA](https://youtu.be/6eYCMcOYbYA)
Implementing Your Own C++ Atomics - Ben Saks - CppCon 2025 - https://youtu.be/LtwQ7xZZIF4
Building Secure C++ Applications: A Practical End-to-End Approach - Chandranath Bhattacharyya & Bharat Kumar - [https://youtu.be/GtYD-AIXBHk](https://youtu.be/GtYD-AIXBHk)
C++Now
2025-12-01 - 2025-12-07
Lightning Talk: I Now Maybe Understand C++ Hazard Pointers - Denis Yaroshevskiy - https://youtu.be/VKbfinz6D04
Lightning Talk: constexpr Copyright - Ben Deane - [https://youtu.be/WHgZIC-lsiU](https://youtu.be/WHgZIC-lsiU)
Lightning Talk: Replace Git With JJ - Your New Version Control & DevOps Solution - Matt Kulukundis - https://youtu.be/mbK8szLJ-2w
ACCU Conference
2025-12-01 - 2025-12-07
Programming Puzzles - Programming Challenge - Pete Goodliffe - ACCU 2025 Short Talks - [https://youtu.be/jq\_dJPSi\_3M](https://youtu.be/jq_dJPSi_3M)
C++20 Ranges - The Stuff of Science Fiction - Stewart Becker - ACCU 2025 Short Talks - https://youtu.be/Key-bfvDHcE
C++ Keywords Speak for Themselves - Jon Kalb - ACCU 2025 Short Talks - [https://youtu.be/zv9eTr1dCU0](https://youtu.be/zv9eTr1dCU0)
C++ on Sea
2025-12-01 - 2025-12-07
Lightning Talk: Pólya Performance Thinking - Andrew Drakeford - https://youtu.be/qZPBr\_jhE1o
Lightning Talk: Teaching the NES - What 6502 Assembly Reveals About Modern C++ - Tom Tesch - [https://youtu.be/gCM5t0Txf8U](https://youtu.be/gCM5t0Txf8U)
Lightning Talk: Terminating Your Bugs With Time Travel and AI - Rashmi Khetan - https://youtu.be/-OrJyN2Mw7s
Meeting C++
2025-12-01 - 2025-12-07
Our Most Treacherous Adversary - James McNellis - Meeting C++ 2025 lightning talks - [https://www.youtube.com/watch?v=zC\_uwGqSLqQ](https://www.youtube.com/watch?v=zC_uwGqSLqQ)
Let them eat cake - Rahel Natalie Engel - Meeting C++ 2025 lightning talks - https://www.youtube.com/watch?v=gQ6grpbhW8k
https://redd.it/1phh6ae
@r_cpp
CppCon
2025-12-01 - 2025-12-07
Optimize Automatic Differentiation Performance in C++ - Steve Bronder - [https://youtu.be/\_YCbGWXkOuo](https://youtu.be/_YCbGWXkOuo)
Is Your C++ Code Leaking Memory? Discover the Power of Ownership-Aware Profiling - Alecto Irene Perez - https://youtu.be/U23WkMWIkkE
The Dangers of C++: How to Mitigate Them and Write Safe C++ - Assaf Tzur-El - [https://youtu.be/6eYCMcOYbYA](https://youtu.be/6eYCMcOYbYA)
Implementing Your Own C++ Atomics - Ben Saks - CppCon 2025 - https://youtu.be/LtwQ7xZZIF4
Building Secure C++ Applications: A Practical End-to-End Approach - Chandranath Bhattacharyya & Bharat Kumar - [https://youtu.be/GtYD-AIXBHk](https://youtu.be/GtYD-AIXBHk)
C++Now
2025-12-01 - 2025-12-07
Lightning Talk: I Now Maybe Understand C++ Hazard Pointers - Denis Yaroshevskiy - https://youtu.be/VKbfinz6D04
Lightning Talk: constexpr Copyright - Ben Deane - [https://youtu.be/WHgZIC-lsiU](https://youtu.be/WHgZIC-lsiU)
Lightning Talk: Replace Git With JJ - Your New Version Control & DevOps Solution - Matt Kulukundis - https://youtu.be/mbK8szLJ-2w
ACCU Conference
2025-12-01 - 2025-12-07
Programming Puzzles - Programming Challenge - Pete Goodliffe - ACCU 2025 Short Talks - [https://youtu.be/jq\_dJPSi\_3M](https://youtu.be/jq_dJPSi_3M)
C++20 Ranges - The Stuff of Science Fiction - Stewart Becker - ACCU 2025 Short Talks - https://youtu.be/Key-bfvDHcE
C++ Keywords Speak for Themselves - Jon Kalb - ACCU 2025 Short Talks - [https://youtu.be/zv9eTr1dCU0](https://youtu.be/zv9eTr1dCU0)
C++ on Sea
2025-12-01 - 2025-12-07
Lightning Talk: Pólya Performance Thinking - Andrew Drakeford - https://youtu.be/qZPBr\_jhE1o
Lightning Talk: Teaching the NES - What 6502 Assembly Reveals About Modern C++ - Tom Tesch - [https://youtu.be/gCM5t0Txf8U](https://youtu.be/gCM5t0Txf8U)
Lightning Talk: Terminating Your Bugs With Time Travel and AI - Rashmi Khetan - https://youtu.be/-OrJyN2Mw7s
Meeting C++
2025-12-01 - 2025-12-07
Our Most Treacherous Adversary - James McNellis - Meeting C++ 2025 lightning talks - [https://www.youtube.com/watch?v=zC\_uwGqSLqQ](https://www.youtube.com/watch?v=zC_uwGqSLqQ)
Let them eat cake - Rahel Natalie Engel - Meeting C++ 2025 lightning talks - https://www.youtube.com/watch?v=gQ6grpbhW8k
https://redd.it/1phh6ae
@r_cpp
Long long is faster than int?
Most of the programmers probably would be fine with int when there are no chances of overflow.
I came across a stack overflow article recently, justifying the reasons behind it.
Though one would hardly care about the difference.
But the thread explains it out very well and it was cool to know about it.
https://redd.it/1phkyy9
@r_cpp
Most of the programmers probably would be fine with int when there are no chances of overflow.
I came across a stack overflow article recently, justifying the reasons behind it.
Though one would hardly care about the difference.
But the thread explains it out very well and it was cool to know about it.
https://redd.it/1phkyy9
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community
where to post programs where other people can run it?
hello, I am a software engineering student and I just finished my first big coding project for school- a text based version of blackjack. is there somewhere I can publish this so my family can play it and not have to download an IDE or anything? like a website they can visit and play it? thank you
https://redd.it/1phtiee
@r_cpp
hello, I am a software engineering student and I just finished my first big coding project for school- a text based version of blackjack. is there somewhere I can publish this so my family can play it and not have to download an IDE or anything? like a website they can visit and play it? thank you
https://redd.it/1phtiee
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community
Two months into my ECS journey, here's where I'm at.
https://github.com/unrays/Exotic
https://redd.it/1phvurx
@r_cpp
https://github.com/unrays/Exotic
https://redd.it/1phvurx
@r_cpp
GitHub
GitHub - unrays/Exotic: Experimental ECS engine designed for meta-programming and next-level component patterns.
Experimental ECS engine designed for meta-programming and next-level component patterns. - unrays/Exotic
Curious to know about developers that steered away from OOP. What made you move away from it? Why? Where has this led you?
TLDR: i'm just yapping about where I come from but am very interested about what I asked you about in the noscript!
So I been all in into developing games for 2 years now coming from a 3D artist background and became recently very serious about programming after running into countless bottlenecks such as runtime lag spikes, slow code, unscalable code (coupling), code design too content heavy (as in art assets and code branching logic) and so on.
But while learning about programming and making projects, I always found that something about OOP just always felt off to me. But I never was able to clearly state why.
Now I know the hardware dislikes cache misses but I mean it still runs...
Thing is there's something else. People say they use OOP to make "big projects more scalable" but I kind of doubt it... It looks to me like societal/industry technical debt. Because I don't agree that it makes big projects much more scalable. To me, it feels like it's just kind of delaying inevitable spaghetti code. When your building abstraction on top of abstraction, it feels just so... subjective and hard to keep track of. So brittle. Once too big, you can't just load into your brain all the objects and classes to keep track of things to keep developing there comes a point where you forget about things and end up rewriting things anyway. And worst case about that is if you rewrite something that was already written layers beneath where now you're just stacking time delays and electricity/hardware waste at this point. Not only to mention how changing a parent or shared code can obliterate 100 other things. And the accumulation of useless junk from inheritance that you don't need but that'll take ram space and even sometimes executions. Not only to mention how it forces (heavily influences) you into making homogeneous inheritance with childrens only changing at a superficial level. If you look at OOP heavy games for example, they are very static. They are barely alive barely anything is being simulated they just fake it with a ton of content from thousands of artists...
Like I get where it's power lies. Reuse what has been built. Makes sense. But with how economy and private businesses work in our world, technical debt has been shipped and will keep being shipped and so sure I get it don't reinvent the wheel but at the same time we're all driving a car with square wheels wondering why our gas bills are ramping up...
So with that being said, I been looking for a way out of this madness.
Ignorant me thought the solution was about learning all about multithread and gpu compute trying to brute force shit code into parallelism lol.
But I just now discovered the field of data structure and algorithms and for the first time in who knows how long I felt hope. The only downside is now you need to learn how to think like a machine. And ditch the subjective abstract concepts of OOP to find yourself having to deal with the abstraction of math and algorithms lol
But yeah so I was hoping I could hear about others that went through something similar. Or maybe to have my ignorance put in check I may be wrong about all of it lol. But I was curious to know if any of you went through the same thing and if that has led you anywhere. Would love to hear about your experience with the whole object oriented programming vs data oriented programming clash. And what better place to come ask this other than the language where the two worlds collide! :D
https://redd.it/1phxghq
@r_cpp
TLDR: i'm just yapping about where I come from but am very interested about what I asked you about in the noscript!
So I been all in into developing games for 2 years now coming from a 3D artist background and became recently very serious about programming after running into countless bottlenecks such as runtime lag spikes, slow code, unscalable code (coupling), code design too content heavy (as in art assets and code branching logic) and so on.
But while learning about programming and making projects, I always found that something about OOP just always felt off to me. But I never was able to clearly state why.
Now I know the hardware dislikes cache misses but I mean it still runs...
Thing is there's something else. People say they use OOP to make "big projects more scalable" but I kind of doubt it... It looks to me like societal/industry technical debt. Because I don't agree that it makes big projects much more scalable. To me, it feels like it's just kind of delaying inevitable spaghetti code. When your building abstraction on top of abstraction, it feels just so... subjective and hard to keep track of. So brittle. Once too big, you can't just load into your brain all the objects and classes to keep track of things to keep developing there comes a point where you forget about things and end up rewriting things anyway. And worst case about that is if you rewrite something that was already written layers beneath where now you're just stacking time delays and electricity/hardware waste at this point. Not only to mention how changing a parent or shared code can obliterate 100 other things. And the accumulation of useless junk from inheritance that you don't need but that'll take ram space and even sometimes executions. Not only to mention how it forces (heavily influences) you into making homogeneous inheritance with childrens only changing at a superficial level. If you look at OOP heavy games for example, they are very static. They are barely alive barely anything is being simulated they just fake it with a ton of content from thousands of artists...
Like I get where it's power lies. Reuse what has been built. Makes sense. But with how economy and private businesses work in our world, technical debt has been shipped and will keep being shipped and so sure I get it don't reinvent the wheel but at the same time we're all driving a car with square wheels wondering why our gas bills are ramping up...
So with that being said, I been looking for a way out of this madness.
Ignorant me thought the solution was about learning all about multithread and gpu compute trying to brute force shit code into parallelism lol.
But I just now discovered the field of data structure and algorithms and for the first time in who knows how long I felt hope. The only downside is now you need to learn how to think like a machine. And ditch the subjective abstract concepts of OOP to find yourself having to deal with the abstraction of math and algorithms lol
But yeah so I was hoping I could hear about others that went through something similar. Or maybe to have my ignorance put in check I may be wrong about all of it lol. But I was curious to know if any of you went through the same thing and if that has led you anywhere. Would love to hear about your experience with the whole object oriented programming vs data oriented programming clash. And what better place to come ask this other than the language where the two worlds collide! :D
https://redd.it/1phxghq
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community
C#-style property in C++
https://vorbrodt.blog/2025/12/05/c-style-property-in-c/
https://redd.it/1pi12u7
@r_cpp
https://vorbrodt.blog/2025/12/05/c-style-property-in-c/
https://redd.it/1pi12u7
@r_cpp
Vorbrodt's C++ Blog
C#-style property in C++
C# has a nice feature called class/struct property. It is a public data member but with the ability to control read/write access, underlying storage or to compute the value on the fly. You can thin…
Clang's lifetime analysis can now suggest the insertion of missing
https://github.com/llvm/llvm-project/commit/5a74f7ea9938
https://redd.it/1pi1dpf
@r_cpp
https://github.com/llvm/llvm-project/commit/5a74f7ea9938
https://redd.it/1pi1dpf
@r_cpp
GitHub
[LifetimeSafety] Suggest lifetime annotations (#169767) · llvm/llvm-project@5a74f7e
Add lifetime annotation suggestion in lifetime analysis.
This PR introduces a new feature to Clang's lifetime analysis to detect
and suggest missing `[[clang::lifetimebound]]` annotations ...
This PR introduces a new feature to Clang's lifetime analysis to detect
and suggest missing `[[clang::lifetimebound]]` annotations ...
Converting My Codebase to C++20 Modules. Part 1
https://alexsyniakov.com/2025/11/25/converting-my-codebase-to-c20-modules-part-1/
https://redd.it/1pi3n9a
@r_cpp
https://alexsyniakov.com/2025/11/25/converting-my-codebase-to-c20-modules-part-1/
https://redd.it/1pi3n9a
@r_cpp
Alex on software development
Converting My Codebase to C++20 Modules. Part 1
Today’s post is about C++20 modules and my own journey of converting an existing codebase into modules – with the help of AI. After years of waiting, I can finally say the attempt was success…
IDE for C++
Hi,
I'm currently using Code::Blocks and VS Code to code C++ and everything else.
I think about switching to a real IDE, but I can't choose between Visual Studio Community and Clion. Which of the two IDEs to choose and is better?
https://redd.it/1pi53fv
@r_cpp
Hi,
I'm currently using Code::Blocks and VS Code to code C++ and everything else.
I think about switching to a real IDE, but I can't choose between Visual Studio Community and Clion. Which of the two IDEs to choose and is better?
https://redd.it/1pi53fv
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community
Dependency Injection In c++
Hey, curious about the preferred dependency injection patterns in modern c++. preferably c++20 and above.
https://redd.it/1pi5fro
@r_cpp
Hey, curious about the preferred dependency injection patterns in modern c++. preferably c++20 and above.
https://redd.it/1pi5fro
@r_cpp
What to expect in Kodiak AI Interview
I have an upcoming interview with Kodiak AI for a C++ Motion Planning New Grad role on their Autonomy team, and I’m trying to get a realistic idea of what the technical rounds look like. For folks who have interviewed there (or at similar AV/autonomy companies):
How much of the interview is “standard” C++ LeetCode-style questions vs questions focused on autonomy algorithms (motion planning, behavior planning, trajectory generation, computational geometry, controls?
My background is in robotics and motion planning with intermediate knowledge C++ as I’ve mainly used it in ROS codes, so I’m wondering how to split prep time between LeetCode, core C++ fundamentals, and autonomy-specific algorithm/design prep. Any insight or recent experiences would be hugely appreciated.
https://redd.it/1pibqct
@r_cpp
I have an upcoming interview with Kodiak AI for a C++ Motion Planning New Grad role on their Autonomy team, and I’m trying to get a realistic idea of what the technical rounds look like. For folks who have interviewed there (or at similar AV/autonomy companies):
How much of the interview is “standard” C++ LeetCode-style questions vs questions focused on autonomy algorithms (motion planning, behavior planning, trajectory generation, computational geometry, controls?
My background is in robotics and motion planning with intermediate knowledge C++ as I’ve mainly used it in ROS codes, so I’m wondering how to split prep time between LeetCode, core C++ fundamentals, and autonomy-specific algorithm/design prep. Any insight or recent experiences would be hugely appreciated.
https://redd.it/1pibqct
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community
Can you survive the type deduction gauntlet?
https://www.volatileint.dev/posts/auto-type-deduction-gauntlet/
https://redd.it/1pieusd
@r_cpp
https://www.volatileint.dev/posts/auto-type-deduction-gauntlet/
https://redd.it/1pieusd
@r_cpp
Volatile Int
Can You Survive the C++ Auto Type Deduction Gauntlet?
One of the most iconic C++ features is the language’s ability to deduce types with the auto keyword. In this post, I’ll give a series of code snippits. Your job is to assess what will be deduced for v in each case. Determine for each:
The deduced type
If…
The deduced type
If…
[Show and Tell] u8ility: A C++20/23 header-only, zero-allocation UTF-8 view library
Hi r/cpp,
This is my first post in this subreddit, so I'll try my best to follow the guidelines and provide some value!
Back in 2021, I started working on a simple UTF-8 library to avoid the dependency overhead required for basic codepoint interaction in my project. \
I recently dusted it off and decided to completely rewrite it to create the thinnest possible wrapper around std::string_view, to meet modern C++ standards that provide correct iteration of code points, focusing solely on performance and ergonomics.
### Key Design Principles:
- **Header-only**: Ease of use by providing complete details on what's under the hood
- **Zero-Allocation**: The core character type (`u8::mchar`) is a small, stack-based value type (max 5 bytes). It avoids heap allocation entirely during iteration
- **Cache-Friendly**: By avoiding pointers and virtual calls, it ensures high cache locality when iterating
- **Constexpr**: Allows encoding, decoding, and basic character validation at compile-time
- **Ergonomic**: Provides an u8::u8_view that works flawlessly with range-based for loops
I believe this offers an efficient alternative to full-featured libraries *when you just need quick, safe access to UTF-8 characters within existing `std::string` data*.
I'd love your roast/feedback on the current implementation. I'm especially interested in whether the char8_t vs char interoperability feels correct and how I could further improve validation logic without breaking the zero-allocation rule.
Here is [the Github link](https://github.com/lmela0/u8ility) 🙏
`https://github.com/lmela0/u8ility`
https://redd.it/1pilv04
@r_cpp
Hi r/cpp,
This is my first post in this subreddit, so I'll try my best to follow the guidelines and provide some value!
Back in 2021, I started working on a simple UTF-8 library to avoid the dependency overhead required for basic codepoint interaction in my project. \
I recently dusted it off and decided to completely rewrite it to create the thinnest possible wrapper around std::string_view, to meet modern C++ standards that provide correct iteration of code points, focusing solely on performance and ergonomics.
### Key Design Principles:
- **Header-only**: Ease of use by providing complete details on what's under the hood
- **Zero-Allocation**: The core character type (`u8::mchar`) is a small, stack-based value type (max 5 bytes). It avoids heap allocation entirely during iteration
- **Cache-Friendly**: By avoiding pointers and virtual calls, it ensures high cache locality when iterating
- **Constexpr**: Allows encoding, decoding, and basic character validation at compile-time
- **Ergonomic**: Provides an u8::u8_view that works flawlessly with range-based for loops
I believe this offers an efficient alternative to full-featured libraries *when you just need quick, safe access to UTF-8 characters within existing `std::string` data*.
I'd love your roast/feedback on the current implementation. I'm especially interested in whether the char8_t vs char interoperability feels correct and how I could further improve validation logic without breaking the zero-allocation rule.
Here is [the Github link](https://github.com/lmela0/u8ility) 🙏
`https://github.com/lmela0/u8ility`
https://redd.it/1pilv04
@r_cpp
GitHub
GitHub - lmela0/u8ility: A lightweight, header-only, zero-allocation C++20 library for easy UTF-8 string iteration and manipulation.
A lightweight, header-only, zero-allocation C++20 library for easy UTF-8 string iteration and manipulation. - lmela0/u8ility
std::move doesn't move anything: A deep dive into Value Categories
https://0xghost.dev/blog/std-move-deep-dive/
https://redd.it/1pin1hj
@r_cpp
https://0xghost.dev/blog/std-move-deep-dive/
https://redd.it/1pin1hj
@r_cpp
0xghost.dev
std::move doesn't move anything: A deep dive into Value Categories
Why std::move is just a cast, how it kills RVO if used wrong, and the mechanics of ownership transfer.
Time in C++: std::chrono::high_resolution_clock — Myths and Realities
https://www.sandordargo.com/blog/2025/12/10/clocks-part-4-high_resolution_clock
https://redd.it/1piwky8
@r_cpp
https://www.sandordargo.com/blog/2025/12/10/clocks-part-4-high_resolution_clock
https://redd.it/1piwky8
@r_cpp
Sandor Dargo’s Blog
Time in C++: std::chrono::high_resolution_clock — Myths and Realities
If there’s one clock in <chrono> that causes the most confusion, it’s std::chrono::high_resolution_clock. The name sounds too tempting — who wouldn’t want “the highest resolution”? But like many things in C++, the details matter. In the earlier parts of this…