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

Rapid Plugin Development - Bence Kovács & Linus Corneliusson - [https://youtu.be/Iwgd7ulJHa4](https://youtu.be/Iwgd7ulJHa4)

2025-04-07 - 2025-04-13

* Intro to Software Development of Audio Devices - From Plugins to Hardware - Wojtek Jakobczyk - [https://youtu.be/eqHaiV5uNnM](https://youtu.be/eqHaiV5uNnM)
* Teaching Audio Developers How to Build AI-Enhanced Audio Plugins - Matthew Yee-King - [https://youtu.be/Uy7BXe9crUM](https://youtu.be/Uy7BXe9crUM)
* Expanding SDKs and APIs in Pro Tools - Dave Tyler - [https://youtu.be/v31yooYnvYs](https://youtu.be/v31yooYnvYs)

2025-03-31 - 2025-04-06

* Workshop: Designing and Developing an AVB/Milan-Compliant Audio Network Endpoint - Fabian Braun - [https://youtu.be/Xs0UvCOjpnU](https://youtu.be/Xs0UvCOjpnU)
* JUCE and Direct2D - Matt Gonzalez - [https://youtu.be/7qepqLo5bGU](https://youtu.be/7qepqLo5bGU)
* Intro to Software Development of Audio Devices - From Plugins to Hardware - Wojtek Jakobczyk - [https://youtu.be/eqHaiV5uNnM](https://youtu.be/eqHaiV5uNnM)

**C++ Under The Sea**

2025-03-31 - 2025-04-06

* BJÖRN FAHLLER - Cache-friendly data + functional + ranges = ❤️ - [https://www.youtube.com/watch?v=QStPbnKgIMU](https://www.youtube.com/watch?v=QStPbnKgIMU)

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

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

C++ - Reddit

New C++ Conference Videos Released This Month - April 2025 (Updated to Include Videos Released 2025-04-21 - 2025-04-27)

CppCon

2025-04-21 - 2025-04-27

Lightning Talk: DevSecOps for C++? Keep Calm and use Conan - Luis Caro Campos - [https://youtu.be/klUbc63UkNU](https://youtu.be/klUbc63UkNU)
Lightning Talk: The Main Points in C++ - Dots in C++ - Miodrag Misha Djukic - https://youtu.be/1csip8URJ8c
Lightning Talk: The UB Detector: constexpr - Andreas Fertig - [https://youtu.be/p3ERaKsQmuU](https://youtu.be/p3ERaKsQmuU)
Lightning Talk: Improving an HTML Parser with Swift 6 Pattern Matching - Andrew Kaster - https://youtu.be/KCRx1jE6DnY
Lightning Talk: Can't we Just Synthesize std::tuple\_element From Get? - Jonathan Müller - [https://youtu.be/10\_kPNL4sjk](https://youtu.be/10_kPNL4sjk)

2025-04-14 - 2025-04-20

Lightning Talk: What Does a CMake Developer Want From CMake? - Ben Boeckel - https://youtu.be/-kUL4AFblCA
Lightning Talk: What LLMs Won't Ever be Able to Do - Ben Deane - [https://youtu.be/km0JFBfFNJQ](https://youtu.be/km0JFBfFNJQ)
Lightning Talk: C++ in the Cloud: One NIF at a Time with Elixir - Sakshi Verma - https://youtu.be/5x9cYWt-BYM
Lightning Talk: The Present and Future of Cross-Platform GUI in C++ - Matt Aber - [https://youtu.be/p9LeAqoshkQ](https://youtu.be/p9LeAqoshkQ)
Lightning Talk: Micro C++ Benchmarks & Murphy's Law - Lexington Brill - https://youtu.be/4yu5PgDEhx8

2025-04-07 - 2025-04-13

Lightning Talk: C++ and Rust Bindings - Mixing It Best With CMake - Damien Buhl - [https://youtu.be/EcbmDXA4Inc](https://youtu.be/EcbmDXA4Inc)
Lightning Talk: Every Use Case of Colon and Ellipses in C++ - Ali Almutawa Jr - https://youtu.be/1blspAWnjUQ
Lightning Talk: Do You Love or Hate Your C++ Build System? - Helen Altshuler - [https://youtu.be/jBnQ69ZMtHw](https://youtu.be/jBnQ69ZMtHw)
Lightning Talk: Generative C++ - Alon Wolf - https://youtu.be/y8NXF7WsSEc
Lightning Talk: Remote Execution Caching Compiler (RECC) for C++ Builds - Shivam Bairoliya - [https://youtu.be/oH1JKMKwDDA](https://youtu.be/oH1JKMKwDDA)

2025-03-31 - 2025-04-06

Lightweight Operator Fusion Using Data-Centric Function Interfaces in C++ - Manya Bansal - https://youtu.be/pEcOZDRXhNM
Security Beyond Memory Safety - Using Modern C++ to Avoid Vulnerabilities by Design - Max Hoffmann - [https://youtu.be/mv0SQ8dX7Cc](https://youtu.be/mv0SQ8dX7Cc)
To Int or to Uint, This is the Question - Alex Dathskovsky - https://youtu.be/pnaZ0x9Mmm0
Leveraging C++ for Efficient Motion Planning: RRT Algorithm for Robotic Arms - Aditi Pawaskar - [https://youtu.be/CEY4qRLcLmI](https://youtu.be/CEY4qRLcLmI)
Guide to Linear Algebra With the Eigen C++ Library - Daniel Hanson - https://youtu.be/99G-APJkMc0

Audio Developer Conference

2025-04-21- 2025-04-27

Responsible AI for Offline Plugins - Tamper-Resistant Neural Audio Watermarking - Kanru Hua - [https://youtu.be/Y\_U28ZBh5Xs](https://youtu.be/Y_U28ZBh5Xs)
An Introduction to Analog Electronics for Audio Software Developers - Jatin Chowdhury - https://youtu.be/rLJ8C7qIlAU
Auditory and Cognitive Neuroscience and the State of Audio Technology - A Multi-Disciplinary Panel Discussion - Rebekah Wilson, Susan Rogers, Micha Heilbron & Ryszard Auksztulewicz - [https://youtu.be/LoVd081XN4s](https://youtu.be/LoVd081XN4s)

2025-04-14 - 2025-04-20

Roland’s Holistic Approach to AI for Music Creation - Paul McCabe, Ichiro Yazawa & Kazuyoshi Sasamori - https://youtu.be/ZvUGS754u5Y
Making Accessible Audio Software - Perspectives of a Blind Music Producer - Trey Culver & Adam Wilson - [https://youtu.be/JeyWnToyd1c](https://youtu.be/JeyWnToyd1c)
Building a Plugin Assembly Line - The Road to

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

C++ - Reddit

Where do you draw the line?

Ive been learning c++ by reading C++ Primer for 4 month and developing my little render/game with OpenGL, i was wondering, where do you draw the line between a beginner, intermediate and advanced programmer in term of knowledge of C++, OOP, cmake and other stuff?

Do you have any book recomendation after primer?

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

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

C++ - Reddit

I made a fast compile time reflection library for enums in C++20! (clang support coming soon)
https://github.com/ZXShady/enchantum/tree/main

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

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

C++ - Reddit

Why std::println is so slow

clang libstdc++ (v14.2.1):

printf.cpp ( 245MiB/s)
cout.cpp ( 243MiB/s)
fmt.cpp ( 244MiB/s)
print.cpp ( 128MiB/s)

clang libc++ (v19.1.7):

printf.cpp ( 245MiB/s)
cout.cpp (92.6MiB/s)
fmt.cpp ( 242MiB/s)
print.cpp (60.8MiB/s)


above tests were done using command ./a.out World | pv --average-rate > /dev/null (best of 3 runs taken)

Compiler Flags: -std=c++23 -O3 -s -flto -march=native

add -lfmt (prebuilt from archlinux repos) for fmt version.

add -stdlib=libc++ for libc++ version. (default is libstdc++)

#include <cstdio>

int main(int argc, char* argv[])
{
if (argc < 2) return -1;

for (long long i=0 ; i < 10'000'000 ; ++i)
std::printf("Hello %s #%lld\n", argv[1], i);
}

#include <iostream>

int main(int argc, char* argv[])
{
if (argc < 2) return -1;
std::ios::sync_with_stdio(0);

for (long long i=0 ; i < 10'000'000 ; ++i)
std::cout << "Hello " << argv[1] << " #" << i << '\n';
}

#include <fmt/core.h>

int main(int argc, char* argv[])
{
if (argc < 2) return -1;

for (long long i=0 ; i < 10'000'000 ; ++i)
fmt::println("Hello {} #{}", argv[1], i);
}

#include <print>

int main(int argc, char* argv[])
{
if (argc < 2) return -1;

for (long long i=0 ; i < 10'000'000 ; ++i)
std::println("Hello {} #{}", argv[1], i);
}


std::print was supposed to be just as fast or faster than printf, but it can't even keep up with iostreams in reality. why do libc++ and libstdc++ have to do shitty reimplementations of a perfectly working library, why not just use libfmt internally ?

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

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

C++ - Reddit

Question about v tables?

I was solving old quizes but I've never come across a questino like this.



In the code below there are three class objects created during the lifetime of the executable: b, c, parameter. Which of the figures below best describes the objects in memory? Note that the objects are unnamed and unordered and the virtual table is not shown.

struct A {
  virtual void f() = 0;
  int x;
};

struct B : A {
  virtual void f() override {}
};

struct C : B {
  void f(B parameter) {}     // copy constructed
};

int main() {
  B b;
  C c;
  C & ref = c;
 
  c.f( ref );
}


I cannot post actual pictures but here is thedifferent figures to pick from and I really don't understand. I guess the top to left means that B is an instance that contains an instance of A but other than that I really have no idea and would appreciate the help?

figure 1:

[B [A x\] x\] [B [A x\] x\] [C [B [A x\] x\] x\] [C [B [A x\] x\] x\]

figure 2:

[B [A x\] \] [B [A x\] \] [C [B [A x\] \] \] [C [B [A x\] \] \]

figure 3:

[B [A x\] x\] [C[B[A x\] x\] x\] [C[B[A x\] x\] x\]

figure 4:

[B [A x\]\] [B [A x\]\] [C [B [A x\]\]\]

figure 5:

[B [A x\]\] [C [B [A x\]\]\] [C [B [A x\]\]\]

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

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

C++ - Reddit

Client gets stuck when handling concurrent requests to my HTTP server, even after receiving all the responses.
https://github.com/homocodian/http-server

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

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

C++ - Reddit

import windows; ever coming?

So since yesterday three major compilers officially support C++20 import std, I am interested in using modules along with WinAPI, either via Microsoft official Windows SDK or MinGW. Is this even possible to port Windows SDK to C++20 modules? Some windows headers are heavy to parse. This is question rather to Microsoft but they don't respond to the community forum for months or even years.

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

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

C++ - Reddit

How difficult is it to integreate Rust in a C++ tool chain.

My project uses C++ and Objective-C++ at the moment. I target

\- MacOS / iOS via a ruby script that generates XCode projects

\- Android via NDK and CMake (version whatever the latest NDK provides)

\- Linux via CMake.

\- Windows via CMake but i have to go to write my own script that generates MSBuild to use the WinUI3 XAML Gui compiler.

How difficult will it be to integrate a few Rust files and libraries? Links to best practices?
Will it slow down the Edit-Compile-Run cycle a lot? This must be fast for me as i love experimental coding.

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

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

C++ - Reddit

What does this abusive code mean?

I've been handed someone's crappy code.

Inside a class definition, it has the following (other stuff has been deleted for clarity):

>class Selection {

>private:

>Selection(char *ss="OBJECT *"); /// <--- WTF is this???

>int type;

>String data;

>} ;

This code is old; it does not comply with C++ 8.5. Part of what I need to do is update it.

I know that non-ancient versions of C do not accept assignment of a char* to a string literal. That's not my concern. My concern is what exactly does this assignment inside the argument section of a constructor definition mean? I would like to update this to at least C++11 in a memory safe way. note also that ss is not a field of the Selection class. Which is even more annoying.

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

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

C++ - Reddit

GCC 15 Released 🎉

🎉Congratulations to the GCC team!


🎆🎇🔥💥 🤩 🎊 🥳 🤟 🍻 🥂 👍


Release Notes



GNU Git Branch and Tag (quite slow)



Github mirror

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

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

C++ - Reddit

New C++ features in GCC 15
https://developers.redhat.com/articles/2025/04/24/new-c-features-gcc-15

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

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

C++ - Reddit

Tools for planning and structuring large C++ projects?

So we have a system with thousands of classes that is about to be ported from Smalltalk to C++ for multiple reasons (better OS integration, performance and interoperability). While we can use a fantastic in-house tool to automate most of the translation at the class/method level, there is considerable effort involved in structuring the system at the file level. Deciding about separation into modules, what goes into headers, what goes into code, dealing with cyclic dependencies, etc.

Smalltalk is compiled and re-linked at the method/symbol level in real time (while the app is running), so there is no such "file structure" that could be ported. It needs to be planned from scratch.

Are there any tools that could help with planning for this task? Like, I give it a graph of class names and classify their dependencies as strong (requires complete definition) or weak (forward declaration is enough), and whether they are templates, polymorphic, etc. And then the tool outlines a file structure and inclusion graph?

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

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

C++ - Reddit

ERR LNK: 1104: Cannot open "libcpmtd.lib"

Hi,

I'm making a project in VS2022 and so I linked two libraries, and specified library path and yes, they exist, but their pdb in debug mode is not found although it is included in their path, so I'm not sure. I keep getting this error and I tried more than 10 solutions and non of them worked I'm not even joking. Yes, the libraries I linked match my program CRT. Yes, the libcp matches my program CRT. I never had this issue before.

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

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

C++ - Reddit

I did a writeup on how I use asynchronous networking to span multiple APIs and link the data together all on a single thread
https://www.kulve.org/blog/async_deep_dive

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

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

C++ - Reddit

New C++ Conference Videos Released This Month - April 2025 (Updated to Include Videos Released 2025-04-21 - 2025-04-27)

**CppCon**

2025-04-21 - 2025-04-27

* Lightning Talk: DevSecOps for C++? Keep Calm and use Conan - Luis Caro Campos - [https://youtu.be/klUbc63UkNU](https://youtu.be/klUbc63UkNU)
* Lightning Talk: The Main Points in C++ - Dots in C++ - Miodrag Misha Djukic - [https://youtu.be/1csip8URJ8c](https://youtu.be/1csip8URJ8c)
* Lightning Talk: The UB Detector: constexpr - Andreas Fertig - [https://youtu.be/p3ERaKsQmuU](https://youtu.be/p3ERaKsQmuU)
* Lightning Talk: Improving an HTML Parser with Swift 6 Pattern Matching - Andrew Kaster - [https://youtu.be/KCRx1jE6DnY](https://youtu.be/KCRx1jE6DnY)
* Lightning Talk: Can't we Just Synthesize std::tuple\_element From Get? - Jonathan Müller - [https://youtu.be/10\_kPNL4sjk](https://youtu.be/10_kPNL4sjk)

2025-04-14 - 2025-04-20

* Lightning Talk: What Does a CMake Developer Want From CMake? - Ben Boeckel - [https://youtu.be/-kUL4AFblCA](https://youtu.be/-kUL4AFblCA)
* Lightning Talk: What LLMs Won't Ever be Able to Do - Ben Deane - [https://youtu.be/km0JFBfFNJQ](https://youtu.be/km0JFBfFNJQ)
* Lightning Talk: C++ in the Cloud: One NIF at a Time with Elixir - Sakshi Verma - [https://youtu.be/5x9cYWt-BYM](https://youtu.be/5x9cYWt-BYM)
* Lightning Talk: The Present and Future of Cross-Platform GUI in C++ - Matt Aber - [https://youtu.be/p9LeAqoshkQ](https://youtu.be/p9LeAqoshkQ)
* Lightning Talk: Micro C++ Benchmarks & Murphy's Law - Lexington Brill - [https://youtu.be/4yu5PgDEhx8](https://youtu.be/4yu5PgDEhx8)

2025-04-07 - 2025-04-13

* Lightning Talk: C++ and Rust Bindings - Mixing It Best With CMake - Damien Buhl - [https://youtu.be/EcbmDXA4Inc](https://youtu.be/EcbmDXA4Inc)
* Lightning Talk: Every Use Case of Colon and Ellipses in C++ - Ali Almutawa Jr - [https://youtu.be/1blspAWnjUQ](https://youtu.be/1blspAWnjUQ)
* Lightning Talk: Do You Love or Hate Your C++ Build System? - Helen Altshuler - [https://youtu.be/jBnQ69ZMtHw](https://youtu.be/jBnQ69ZMtHw)
* Lightning Talk: Generative C++ - Alon Wolf - [https://youtu.be/y8NXF7WsSEc](https://youtu.be/y8NXF7WsSEc)
* Lightning Talk: Remote Execution Caching Compiler (RECC) for C++ Builds - Shivam Bairoliya - [https://youtu.be/oH1JKMKwDDA](https://youtu.be/oH1JKMKwDDA)

2025-03-31 - 2025-04-06

* Lightweight Operator Fusion Using Data-Centric Function Interfaces in C++ - Manya Bansal - [https://youtu.be/pEcOZDRXhNM](https://youtu.be/pEcOZDRXhNM)
* Security Beyond Memory Safety - Using Modern C++ to Avoid Vulnerabilities by Design - Max Hoffmann - [https://youtu.be/mv0SQ8dX7Cc](https://youtu.be/mv0SQ8dX7Cc)
* To Int or to Uint, This is the Question - Alex Dathskovsky - [https://youtu.be/pnaZ0x9Mmm0](https://youtu.be/pnaZ0x9Mmm0)
* Leveraging C++ for Efficient Motion Planning: RRT Algorithm for Robotic Arms - Aditi Pawaskar - [https://youtu.be/CEY4qRLcLmI](https://youtu.be/CEY4qRLcLmI)
* Guide to Linear Algebra With the Eigen C++ Library - Daniel Hanson - [https://youtu.be/99G-APJkMc0](https://youtu.be/99G-APJkMc0)

**Audio Developer Conference**

2025-04-21- 2025-04-27

* Responsible AI for Offline Plugins - Tamper-Resistant Neural Audio Watermarking - Kanru Hua - [https://youtu.be/Y\_U28ZBh5Xs](https://youtu.be/Y_U28ZBh5Xs)
* An Introduction to Analog Electronics for Audio Software Developers - Jatin Chowdhury - [https://youtu.be/rLJ8C7qIlAU](https://youtu.be/rLJ8C7qIlAU)
* Auditory and Cognitive Neuroscience and the State of Audio Technology - A Multi-Disciplinary Panel Discussion - Rebekah Wilson, Susan Rogers, Micha Heilbron & Ryszard Auksztulewicz - [https://youtu.be/LoVd081XN4s](https://youtu.be/LoVd081XN4s)

2025-04-14 - 2025-04-20

* Roland’s Holistic Approach to AI for Music Creation - Paul McCabe, Ichiro Yazawa & Kazuyoshi Sasamori - [https://youtu.be/ZvUGS754u5Y](https://youtu.be/ZvUGS754u5Y)
* Making Accessible Audio Software - Perspectives of a Blind Music Producer - Trey Culver & Adam Wilson - [https://youtu.be/JeyWnToyd1c](https://youtu.be/JeyWnToyd1c)
* Building a Plugin Assembly Line - The Road to

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

C++ - Reddit

Curling CPython around PVS-Studio
https://pvs-studio.com/en/blog/posts/cpp/1246/

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

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

C++ - Reddit

How would you go about learning Algorithms in C++ in 2025?

Hey all,

So I'm have a small stack of books over Computer Architecture, CPP, and Algorithms.

I am currently working on an Embedded OCR Scanner using TinyML on the side. Thinking about building a Tetris app from scratch on an LCD. Then possibly a JS web app of a Gameboy Simulator (idk if I could incorporate C++/C to this). RISC-V from scratch (most likely in Verilog/VHDL).

How would yall go about studying algorithms for cpp for Quant/Cpp developer/Software Engineer? My goal is to be a C++ Embedded Dev or a remote coding position writing firmware where they pay me to go back to school. In these interviews, are algorithms drilled or is it more conceptual questions, workflow, toolchains, and projects?

If it matters, I'm interested in IoT, RTOS, Embedded, and C/C++/Python, VHDL/Verilog, FPGAs, Embedded Linux, Linux. Any projects, ideas or study regimens are welcome.

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

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

C++ - Reddit

Boost.OpenMethod review starts on 28th of April

Dear /r/cpp community. The peer review of the proposed Boost.OpenMethod will start on 28th of April and continue until May 7th. OpenMethods implements open methods in C++. Those are "virtual functions" defined outside of classes. They allow avoiding god classes, and visitors and provide a solution to the Expression Problem, and the banana-gorilla-jungle problem. They also support multiple dispatch. This library implements most of Stroustrup's multimethods proposal, with some new features, like customization points and inter-operability with smart pointers. And despite all that open-method calls are fast - on par with native virtual functions.

You can find the source code of the library at https://github.com/jll63/Boost.OpenMethod/tree/master and read the documentation at https://jll63.github.io/Boost.OpenMethod/. The library is header-only and thus it is fairly easy to try it out. In addition, Christian Mazakas (of the C++ Alliance) has added the candidate library to his vcpkg repository (https://github.com/cmazakas/vcpkg-registry-test). You can also use the library on Compiler Explorer via `#include <https://jll63.github.io/Boost.OpenMethod/boost/openmethod.hpp&gt;`.

As the library is not domain-specific, everyone is very welcome to contribute a review (or just an insightful comment, or a question) either by sending it to the Boost mailing list, or me personally (posting a response here counts as sending it to me personally). In your review please state whether you recommend to reject or accept the library into Boost, and whether you suggest any conditions for acceptance. Other questions you might want to answer in your review are:

* What is your evaluation of the design?
* What is your evaluation of the implementation?
* What is your evaluation of the documentation?
* What is your evaluation of the potential usefulness of the library?
* Did you try to use the library? With what compiler? Did you have any problems?
* How much effort did you put into your evaluation? A glance? A quick reading? In-depth study?
* Are you knowledgeable about the problems tackled by the library?

Thanks in advance for your time and effort!

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

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

C++ - Reddit

Vibe Coding C++ - Jens Weller
https://www.youtube.com/watch?v=qriIlUOIM4o

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

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

C++ - Reddit

How do you imagine c++ development in the next 30 years?

My Takes:

1) we will have figured tooling out. This means there will be a way that everyone uses for building, package management, lint, format ... maybe all packed into a single config file.

2) the standard wont add new features. I think there will come a saturation point from where we don't make the standard more complicated rather focus on simplicity and teachability.

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

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

C++ - Reddit

Refactoring is secretly inlining
https://brontosource.dev/blog/2025-04-26-refactoring-is-secretly-inlining

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

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

C++ - Reddit

How to design a unicode-capable string class?

Since C++ has rather "minimalistic" unicode support, I want to implement a unicode-capable string class by myself (and without the use of external libraries). However, I am a bit confused how to design such a class, specifically, how to store and encode the data.
To get started, I took a look at existing implementations, primarily the string class of C#. C# strings are UTF-16 encoded by default and this seems like a solid approach to me. However, I am concerned about implementing the index operator of the string class. I would like to return the true unicode code point from the index operator but this seems not possible as there is always the risk of hitting a surrogate character at a certain position. Also, there is no guarantee that there were no previous surrogate pairs in the string so direct indexing would possibly return a character at the wrong position. Theoretically, the index operator could first iterate through the string to detect previous surrogate pairs but this would blow the execution time of the function from O(1) to O(n) in the worst case. I could work around this problem by storing the data UTF-32 encoded. Since all code points can be represented directly, there would not be a problem with direct indexing. The downside is, that the string data will become very bloated.
That said, two general question arose to me:

When storing the data UTF-16 encoded, is hitting a surrogate character something I should be concerned about?
When storing the data UTF-32 encoded, is the large string size something I should be concerned about? I mean, memory is mostly not an issue nowadays.

I would like to hear your experiences and suggestions when it comes to handling unicode strings in C++. Also any tips for the implementation are appreciated.

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

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

C++ - Reddit

How do you write Safe C++ Code ? Really Safe C++ code ?

Hi Guys,
A Biomedical Engineer here (but I am also a Computer Engineer), I have been learning C for Embedded Systems and also learning Rust (because it's currently the hot topic in MedTech for safety features), I am also exploring C++ on the side for Some passion projects like Low Level OS Systems, I was originally planning to use Rust but I thought to myself why not just use C++ like every other OS development?

Rust is still young and mature but is there a way to write Safe C++ code specially when every major news is all about Rust and Safety , and how C++ is dead,

I believe C++ will always be there and Rust will create more nuance because of its borrow checker and limited development environment for OS Development and reliance of LLVM.

So how do you write Safe C++ for low level stuff like Operating Systems and Networking Applications?

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

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

C++ - Reddit

Hi Guys, I made a little channel where I am focused on c++ and the application of it in small games and graphics; join me if you are interested.
sonofspades" rel="nofollow">https://www.youtube.com/@sonofspades

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

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

C++ - Reddit

A taxonomy of C++ types
https://blog.knatten.org/2025/04/25/a-taxonomy-of-c-types/

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

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

C++ - Reddit

Any WebRTC Audio Processing Module separated repository?

Has anyone got a public repository for the WebRTC Audio Processing Module (APM) that can be cloned and built directly with CMake or Meson without all the GN build system complications?

I cloned the main webrtc repository, but just configuring it to build on windows seems like a nightmare.

I am trying to get a shared library (DLL) with updated AEC3, I was using this cross-platform/webrtc-audio-processing, which uses the Meson build system, but it appears to be based on the 5-year-old AEC2 module.

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

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

C++ - Reddit

Microsoft revokes C++ extension from VS Code forks
https://www.theregister.com/2025/04/24/microsoft_vs_code_subtracts_cc_extension/

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

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

C++ - Reddit

libc++ sort patch by Deepmind: false statement or I'm missing something?

I'm looking at the code that has been changed in libc++ sort.h file back in 2022 by the Deepmind researchers who wrote the paper https://www.nature.com/articles/s41586-023-06004-9. In the commit they made they said "We are introducing branchless variants for sort3, sort4 and sort5. These sorting functions have been generated using Reinforcement Learning and aim to replace sort3, sort4 and sort5 variants for integral types."

I'm trying to take parts of the code of __algorithm.sort.h and compile it on Godbolt on the same architectures and with the same flags they used, however, despite the assembly code generated when sorting integral types is branchless and certainly more efficient than the one that was generated prior to the commit, it is not the one that AlphaDev found and it is also longer than the previous state of the art based on sorting networks.

To me it looks like they did not introduce the new optimal sort3, 4 and 5 functions in libc++ as there is no way to make c++ code compile into that.

Am I missing something or they actually stated something that is not true both on the commit and on the paper itself?

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

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

C++ - Reddit

What is the state of modules in 2025?

Used it a couple of years ago and it wasn't that great, I coudnt even import standard libraries... I was wondering how it is now before starting a new project

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

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