r_cpp | Unsorted

Telegram-канал r_cpp - C++ - Reddit

-

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

Subscribe to a channel

C++ - Reddit

C++ with no classes?
https://pvs-studio.com/en/blog/posts/cpp/1259/

https://redd.it/1lvdvsd
@r_cpp

Читать полностью…

C++ - Reddit

Henrik Fransson: C++ On Time
https://youtu.be/aKyj5ZycnsU

https://redd.it/1lve9od
@r_cpp

Читать полностью…

C++ - Reddit

tgautils now on github

In case anyone else needs to work with ancient Truevision Targa (TGA) image files I resurrected their old MS-DOS tgautils code extracted some of the common read/write code into a library and put it on github:
https://github.com/LegalizeAdulthood/tgautils

I was surprised to see that the file format wasn't really well documented, so I grabbed their specification and converted it to PDF from PostScript; it's in the docs folder.

https://redd.it/1lv02wu
@r_cpp

Читать полностью…

C++ - Reddit

I am looking for a game engine in C++ except unreal engine



https://redd.it/1lulwf0
@r_cpp

Читать полностью…

C++ - Reddit

C++ Day 2025 - Call for sessions

Hi everyone!

This is Marco, founder of the Italian C++ Community.

We are excited to bring back the C++ Day on October 25, 2025, in Pavia, Italy (near Milan). An in-person, community-driven event all about C++.

We’re currently looking for speakers! If you have something interesting to share (technical deep dives, real-world experiences, performance tips, tooling, modern C++, etc) we'd love to hear from you. Talks can be 30 or 50 minutes.

The Call for Sessions is open until Aug 25.

ℹ️ The event is totally free to attend, but we can't cover travel/accommodation costs for speakers.

Whether you're an experienced speaker or it's your first time, don't hesitate to submit!

👉 Link: C++ Day 2025

See you there!

https://redd.it/1lui4k0
@r_cpp

Читать полностью…

C++ - Reddit

Use of .inl files

I've been working on a research project where our codebase is almost all templated classes. In order to better organize the code a bit, I separated declaration and definition into .h and .inl files.

However, recently I've tried integrating clangd into my workflow since I've been using it at work and found it to be a much better autocomplete companion to the standard VSCode C++ extension one. It doesn't work correctly with .inl files though, as they're meant to be included at the end of the .h file itself and so any declaration in the .inl that's used in the .h is missing according to clangd. Of course, including the .h file is not possible as that would be a circular include.

So, 2 questions:

1. Is there a way to get .inl files to play nicely with clangd?
2. If not, how do people organize their code in header-only libraries in a way that autocomplete can still understand?

https://redd.it/1luh718
@r_cpp

Читать полностью…

C++ - Reddit

std::visit should be more user-friendly

**Make** `std::visit` **look and feel like Rust**:

#include <stdio.h>
#include <variant>
template<class ... T>
struct match:T...{using T::operator()...};
void operator>>(auto& v, auto&& f){
  std::visit(std::move(f), v);
}
int main() {
  std::variant<int,const char*>a[]={1,"a"};
  for (auto x : a) x >> match{
    [](auto x) { printf("str: %s\n", x); },
    [](int x) { printf("int: %d\n", x); },
  };
  return 0;
}

https://redd.it/1ltyzxk
@r_cpp

Читать полностью…

C++ - Reddit

New C++ Conference Videos Released This Month - July 2025

C++Online

2025-06-30 - 2025-07-06

Essential C++ Tips and Tricks for the Ultimate Cpp Performance - Andreas Fertig - [https://youtu.be/\_lwuqH72ycM](https://youtu.be/_lwuqH72ycM)
Keynote: How To Improve Software Innovation Through Diversity - Sejal Gupta - https://youtu.be/ym8mt\_LGWew
How to Write a Base Level Cpp Library for Safety Critical Software in C++ - Anthony Williams - [https://youtu.be/NWTowFQ1c0I](https://youtu.be/NWTowFQ1c0I)

ACCU Conference

2025-06-30 - 2025-07-06

The Next Coding Horizon - Proactive LLMs for Enhanced Productivity - Anastasia Kazakova - https://youtu.be/ak7Q6TEOJnQ
The C++ Execution Model - Bryce Adelstein Lelbach - [https://youtu.be/6zq5ZmCvldU](https://youtu.be/6zq5ZmCvldU)

ADC

2025-06-30 - 2025-07-06

Branch-Free Oscillators for Virtual Analog Software Synthesizer Applications in C++ - Angus Hewlett - https://youtu.be/5Les61Hh46w
Spatial Localization and Techniques for Synthesizing Real-Time Binaural Audio for Headphones - Harsha Vardhan Rapeti - [https://youtu.be/A1XHIy1GgNQ](https://youtu.be/A1XHIy1GgNQ)
Debugging Audio Content With Visuals - A Debugger Extension and Some Other Helpful Tools - Maxime Coutant - https://youtu.be/tZMA49ZnMbQ

https://redd.it/1ltxswm
@r_cpp

Читать полностью…

C++ - Reddit

Leadwerks 5 Crash Course

This video provides an overview of the entire developer experience using the new version 5 of my C++ game engine Leadwerks, compressed into just over an hour-long video. Enjoy the lesson and let me know if you have any questions about my technology or the user experience. I'll try to answer them all!
https://www.youtube.com/watch?v=x3-TDwo06vA

https://redd.it/1lt8q7r
@r_cpp

Читать полностью…

C++ - Reddit

С++ All quiet on the modules front
https://youtube.com/watch?v=WLS9zOKzSqA&amp;si=rZDvamZayFETc3Y1

https://redd.it/1lt84us
@r_cpp

Читать полностью…

C++ - Reddit

contracts and sofia

Hey,

Can anyone share the last info about it? All i know is that bjarne was really displeased with it from some conference talk about all the 'pitfalls' (the biggest foot guns we've gotten in a long time!), but I havent seen any more recent news since.

https://redd.it/1lsy7sc
@r_cpp

Читать полностью…

C++ - Reddit

Advice For Game Dev

Hi everyone❤️ I'm new to CPP but that's not my first time coding, I was coding in C for a month and I was watching( bro code) playlist no doubt you know him guys😅 so when I finished that playlist I asked myself should I dive more in C or switch to CPP 🤨 cuz my main goal is to be a game dev in CPP, and C will not help me at all in that way, cuz I'll use unreal engine for my games and that engine is using CPP😐 but before I ever started coding I asked Chat GPT for an advice and what should I do and he told me that I should start with C to know more about coding and something like that🫠🫠 so now I wanna start learning CPP and I want some Advice but from real trusted devs not Chat GPT 😂

https://redd.it/1lsd6kp
@r_cpp

Читать полностью…

C++ - Reddit

HTTP(s) and WS(s) library using Asio

Hi all. I would like to share my HTTP and websocket c++ library https
It's based on Asio and is intended as an alternative to Beast. It provides HTTP and WS primitives as composed operations. I'm looking for some early feedback. Thanks

https://redd.it/1ls4c0d
@r_cpp

Читать полностью…

C++ - Reddit

Code Coverage Gutters in VSCode?

I’m returning to working with C++ after a several year hiatus. In that time, I’ve learned to appreciate some nice tooling ecosystems from languages like Go, which have easy support for displaying coverage gutters to illustrate which lines have been executed from tests.

My question is: what would be the easiest equivalent these days for C++, specially for llvm-based builds using cmake? I’ve found a few outdated threads/topics, but I’m unsure if there is anything more recent.

Best I can come up with is:

1. Use a cmake variant for generating coverage content
2. Configure a coverage gutters plugin to read the *.info file that will be generated in a consistent place under a “build” directory
3. Have a VSCode task that I can manually trigger to run the tests (through ctest) and then generate the coverage report with llvm-cov

Am I on the right track? Is there anything easier/less manual? Does anyone have any tips/configuration options that they may be willing to share?


https://redd.it/1lrz11b
@r_cpp

Читать полностью…

C++ - Reddit

Fall, rage, try again. I made Way of the Dragons, a climbing game where baby dragons fight to get home. Way of the Dragons🐉 live on Steam.
https://youtu.be/fe6zSAVURLo

https://redd.it/1lrrp4b
@r_cpp

Читать полностью…

C++ - Reddit

Looking for a C++ ECS Game Engine Similar to Bevy in Rust

Hi everyone,

I'm a C++ developer diving into game development, and I'm really impressed by the Entity-Component-System (ECS) architecture of Bevy in Rust. I love how Bevy handles data-driven design, its performance, and its clean API for building games. However, my current project requires me to stick with C++.

Does anyone know of a C++ game engine or library that offers a similar ECS experience to Bevy? Ideally, I'm looking for something with:

A modern, clean ECS implementation
Good performance for real-time applications
Active community or decent documentation
Preferably lightweight and modular, without too much bloat

I've come across engines like EnTT, which seems promising, but I'd love to hear your recommendations or experiences with other C++ ECS libraries or engines. Any suggestions or comparisons to Bevy would be super helpful!

Thanks in advance!

https://redd.it/1lved2o
@r_cpp

Читать полностью…

C++ - Reddit

TIL: pointer to deducing this member function is not a pointer to a member.

I could reword what cppreference says, but I think their example is great so here it is:

struct Y
{
int f(int, int) const&;
int g(this Y const&, int, int);
};

auto pf = &Y::f;
pf(y, 1, 2); // error: pointers to member functions are not callable
(y.pf)(1, 2); // ok
std::invoke(pf, y, 1, 2); // ok

auto pg = &Y::g;
pg(y, 3, 4); // ok
(
y.pg)(3, 4); // error: “pg” is not a pointer to member function
std::invoke(pg, y, 3, 4); // ok

I won't lie I am not so sure I like this, on one hand syntax is nicer, but feels so inconsistent that one kind of member functions gets to use less ugly syntax, while other does not. I guess fixing this for old code could cause some breakages or something... but I wish they made it work for all member functions.

https://redd.it/1lv3q7h
@r_cpp

Читать полностью…

C++ - Reddit

Have C++ and C really changed in 40 years?

I’m a one-time amateur C & C++ programmer. I know the standards get updated every few years, but have things really changed that much?

I guess there is support for multi-threading and now reflection in C++, but are these things just incremental or really radical? Is there really much new since Stroustrup’s 1985 book?

My son is learning C and C++ and I’m wondering how much of the modern stuff really matters.

https://redd.it/1lunhxw
@r_cpp

Читать полностью…

C++ - Reddit

Conan 2.x is less convenient in monorepo setup
https://github.com/conan-io/cmake-conan/issues/700

https://redd.it/1lujeag
@r_cpp

Читать полностью…

C++ - Reddit

Where can I follow std committee timeline?

For example when will C++26 be finalized?
When are the meetings? (It was hard to find anything about last meeting online)

https://redd.it/1lui51v
@r_cpp

Читать полностью…

C++ - Reddit

Tech-ASan: Two-stage check for Address Sanitizer
https://conf.researchr.org/details/internetware-2025/internetware-2025-research-track/38/Tech-ASan-Two-stage-check-for-Address-Sanitizer

https://redd.it/1lubssv
@r_cpp

Читать полностью…

C++ - Reddit

How important is Inheritance, actually?

I'm making an OpenGL program and want to generalize different models and objects (i.e. icosphere, 3D Perlin Mesh) into one Mesh class. Is it important that I use inheritance or is it okay if each of these objects create their own instance of the Mesh class. As someone that never really used c++ before, how important is inheritance in OOP or is it just optional since it seems like a hassle to implement.

https://redd.it/1ltx6l2
@r_cpp

Читать полностью…

C++ - Reddit

Evaluating the Effectiveness of Memory Safety Sanitizers
https://doi.ieeecomputersociety.org/10.1109/SP61157.2025.00088

https://redd.it/1ltlea6
@r_cpp

Читать полностью…

C++ - Reddit

Maps on chains
https://bannalia.blogspot.com/2025/07/maps-on-chains.html

https://redd.it/1lt888n
@r_cpp

Читать полностью…

C++ - Reddit

How much math I need

Hi, I know C and C++, and I want to build my own VST (Virtual Studio Technology) software. But first, I need to learn JUCE. I know this will require some math. I have a basic understanding of math, like precalculus, but I don't have a strong grasp of calculus. Should I learn JUCE first, or should I focus on improving my math skills first?.

https://redd.it/1lsyqps
@r_cpp

Читать полностью…

C++ - Reddit

Arduplane Vectoring System and possible implementation
https://acrobat.adobe.com/id/urn:aaid:sc:US:457f1410-65fc-44e7-815a-f9583e2230d5

https://redd.it/1lsw24g
@r_cpp

Читать полностью…

C++ - Reddit

C++26 Feature Freeze (Herb Sutter Bulgaria Trip Report 2025-06-21)
https://herbsutter.com/2025/06/21/trip-report-june-2025-iso-c-standards-meeting-sofia-bulgaria/

https://redd.it/1lscjts
@r_cpp

Читать полностью…

C++ - Reddit

ChatGPT Simulating The Solar System In 3D With C++

I've just been playing around with ChatGPT and wanted to share.






#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <iostream>
#include <vector>
#include <cmath>

const unsigned int SCR_WIDTH = 800;
const unsigned int SCR_HEIGHT = 600;

void framebuffer_size_callback(GLFWwindow* window, int width, int height);
void processInput(GLFWwindow *window);

// Orbital params
struct Planet {
float distance; // from sun
float size;
float speed; // angular speed
glm::vec3 color;
};

// Planets
std::vector<Planet> planets = {
{ 0.4f, 0.05f, 4.7f, glm::vec3(0.5f, 0.5f, 0.5f) }, // Mercury
{ 0.7f, 0.08f, 3.5f, glm::vec3(0.8f, 0.6f, 0.2f) }, // Venus
{ 1.0f, 0.09f, 2.9f, glm::vec3(0.2f, 0.5f, 1.0f) }, // Earth
{ 1.5f, 0.06f, 2.4f, glm::vec3(1.0f, 0.2f, 0.2f) }, // Mars
{ 2.5f, 0.15f, 1.3f, glm::vec3(1.0f, 0.8f, 0.2f) }, // Jupiter (scaled down)
};

int main() {
glfwInit();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);

GLFWwindow* window = glfwCreateWindow(SCR_WIDTH, SCR_HEIGHT, "Solar System 3D", NULL, NULL);
if (!window) {
std::cerr << "Failed to create window.\n";
glfwTerminate();
return -1;
}
glfwMakeContextCurrent(window);
glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);

if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)) {
std::cerr << "Failed to initialize GLAD\n";
return -1;
}

glEnable(GL_DEPTH_TEST);

// Simplified rendering loop
float time = 0.0f;

while (!glfwWindowShouldClose(window)) {
processInput(window);
time += 0.01f;

glClearColor(0.0f, 0.0f, 0.05f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

// Projection and view
glm::mat4 projection = glm::perspective(glm::radians(45.0f),
(float)SCR_WIDTH / SCR_HEIGHT, 0.1f, 100.0f);
glm::mat4 view = glm::lookAt(glm::vec3(0, 5, 10),
glm::vec3(0, 0, 0),
glm::vec3(0, 1, 0));

// Draw Sun
// Draw planet positions
for (auto& planet : planets) {
float angle = time * planet.speed;
float x = cos(angle) * planet.distance;
float z = sin(angle) * planet.distance;

// Replace this with your drawSphere(x, 0, z, planet.size)
}

glfwSwapBuffers(window);
glfwPollEvents();
}

glfwTerminate();
return 0;
}

// Resize window
void framebuffer_size_callback(GLFWwindow* window, int width, int height) {
glViewport(0, 0, width, height);
}

// Close on Esc
void processInput(GLFWwindow *window) {
if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS)
glfwSetWindowShouldClose(window, true);
}

https://redd.it/1lrxxeg
@r_cpp

Читать полностью…

C++ - Reddit

for range vs index based for loop

2 codes with the same everything but different for loop style

the range-based loop took more time than index for loop

is it always true that index for loop is faster than range loop ?

which one do you recommend to use ?

because it is not allowed here to put a video ,I recorded a vedio it's almost one minute showing the difference in time , it is on my post profile (the most recent post) .

link of the post

https://redd.it/1lrydbu
@r_cpp

Читать полностью…

C++ - Reddit

Wasmbind

Hello all

I’m working on a project called wasmbind, which consists of 2 libraries, jsbind and webbind.
The goal of the project is to provide a C++ interface to the browser’s DOM when targeting wasm.
Currently jsbind provides just the minimal interfaces required by webbind. The webbind headers and sources are generated from webidl files.

This allows for a more idiomatic, and less stringly-typed, api than for example emscripten’s val api.

It’s also backend-agnostic, and can be used with stock clang targeting the wasm32-unknown-unknown (freestanding) target, so you don’t need to install additional special versions of clang. It can also be used to target wasm32-wasi and emscripten.

In essence it’s similar to the widely-used web-sys crate in the Rust ecosystem:

https://crates.io/crates/web-sys

Link to the wasmbind repo:

https://github.com/MoAlyousef/wasmbind





https://redd.it/1lrr8zl
@r_cpp

Читать полностью…
Subscribe to a channel