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
Больше229
Подписчики
Нет данных24 часа
Нет данных7 дней
Нет данных30 день
Архив постов
229
Learning CUDA C++ on a Budget on Google Colab's Free Tier
https://leetarxiv.substack.com/p/learning-cuda-on-a-budget-on-google
https://redd.it/1nm119r
@r_cpp
229
Project sharing
What’s a good venue for sharing projects apart from this sub, which has a rule prohibiting sharing projects, and would instead prefer sharing videos (of sometimes weak content) from conferences like cppnow or cppcon. Posts about msvc features/bugs seem to also stick around.
https://redd.it/1nlwgdq
@r_cpp
229
New version of ConanEx v2.3.0 - Conan Extended C/C++ Package Manager. Improved version of 'install' command, now feels like platform package manager
Improved conanex install command to fill like package manager command.
Instead of:
conanex install --requires=poco/1.13.3 --requires=flatbuffers/22.10.26 --requires=ctre/3.6 --build=missing --output-folder=/dev/null
conanex install --requires=poco/1.13.3 --tool-requires=cmake/3.23.5 --tool-requires=ninja/1.11.0 --build=missing --output-folder=/dev/null
Use like this:
conanex install poco/1.9.4 flatbuffers/22.10.26 ctre/3.6
conanex install poco/1.9.4 --tools cmake/3.23.5 ninja/1.11.0
conanex install --tools cmake/3.23.5 ninja/1.11.0 -- poco/1.9.4
This feels like alternative to apt-get on Ubuntu, brew on MacOS and choco on Windows, but cross-platform.
https://redd.it/1nlwpdr
@r_cpp229
study material for c++ (numerical computing)
Hello,
I’m a statistics major and don’t have a background in C++. My main programming languages are R and Python. Since both can be slow for heavy loops in optimization problems, I’ve been looking into using Rcpp and pybind11 to speed things up.
I’ve found some good resources for Rcpp (Rcpp for Everyone), but I haven’t been able to find solid learning material for pybind11. When I try small toy examples, the syntax feels quite different between the two, and I find pybind11 especially confusing—declaring variables and types seems much more complicated than in Rcpp. It feels like being comfortable with Rcpp doesn’t translate to being comfortable with pybind11.
Could you recommend good resources for learning C++ for numerical computing—especially with a focus on heavy linear algebra and loop-intensive computations? I’d like to build a stronger foundation for using these tools effectively.
Thank you!
https://redd.it/1nlsige
@r_cpp
229
Interesting module bug workaround in MSVC
To anyone who's trying to get modules to work on Windows, I wanted to share an interesting hack that gets around an annoying compiler bug. As of the latest version of MSVC, the compiler is unable to partially specialize class templates across modules. For example, the following code does not compile:
export module Test; //Test.ixx
export import std;
export template<typename T>
struct Foo {
size_t hash = 0;
bool operator==(const Foo& other) const
{
return hash == other.hash;
}
};
namespace std {
template<typename T>
struct hash<Foo<T>> {
size_t operator()(const Foo<T>& f) const noexcept {
return hash<size_t>{}(f.hash);
}
};
}
//main.cpp
import Test;
int main() {
std::unordered_map<Foo<std::string>, std::string> map; //multiple compiler errors
}
However, there is hope! Add a dummy typedef into your specialized class like so:
template<typename T>
struct hash<Foo<T>> {
using F = int; //new line
size_t operator()(const Foo<T>& f) const noexcept {
return hash<size_t>{}(f.hash);
}
};
Then add this line into any function that actually uses this specialization:
int main() {
std::hash<Foo<std::string>>::F; //new line
std::unordered_map<Foo<std::string>, std::string> map;
}
And voila, this code will compile correctly! I hope this works for y'all as well.
https://redd.it/1nlpdev
@r_cpp
229
"More Speed & Simplicity: Practical Data-Oriented Design in C++" - Vittorio Romeo - CppCon 2025 Keynote
https://www.youtube.com/watch?v=SzjJfKHygaQ
https://redd.it/1nlhlbu
@r_cpp
229
Functional vs Object-oriented from a performance-only point of view
I was wondering if not having to manage the metadata for classes and objects would give functional-style programs some performance benefits, or the other way around? I know the difference must be negligible, if any, but still.
I'm still kind of a newbie so forgive me if I'm just talking rubbish.
https://redd.it/1nl8m5x
@r_cpp
229
C++ Learning Platform - Built for the Upcoming Generation
Hey r/cpp! 👋
I've been working on something I think this community might appreciate: [**hellocpp.dev**](http://hellocpp.dev) \- a modern, interactive C++ learning platform designed specifically for beginners.
# What is it?
An online C++ learning environment that combines:
* **Interactive lessons** with real-time code execution
* **Hands-on exercises** that compile and run in your browser
* **Progress tracking** and achievements to keep learners motivated
* **Beginner-friendly error messages** that actually help instead of intimidate
# Why are we building this?
Learning C++ in 2025 is still unnecessarily difficult for beginners. Most resources either:
* Assume too much prior knowledge
* Require complex local development setup
* Don't provide immediate feedback
* Use outdated examples and practices
We're trying to change that by creating a **modern, accessible pathway** into C++ that follows current best practices (C++17/20/23) and provides instant feedback.
# What makes it different?
* **Zero setup** \- write and run C++ code immediately in your browser
* **Modern C++** \- teaches current standards and best practices
* **Interactive learning** \- not just reading, but doing
* **Community driven** \- open to feedback and contributions
# How you can help
The best way to support this project right now is to **try the first chapter** and give us honest feedback:
* What works well?
* What's confusing?
* What would you do differently?
* How can we make C++ more approachable for newcomers?
We're particularly interested in feedback from experienced C++ developers on:
* Curriculum accuracy and best practices
* Exercise difficulty progression
* Code style and modern C++ usage
# The bigger picture
C++ isn't going anywhere - it's still critical for systems programming, game development, embedded systems, and high-performance applications. But we're losing potential developers because the learning curve is steep and the tooling can be intimidating.
If we can make C++ more accessible to the next generation of developers, we strengthen the entire ecosystem.
**Try it out**: [hellocpp.dev](http://hellocpp.dev)
# Think you can beat me?
I'm currently sitting at the top of the leaderboard. Think you can dethrone me? Complete the exercises and see if you can claim the #1 spot. Fair warning though - I know where all the edge cases are 😉
# Support the project
If you like the direction we're heading and want to support us building something great for the C++ community, we have a [Patreon](https://patreon.com/HelloCpp?utm_medium=unknown&utm_source=join_link&utm_campaign=creatorshare_creator&utm_content=copyLink) where you can support development. Every contribution helps us dedicate more time to creating quality content and improving the platform.
Building this for the community, with the community. Let me know what you think!
Learn more here:
[https://www.patreon.com/posts/welcome-to-your-138189457](https://www.patreon.com/posts/welcome-to-your-138189457)
https://redd.it/1nl7kz5
@r_cpp
229
Can't solve problems
So I've completed c language and almost about to complete dsa in it but now what I've realised is I can't solve any problems even with the same concept (for eg you give me a stack problem I know stack but I can't solve a problem and even if you give me the same question i saw previously i will have to revise it to write that code from scratch) basically i can understand i can explain every function but I can't solve it idk it's pretty frustrating my coding club test is in a few weeks and it's bothering me what should i do
https://redd.it/1nkzka5
@r_cpp
229
would reflection make domain-specific rule engines practical?
Hey,
I was playing with a mock reflection API in C++ (since the real thing is not merged yet).
The idea: if reflection comes, you could write a small "rule engine" where rules are defined as strings like:
amount > 10000
country == "US"
Then evaluate them directly on a struct at runtime.
I hacked a small prototype with manual "reflect()" returning field names + getters, and it already works:
\- Rule: amount > 10000 → true
\- Rule: country == US → false
Code: (mocked version)
https://godbolt.org/z/cxWPWG4TP
\---
Question:
Do you think with real reflection (P2996 etc.) this kind of library would be actually useful?
Or is it reinventing the wheel (since people already embed Lua/Python/etc.)?
I’m not deep into the standard committee details, so curious to hear what others think.
https://redd.it/1nkyumx
@r_cpp
229
Pointer
Hello guys!!, sorry, my english is so bad, am speak spanish, but i try to speak english too
a have a question
How i call the final pointer from a element from a array or list in c++, a im assing the variable pointer "end list element" in the lexic code?, but i need to explay to mi profesor where is come from, how i can explai where come from the pointer end list?
Thank you in advance for your patience!!
https://redd.it/1nkte3m
@r_cpp
229
C++ Memory Safety in WebKit
https://www.youtube.com/watch?v=RLw13wLM5Ko
https://redd.it/1nkib84
@r_cpp
229
Yesterday’s talk video posted: Reflection — C++’s decade-defining rocket engine
https://herbsutter.com/2025/09/18/yesterdays-talk-video-posted-reflection-cs-decade-defining-rocket-engine/
https://redd.it/1nkg3ra
@r_cpp
229
MSVC's Unexpected Behavior with the OpenMP lastprivate Clause
According to the Microsoft reference:
>the value of each
lastprivate variable from the lexically last section directive is assigned to the variable's original object.
However, this is not what happens in practice when using MSVC.
Consider this simple program:
#include <omp.h>
#include <iostream>
int main() {
int n = -1;
#pragma omp parallel
{
#pragma omp sections lastprivate(n)
{
#pragma omp section
{
n = 1;
Sleep(10);
}
#pragma omp section
{
n = 2;
Sleep(1);
}
}
printf("%d\n", n);
}
return 0;
}
This program always prints 1. After several hours of testing, I concluded that in MSVC, lastprivate variables are assigned the value from the last section to finish execution, not the one that is lexically last.
The reason for this post is that I found no mention of this specific behavior online. I hope this saves others a headache if they encounter the same issue.
Thank you for your time.
https://redd.it/1nkder8
@r_cpp229
Cppless: Single-Source and High-Performance Serverless Programming in C++
https://dl.acm.org/doi/10.1145/3747841
https://redd.it/1nkbixl
@r_cpp
229
Italian C++ Meetup - Beyond Assertions (Massimiliano Pagani)
https://youtu.be/6SFoZWHGn0E?t=194
https://redd.it/1nk53vp
@r_cpp
229
Introducing the Constexpr Debugger
https://blog.jetbrains.com/clion/2025/09/introducing-constexpr-debugger/
https://redd.it/1nk355k
@r_cpp
229
Debugging User-Defined Types & Containers Using Value Formatting - Example Repo
https://github.com/codeinred/lldb_user_types
https://redd.it/1njsvza
@r_cpp
229
Concept-based Generic Programming - Bjarne Stroustrup - CppCon 2025
https://youtu.be/VMGB75hsDQo
https://redd.it/1njqbs1
@r_cpp
Уже доступно! Исследование Telegram 2025 — ключевые инсайты года 
