C++ - Reddit
رفتن به کانال در Telegram
Stay up-to-date with everything C++! Content directly fetched from the subreddit just for you. Join our group for discussions : @programminginc Powered by : @r_channels
نمایش بیشتر228
مشترکین
اطلاعاتی وجود ندارد24 ساعت
اطلاعاتی وجود ندارد7 روز
اطلاعاتی وجود ندارد30 روز
آرشیو پست ها
228
Advent of Compiler Optimizations 1/25: Why xor eax, eax?
As already discussed here, a nice blog post and video from Matt Godbolt about common compiler optimization.
The statement that `xor eax, eax` effectively costs zero cycles caught my eye in particular:
\> It gets better though! Since this is a very common operation, x86 CPUs spot this “zeroing idiom” early in the pipeline and can specifically optimise around it: the out-of-order tracking systems knows that the value of “eax” (or whichever register is being zeroed) does not depend on the previous value of eax, so it can allocate a fresh, dependency-free zero register renamer slot. And, having done that it removes the operation from the execution queue \- that is the
xor takes zero execution cycles!^(1) It’s essentially optimised out by the CPU!
How do you know? I guess I can verify it in LLVM's MCA?
https://redd.it/1pbdrgo
@r_cpp228
TyMut - Fuzzing C++ Compilers via Type-Driven Mutation
https://dl.acm.org/doi/pdf/10.1145/3763094
https://redd.it/1pbce8m
@r_cpp
228
PSA: Enable `-fvisibility-inlines-hidden` in your shared libraries to avoid subtle bugs
https://holyblackcat.github.io/blog/2025/12/01/visibility-inlines-hidden.html
https://redd.it/1pb8nwy
@r_cpp
228
Solid ERP base in C/Cpp
Hey,
just wanna ask if there is any good, well thought ERP program open source available.
I don't want to waste time on the core functionalities...for but also want good readable not leaking code...
Thanks a lot...
https://redd.it/1pb7aus
@r_cpp
228
Standard Library implementer explains why they can't include source code licensed under the MIT license
https://www.reddit.com/r/cpp/comments/1p9zl23/comment/nrgufkd/
https://redd.it/1pb6573
@r_cpp
228
Just started programming with c++, had some Questions
Yo, I started studying CS (as a personal interest) about a week ago and I don't understand what to do with these loops (I know how loops and conditional statements work). I mean, how do I build something like a GUI or a messaging application?
https://redd.it/1paoyx5
@r_cpp
228
I developed a small 5G KPI analyzer for 5G base station generated Metrics (C++, no dependecies) as part of a 5G Test Automation project. This tool is designed to serve network operators very specialized needs
https://github.com/nidalaburaed/5GJ2C
https://redd.it/1pan5ge
@r_cpp
228
Looking for test coverage tool suggestions
Hi, I have a big cpp project which targets Windows (mainly, along Android and Linux). The main IDE the team uses is VS2022 and for testing the project make usage of Catch2.
I’m looking for suggestions about free test coverage tool that integrates well in this environment.
Thanks.
https://redd.it/1pagl2x
@r_cpp
228
I think this talk needs a lot more of attention than the views it got so far: strategies on how to make C++ safer over the years by John Lakos.
https://www.youtube.com/watch?v=6-MrKxsRI&t=2513s
https://redd.it/1pafgja
@r_cpp
228
CForge beta-v2.2.0 and v2.2.1 - A modern build system and project manager for C/C++
Hey everyone,
I've been working on CForge, a build system and project manager for C and C++ that aims to bring a more modern, streamlined experience to native development. Think of it as something like Cargo for Rust, but for C/C++ projects.
# What is CForge?
CForge is a CLI tool that wraps CMake and handles the tedious parts of C/C++ project management:
Project scaffolding \- `cforge init` creates a new project with a sensible structure and a simple `cforge.toml` config file
Dependency management \- Pull in Git repos or vcpkg packages with
cforge add, and CForge handles the rest
Simple build commands \- `cforge build`, `cforge run`, `cforge test` do what you'd expect
Workspaces \- Manage multiple related projects together (like Cargo workspaces)
Cross-platform \- Works on Windows (MSVC), Linux (GCC), and macOS (Clang)
The goal is to reduce the friction of starting and maintaining C/C++ projects without hiding CMake entirely. You can still drop down to raw CMake when needed.
# What's new in v2.2.0
This release adds a bunch of commands I've wanted for a while:
`cforge watch` \- File watcher that auto-rebuilds when you save. Add `--run` to automatically run after successful builds. Great for quick iteration.
`cforge bench` \- Google Benchmark integration. Run benchmarks with filtering and JSON/CSV output. (this is probably a little buggy, I haven't done extensive testing on it)
`cforge tree` \- Visualize your dependency tree in the terminal with color-coded output for different dependency types.
`cforge new` \- Scaffold files from templates. `cforge new class MyClass` generates the header and source file with boilerplate.
`cforge doc` \- Generate Doxygen documentation with a single command.
`cforge lock` \- Lock file support for reproducible builds. Commit `cforge.lock` to your repo and run `cforge lock --verify` in CI.
`cforge fmt` and `cforge lint` \- Wrappers around clang-format and clang-tidy.
`cforge completions` \- Generate shell completions for bash, zsh, fish, and PowerShell.
I also increased the default build timeout from 60s to 10 minutes, which should help on slower CI runners or large Release builds.
# What's new in v2.2.1
Patch release fixing several Windows-specific issues:
Fixed the cforge update command to actually work (it was cloning the repo but not building/installing)
Fixed file permission errors during self-update on Windows
Fixed CMake version parsing for release candidates and alpha versions
Fixed the `min`/`max` macro conflict that was breaking `cforge watch` on Windows
Standardized install paths so manual installs and cforge update put the binary in the same place
# Links
GitHub: [https://github.com/ChaseSunstrom/cforge](https://github.com/ChaseSunstrom/cforge)
Installation: Clone and run bootstrap.ps1 (Windows) or `bootstrap.sh` (Linux/macOS) or read: https://github.com/ChaseSunstrom/cforge/tree/master?tab=readme-ov-file#-installation
Would love to hear feedback, bug reports, or feature requests. Still in beta so expect some rough edges, but it's stable enough for personal projects and I've been using it daily.
https://redd.it/1pad2i6
@r_cpp228
C++ 20 Fitness retraining
I designed several systems in C++ years ago, mostly using Modern C++ (11/14). However, I’ve spent the last few years working heavily with Solidity/TypeScript/Node, and I feel like I’ve lost some of my “mental fitness” when it comes to C++ programming.
I want to return to the field, and I definitely need to re-skill to get sharp again—especially with C++20. I’m re-reading Effective Modern C++ by Meyers as a refresher, and it’s helping, but now I want to move forward into C++20.
What resources would you recommend? I found getcracked.io, which has a lot of C++20-style problems—does anyone know if it’s good?
As a side note, I have this strange feeling that many of us in our generation (I’m 46) were exposed to so much OOP that it’s sometimes hard to think outside the OOP box when modeling problems. It feels like it’s glued into your mind. I think OOP was great, but sometimes it feels like it went too far.
Do any of you feel the same way?
Thanks in advance.
https://redd.it/1pa9wou
@r_cpp
228
Why not C?
Sorry for dumb question, but your sub somehow ended in my feed. Why you choose it over plain C?
And also do you like new features, I think everything since 11 is complete garbage, that is why I switched back to C.
https://redd.it/1pa8mjh
@r_cpp
228
Are there many jobs for C++?
I'm having to learn C++ to use some binary instrumentation tools, and I'd like to know how you all see the job market for this language. Are there many opportunities? Since I already have to learn the basics to use the library, I might as well learn the language properly. I already know Rust, so it should be quick.
https://redd.it/1pa5r0u
@r_cpp
228
Is it (and if not, what technical reason is preventig from) possible to have optional fields based on generic struct value
Lets say I wanted to create a generic struct for a vector for storing coordinates withing n dimmensions. I could do a separate struct for each dimension, but I was wondering why couldn't I do it within a single non-specialized generic struct, something like so:
template<int n> struct Vector {
std::array<float, n> data;
float& X = data0;
float& Y = data1;
// Now lets say if n > 2, we also want to add the shorthand for Z
// something like:
#IF n > 2
float& Z = data2;
};
Is something like this a thing in C++? I know it could be done using struct specialization, but that involves alot of (unnecesearry) repeated code and I feel like there must be a better way(that doesnt involve using macros)
https://redd.it/1pa3d21
@r_cpp
228
Leadwerks 5 Launch Party - Live developer chat
https://youtu.be/-DACZW5cyB0?si=z2JqsEs7drU01WY6
https://redd.it/1pa3x3r
@r_cpp
228
The smallest state-of-the-art double-to-string implementation (in C++)
https://vitaut.net/posts/2025/smallest-dtoa/
https://redd.it/1p9zl23
@r_cpp
228
what do you think about this
\#include <iostream>
\#define print(x) std::cout << x;
int main() {
char x[\] = " hello";
print("im dave," << x)
return 0;
}
can this be a problem?
https://redd.it/1p9owjg
@r_cpp
228
StockholmCpp 0x3A: Intro, info and the quiz
https://youtu.be/XP5WLM1Fgw4
https://redd.it/1p9m48s
@r_cpp
228
Cutting C++ Exception Time by +90%? - Khalil Estell - CppCon 2025
https://youtu.be/wNPfs8aQ4oo
https://redd.it/1p9cxvd
@r_cpp
228
Parallel C++ for Scientific Applications: Roofline Model, Sparse Matrix Computation
https://www.youtube.com/watch?v=Y3XUt-obns8
https://redd.it/1p98cgs
@r_cpp
اکنون در دسترس! پژوهش تلگرام ۲۰۲۵ — مهمترین بینشهای سال 
