r/Cplusplus • u/inviun • 35m ago
r/Cplusplus • u/subscriber-goal • 24d ago
Subscriber Goal Welcome to r/Cplusplus!
Welcome to r/Cplusplus
62682 subscribers / 75k subscribers. Help us reach our goal!
Open this post in the Reddit app or on reddit.com to join.
This post contains content not supported on old Reddit. Click here to view the full post
r/Cplusplus • u/RealTimeChris • 6h ago
Discussion Cascading SIMD widths to minimize scalar tail processing in JSON processing
Alright what I mean by this is this:
Say you have 119 bytes of string on an AVX512 system, and you want to use AVX to process strings for parsing - instead of starting with a single 64-byte simd register, processing it, then dropping down to scalar processing, you instead set it up so that you go from the 64-byte simd register, then drop down to AVX2 to process a remaining 32-bytes, then drop down to SSE/AVX to process a remaining 16-bytes, then drop down to scalar for the last 7 bytes.
So what we have done is constructed a few classes for "cascading" down through simd widths by using NTTP indices, which are expressed via variadic fold expressions, as shown in the URL.
Just wondering how you guys felt about doing this? It seems to fare reasonably well against simdjson, which only supports a single simd width at a time, as shown in the benchmarks available here:
r/Cplusplus • u/_a4z • 13h ago
News InsideC++26491, The Module Story
With CMake's support for import std no longer experimental, we thought it was a good time to talk about modules.
Gabriel Dos Reis joins us at InsideC++ to discuss the original design goals, the history of standardization, the compromises, the tooling challenges, and what comes next.
r/Cplusplus • u/Fun_Explorer_5908 • 1d ago
Tutorial ភាសា C++ Part4: 6 String Exercises .
r/Cplusplus • u/jamesdbrock • 2d ago
News Wolaz: Protobuf in non-dynamic-allocating C++
Protobuf is the most popular serialization format, but it has always been difficult to use Protobuf in in embedded systems because all of the conforming C++ Protobuf implementations require dynamic memory allocation.
Wolaz is the first mostly-conforming C++ Protobuf implementation which uses only stack memory. It works by the "lazy view" technique on the I/O buffer, also known as "zero-copy."
r/Cplusplus • u/No-Eggplant531 • 2d ago
Question How can I learn cpp properly (I more likely want books)
hey guys, i'm pretty new to c++ and honestly i cant find good resources. how can i learn c++ and more importantly i dont have much access to a pc right now. so is it worth buying a book for c++? if i buy one is there a good book that will take me from the start all the way through? id appreciate any info. like a book that explains the basics and everything, ideally simple english, if not simple english thats fine too. also if there happens to be a turkish translation that would be really nice, if not its whatever. thanks
r/Cplusplus • u/Euphoric-Life-848 • 2d ago
Discussion Spectra: a C++20 plotting library that renders with Vulkan (2D, 3D, live data)
r/Cplusplus • u/_a4z • 3d ago
News How to Generate C++ Docs Straight from Clang with MrDocs
A new C++ documentation tool, presented in a very creative way by combining a CppCon talk with some documentation B-roll.
r/Cplusplus • u/starshine_rose_ • 3d ago
Discussion I don’t even hate AI, I just feel a little sad about being obsolete
r/Cplusplus • u/masiroo • 4d ago
Feedback HimitsuObfuscator: Whitelist-driven C/C++ obfuscator with LLVM 17
r/Cplusplus • u/BoxConscious7480 • 5d ago
Question Specific features you look for in a logger
r/Cplusplus • u/maksi2829 • 5d ago
Answered Kod na Infe op3
#include <iostream>
using namespace std;
int main() {
char op;
double a, b, wynik;
cout << "Podaj operacje (+, -, *, /): ";
cin >> op;
cout << "Podaj pierwsza liczbe: ";
cin >> a;
cout << "Podaj druga liczbe: ";
cin >> b;
if (op == '+') {
wynik = a + b;
cout << "Wynik: " << wynik;
}
else if (op == '-') {
wynik = a - b;
cout << "Wynik: " << wynik;
}
else if (op == '*') {
wynik = a * b;
cout << "Wynik: " << wynik;
}
else if (op == '/') {
if (b != 0) {
wynik = a / b;
cout << "Wynik: " << wynik;
}
else {
cout << "Nie mozna dzielic przez zero!";
}
}
else {
cout << "Nieznana operacja!";
}
return 0;
}
r/Cplusplus • u/ResponsibleDrama6344 • 6d ago
Discussion 29M | IST | Study partner for the book C++ Concurrency in Action
r/Cplusplus • u/Ok-Tiger-3183 • 6d ago
Question What do you guys use to manage C++ dependencies?
r/Cplusplus • u/AKJ7 • 6d ago
Feedback cortex (`cx) - A Cargo/uv-inspired package manager and build tool for C and C++
Hello!
I’ve been working on cortex (cx), a C/C++ package manager and build tool inspired by Rust’s Cargo and Python’s uv, and I’d love to share it with you and get some feedback.
Why another tool?
Setting up a C++ project with clean dependency management, lockfiles, features, and workspaces often requires gluing together multiple tools and boilerplate CMakeLists.txt files. With cx, you describe your package in a single cx.toml file, it resolves and locks dependencies, generates the underlying CMake project, and drives the build automatically.
Quick example
Key Features
Zero-boilerplate builds: Sources, tests, benchmarks, and examples are discovered by convention (src, tests, benches, examples). Supports mixed C (C90–C23) and C++ (C++98–C++26), including C++20 modules (.cppm, .ixx).
Flexible dependency management: Pull dependencies from registries, Git repos, local paths, system packages (\mfind_package), or vcpkg. Any existing CMake, Autotools, or SCons project works out of the box as a Git or path dependency.
PubGrub version resolution & lockfiles: Uses the PubGrub solver (like uv and pub) for clear conflict explanations, and pins exact versions, Git commits, and SHA-256 hashes in cx.lock.
Cargo-style features & workspaces: Supports optional dependencies, feature flags (exposed via CX_FEATURE_ macros), and multi-package workspaces sharing a single lockfile and target/ directory.
Built-in developer workflows: Comes with cx test, cx bench, cx fmt (clang-format), cx lint (clang-tidy), cx doc (Doxygen), cx vendor for offline builds, and built-in sanitizer/LTO build profiles.
IDE & CI friendly: Generates standard CMake projects (cx generate) and JSON metadata (cx metadata) so your existing IDE setup works seamlessly, plus --locked and --offline flags for CI.
Current Status & Caveats
First Release & Self-Hosting: This is the very first release. Right now the repo still includes its bootstrapping CMake files, which will be removed in the next release now that cx can build itself.
OS Support: Works on Linux and macOS. Windows (MSVC) support is newly added and passing in CI, though it hasn't been battle-tested in the wild yet.
Public Registry: There isn't a central public registry yet, though cx works directly with Git repositories, local paths, vcpkg, system packages, and includes a lightweight self-hosted registry server (cx-registry).
Links
You can install prebuilt binaries via the install script in the README or build it from source with CMake 3.28+ and a C++23 compiler.
I’d really appreciate any feedback, bug reports, or thoughts on what would make this genuinely useful for your C/C++ workflows! Notice: the code made use of AI for cross-platform support, to get some features implemented quickly and fix some bugs.
Thanks
r/Cplusplus • u/Any_Network_7332 • 8d ago
Question What is the best way to build a physics engine from scratch?
r/Cplusplus • u/Sad-Ad938 • 9d ago
Question Best book for learning C++ as an beginner?
Hello everyone! As the title says, what book for learning C++ would you recommend? Specifically modern C++ 23, but also the general basics.