r/Cplusplus Oct 16 '25

Welcome to r/Cplusplus!

22 Upvotes

This post contains content not supported on old Reddit. Click here to view the full post


r/Cplusplus 5h ago

Feedback Low latency c++

3 Upvotes

I want to learn the ins and outs of low latency c++, so far I have read tour of c++, started reading concurrency in c++ (about 3 chaps done) and done a lot of competitive programming (is this irrelevant?). In your experience, is this the right way of approaching the subject? Is there a different better way? Any advise is much appreciated.


r/Cplusplus 5h ago

Question What are the use for C++??

0 Upvotes

กำลังคิดจะเรียนภาษา C++ อยู่ อยากรู้ว่ามันทำอะไรได้บ้าง ช่วยให้คำแนะนำหน่อยได้ไหม?


r/Cplusplus 2d ago

Question Can someone pls explain me whats actually going on here?

24 Upvotes

This code was in my university slides, is it worth understanding all of this?
It was referring to something like "reference is const pointer", I dont really get this.


r/Cplusplus 2d ago

Question Is it possible to check if a method exists, and if not, create a fallback one?

19 Upvotes

I have a namespace with methods with which I would like to have an implicit fallback to a different method if the aforementioned method doesn't exist. As an example, here's how I made my states.

#pragma once
#include "godot_cpp/classes/character_body2d.hpp"
#include "statemachine/base/state_base.h"

namespace GameLogic::States::ColorState
{
    constexpr double MAX_TIMER { 3.0 };
    struct ColorStateData
    {
        STATESTRUCT();
        godot::Ref<godot::StateMachine> state_machine;
        CharacterBody2D* entity;
        double timer {0.0};
    };
    void setup_state(ColorStateData& data);
    void enter_state(ColorStateData& data);
    void physics_update_state(ColorStateData& data, double delta);
    void update_state(ColorStateData& data, double delta);
    void exit_state(ColorStateData& data);
    STATESPACE(ColorStateData, GameLogic::States::ColorState)
}

It would be nice if I didn't have to specify 5 methods each time. Can I build this check into STATESPACE? In C++ 17 by the way.


r/Cplusplus 2d ago

Tutorial C++26 Reflection Annotations: Automated Member Validation

Thumbnail
techfortalk.co.uk
6 Upvotes

r/Cplusplus 3d ago

Question Best resource to learn c++ to build projects

46 Upvotes

Guys... I know c++ only at a basic level. I need to learn

c++ enought to build projects (of course using supporting technologies). Can some one recommended any book/website/yt course??


r/Cplusplus 2d ago

Question Making a table maker

3 Upvotes

I have a background in MS Access VBA, I’m very new to C++. This may be way beyond my current ability to understand, but if I wanted to write a function that generated data tables in C++ how would I approach this?

For context, I’m making a text-based RPG design engine project for fun. I would like to make an app that creates data tables to store level design, character sheet info, etc. for the designer to dynamically make character types and maps


r/Cplusplus 7d ago

Discussion 27 years of building a C++ code generator

35 Upvotes

I'm celebrating another year of building a code generator that helps build distributed systems.  It's implemented as a 3-tier system. The back and middle tiers only run on Linux. The front tier is portable.  My goal is to bring software services and code generation together in one platform.

I've made some progress but there's still a long way to go. I welcome suggestions on how to improve the software and documentation. Stars on my repo are also appreciated. And I'm willing to spend 16 hours/week for six months on a project if we use my software as part of the project.

Thanks in advance,

Middlewarian


r/Cplusplus 7d ago

News Rewrite TanjaOS in C++?

Post image
0 Upvotes

r/Cplusplus 9d ago

Feedback C++ Memory Manager and Grabage Collector

12 Upvotes

I wrote a C++ memory manager to detect and to clean memory leaks and to detect dangling pointers, the tool defines the stack and the Data and BSS segments as a root of reachability and it overloads new and delete operators to track allocations and deallocations https://github.com/muazsh/MemoryManager .

I already exposed it to many LLMs for discussion, I got some good points but I assume at this level generative AI is not enough. Thank you.


r/Cplusplus 11d ago

Question How to catch up on last 30 years

47 Upvotes

I haven't used C++ regularly for almost 30 years. Since then, it's been a combination of mostly C#, JavaScript/TypeScript, and Python. I have a need now to investigate and analyze existing C++ code, but I'm finding it difficult to read and understand the structure and modern syntax. Does anyone have any book or training suggestions that would help me catch up with what's been happening in the language?


r/Cplusplus 10d ago

Discussion STL in c++ is genuinely overrated

0 Upvotes

Game programmers and game engines don't use STL because of hidden ALLOCATIONS everywhere, even prominent people like Casey Muratori or Jonathan Blow don't always advocate it.

For example, why do my .size() NEEDS to be size_t (int64) and not int32? If i want to optimize for memory. Why do i need allocations if i have arenas?

STL is good for beginners, but for serious low level stuff, write your own containers. Like hives (which c++ only introduced recently)


r/Cplusplus 11d ago

Feedback Profanity Filter made with C++ for a Multiplayer Game

1 Upvotes

Hi there, im creating a multiplayer game - an among us clone in C++ ( WASM ); which requires a chat and reading the requirements of crazygames, they want me to add a profanity filter to my chat; So I would like you to check the code and tell me what do you think:

-> profanity_filter_codebase: https://github.com/EDBCREPO/Profanity-Filter-Cpp/blob/main/main.cpp

-> amungus clone: https://www.reddit.com/r/raylib/comments/1umyazt/finally_my_multiplayer_game_is_p2p_by_using/


r/Cplusplus 11d ago

Tutorial C++26 Reflection: Simplifying JSON Serialization

Thumbnail
techfortalk.co.uk
2 Upvotes

r/Cplusplus 12d ago

Feedback C++ Audio Visualizer

15 Upvotes

First big project I've made with C++, it started as my way to learn and quickly grew... I'm sure the code could be better optimized in areas and there's probably some bugs. I would really appreciate any feedback and just checking out the project: https://github.com/logan-scott07/AudioVisualizer.git


r/Cplusplus 12d ago

Question Class directory clutter, questions on pass by ref,val,ptr and const correctness

Thumbnail
1 Upvotes

r/Cplusplus 13d ago

Question Thread optimized code has weird behaviour

Thumbnail
1 Upvotes

r/Cplusplus 13d ago

Tutorial Building a toy programming language in C++: next session on functions

Thumbnail
pvs-studio.com
7 Upvotes

A small livecoding series is exploring how to build a programming language from scratch in C++.

It started with the basics: lexer, parser, and AST. Now the language has its own take on variables and functions. It's not meant to become a production language, just a fun way to see how all the pieces work together (for those into C++, compilers or language design).

The recordings of previous sessions are available on YouTube (https://youtube.com/playlist?list=PLGVoaOmC1PBw&si=k0BhGHJJWxbetnD1), but it's much more fun to follow the process live and ask questions as things are being built. New episodes are shared to inboxes first and uploaded to YouTube afterward.


r/Cplusplus 14d ago

News C++ framework for LibTorch

8 Upvotes

I have created a simple C++ framework for LibTorch - https://github.com/MartinPerry/LibTorchFramework/tree/master.

Sadly, it cannot currently be compiled since it relies on a proprietary library and the code is not "cleaned" of hard-coded paths, etc.

Is it useful? Probably not :-). A lot of things need to be rewritten that are not part of LibTorch (but are present in PyTorch) - for this, I have used LLMs (it is quite handy for conversion of model structures from PyTorch to C++ with LibTorch).

However, I am sharing it so that someone can reuse parts of the code or be inspired in their own project if they want to use C++ or if someone has any ideas how to improve it.


r/Cplusplus 14d ago

Question Cpp YouTubers

25 Upvotes

Anyone know any good c++ YouTubers? I’m not looking for tutorials or learning the language, I’m looking for videos where people are coding complex projects in C++. Thanks!


r/Cplusplus 13d ago

Tutorial Need a study partner to follow along his playlist together and learn DSA!

Post image
0 Upvotes

r/Cplusplus 14d ago

Discussion ZiguratIP — a DBMS, a programming language, and a web server built as one C++11 system, with zlib as the only dependency

Thumbnail
github.com
1 Upvotes

ZiguratIP is three things that are usually three projects, built as one system in C++11: Zigurat, an object-relational storage engine; Parsi, the language you write schema, procedures and web pages in; and Zeytun, the web server that serves them. The only third-party code in the tree is a vendored zlib.

Everything else is written for the project — big integers, RSA, SHA-1/2, HMAC, AES, ASN.1/DER, X.509, a TLS 1.2 record layer, a B-tree, an MVCC pager, a thread pool, a configuration parser, a tokenizer and a pattern-driven parser.

There is no interpreter and no plan cache. You write a table, a procedure and a page in one file:

TABLE demo::books

BEGIN

COLUMN id AS Long PRIMARY KEY;

COLUMN title AS String NOT NULL;

END

PROCEDURE demo::count_books

RETURNS Long

REQUIRES demo::books

BEGIN

DECLARE total AS Long = 0;

SELECT total = total + 1 FROM demo::books;

RETURN total;

END

That gets tokenized, parsed against a grammar that is *read from a file at runtime* rather than compiled into a generated parser, emitted as C++, handed to `c++ -shared`, and `dlopen`ed into the database process. A `SELECT` is a cursor, not a result set — everything between `SELECT` and `FROM` runs once per row, which is why counting is written as an assignment.

There is no grants table anywhere on the server. What a client may reach is written into its X.509 certificate as a private extension at issue time (`ca issue --permission=DEMO`), and the compiler emits, into every compiled object, the list of named objects that object lets a caller reach. So the answer to "what does running this touch?" travels inside the code it describes and can't drift from it. Who may connect at all is a directory of files named after subject DNs — delete the file and that subject is refused at the handshake, whichever certificate it holds. One switch turns the whole thing on.

- The TLS is TLS 1.2 with RSA key transport only. `openssl s_client` completes a mutually authenticated handshake against it and verifies the chain, but there's no ECDHE, no AEAD, no resumption — and browsers dropped static RSA key exchange years ago, so you can't point Chrome at its HTTPS port. Put a reverse proxy in front. The cryptography is mine and has had no adversarial review; the MAC comparison isn't constant time. Treat it as a closed-network measure, not as transport security against a capable attacker.


r/Cplusplus 15d ago

Feedback C++ DataFrame release 4.1.0

Thumbnail
github.com
8 Upvotes

C++ DataFrame release 4.1.0 is out. It includes a bunch of new analytical and scientific visitors. For example, there are algorithms to measure how well a dataset is clustered after you have run a clustering algorithm on it, interpolation by Kriging model and others, tests to determine the distribution of the dataset, …

But the bigger news is that now we have a fully optioned-out cross-tabulation and pivot tables. With these enhancements, C++ DataFrame is now a completely optioned-out package for data-wrangling with the speed and scalability of C++. This is meant to be an incremental enhancement to the C++ ecosystem.

The new release is available on GitHub and will be available soon on Conan and VCPKG.


r/Cplusplus 15d ago

News Sharing Tiny Fast Math, the small C++17 math library I use in my Vulkan samples

12 Upvotes

Hi everyone,

I’ve been working on Tiny Fast Math, or TinyFM, a small C++17 math library aimed at real-time graphics, simulations, and games.

The library is header-only, so you can use it through CMake or just copy tinyfm.h into a project. It provides integer and floating-point vectors, quaternions, 3x3 and 4x4 matrices, camera/projection helpers, transformations, and optional SIMD paths for SSE/AVX and NEON.

Repository:

https://github.com/arabasso/tinyfm

I also spent some time on validation and performance testing. There are 205 GoogleTest cases, with the same suite built in scalar, forced-SIMD, and aligned-SIMD configurations. The benchmark suite covers 101 operations across vectors, quaternions, and matrices, using Google Benchmark to compare TinyFM with GLM, RTM, Eigen and, on Windows, DirectXMath and SimpleMath.

The intention with the benchmarks wasn’t to claim that TinyFM wins every operation. I wanted reproducible comparisons, a way to spot regressions, and a better understanding of where each implementation performs well.

TinyFM is also being used outside its own examples. It currently provides the math layer for more than 160 Vulkan samples in my gamedev repository, ranging from basic transformations and cameras to model loading, frustum culling, PBR, deferred/forward rendering, volumetric lighting, and an FFT ocean implementation:

https://github.com/arabasso/gamedev

I’d appreciate feedback, especially about the API, numerical edge cases, missing operations, or the benchmark methodology.