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

QT vs Dear ImGui vs ___? For cross platform GUI?

QT seems to have the most features, but also the most confusing licensing. Dear ImGui looks like the best option but then again, those are the only two I'm aware of, so I'm wondering what people here like to use for this.

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

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

C++ - Reddit

There is a 'roast my car' sub. Now, here, and please do, roast my code

Here it is, please roast it

#undef NULL
#define NULL nullptr;



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

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

C++ - Reddit

Ask reddit: Complex (but faster) vs simple (but slower) code

During my career, I've had to implement a gaming framework multiple times (>4) for different clients. As my experience grows, the performance and features grow each generation. My previous engine is a Vulkan renderer with an Actor programming module and hundreds of features, smart caching, its blazing fast and incredibly complex. The number of engineers that understand the engine is small.

My latest client requires an educational rendering framework, its really simple to read and understand, basic features and simplistic caching, and lacks the "squeeze the last drop of performance out of the code" design. The number of engineers that can understand the code is high.

I must confess that I'm enjoying working in the simpler code base more. It lacks complexity, but also has less features and performance. I'm beginning to question whether extra complexity is really worth the hassle. Of course, it all depends on the target project.

There is a comic that shows the journey from beginner to expert to guru, and the guru code matches the beginer code.

Any gurus on Reddit willing to share their experience on how they approach new dev projects after doing the beginner->expert->guru journey. Is simpler better? Or since the gurus have the know-how, do I continue pressing pedal to metal to gain a few extra percentage points performance (and make the beast scarier to maintain).

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

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

C++ - Reddit

New C++ Conference Videos Released This Month - June 2024 (Updated To Include Videos Released 06/03/2024 - 06/09/2024)

This month the following C++ videos have been published to YouTube. A new post will be made each week as more videos are released

C++Online

06/03/2024 - 06/09/2024

Vulnerable C++ - Peter Sommerlad - [https://youtu.be/CALka5ZldL0](https://youtu.be/CALka5ZldL0)
Debugging Your Hardest C++ Bugs With Time Travel Debugging from Undo - Greg Law - https://youtu.be/R6QQT8sSmcA
Best C++ Debugger for Large Scale Linux Codebases 2024 - [https://youtu.be/H9WiyFzaB4o](https://youtu.be/H9WiyFzaB4o)

05/27/2024 - 06/02/2024

Designing for C++ Concurrency Using Message Passing - Anthony Williams - https://youtu.be/D1oBq4PIEW8
Beginners' Guide to C++20 Coroutines - Andreas Fertig - [https://youtu.be/4xdef0fRsQ0](https://youtu.be/4xdef0fRsQ0)
Keynote: Can AI Replace Programmers? - Frances Buontempo - https://youtu.be/jX\_NoK-xdrk

Audio Developer Conference

06/03/2024 - 06/09/2024

Diversity in Music Technology: Diversity Initiatives and Insights From Music Information Retrieval - [https://youtu.be/MiDQpWrYur4](https://youtu.be/MiDQpWrYur4)
ORCA Livecoding Soundscape for Theatre - Padmanabhan J - ADCx India 2024 - https://youtu.be/IK1N5bNFc0I
Collaborative Songwriting & Production With Symbolic Generative AI - Sadie Allen & Anirudh Mani ADC - [https://youtu.be/9prniy6NutY](https://youtu.be/9prniy6NutY)

05/27/2024 - 06/02/2024

How to Write Bug-Free, Real-Time Audio C++ Code? - Jan Wilczek - https://youtu.be/Tvf7VVH53-4
Using Convolution for Archeo-Acoustic Conservation - Akash Sharma - [https://youtu.be/XP4N1BWE5Jo](https://youtu.be/XP4N1BWE5Jo)
Vars, Values and ValueTrees: State Management in JUCE - Jelle Bakker - https://youtu.be/pXmXLB7Kbds

C++OnSea

C++OnSea have also released some interview videos with some of their 2024 speakers to promote their upcoming conference which you can find in this playlist

https://www.youtube.com/playlist?list=PL5XXu3X6L7jsQpt18\_TNitUW5KquxMSan

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

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

C++ - Reddit

Effective usage of constexpr

Hi cpp community,


I am a dev working on a huge cpp code base and I have never really used constexpr in my daily job as a cpp programmer.
I think I understood the basic intent of constexpr and what it tries to tell the compiler in terms of optimization. However I often hesitate using constexpr since I don't really profile the runtime performance of single functions or the compilation times (with or without using it). In addition, I think that it often can't be used if you heavily use concepts like polymorphism and therefore may even extend the compilation time.

TLDR: I want to use it more to optimize my runtime performance, but miss a clear guidline when it should be used. Due to my concerns regarding compile times, I wouldn't place it everywhere in the code. As a programmer: Maybe a static code analysis tool would be great that notifies me if it might be useful. Do you have similar experience or even advice for me?

Best wishes!

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

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

C++ - Reddit

Using latest Clang compilers on an old Mac?

I want to use the latest C++ standards, but I'm limited to C++17. The reason for this is:

1. My Macbook Pro is from the year 2014.
2. Apple dropped new Xcode version support a long time ago for my computer.

So how can I get the latest Clang working on my computer without it breaking the Xcode's native C++17 support I have working currently? I use C++17 for work so I don't want to risk breaking it. I want to somehow SAFELY get the latest C++ working in parallel with the current XCode/C++17.

Maybe some virtual machine dedicated to compiling new C++ standard? I.e. it would have access to some folder on my computer where all the source code would be and it would also output the executable there?

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

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

C++ - Reddit

A Simple C++ Package Downloader
https://www.npmjs.com/package/ypkg

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

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

C++ - Reddit

Implementing IRQ Handlers in C++23 on the Sega Dreamcast
https://fxtwitter.com/falco_girgis/status/1798947168101056574

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

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

C++ - Reddit

C++ programmer′s guide to undefined behavior: part 1 of 11
https://pvs-studio.com/en/blog/posts/cpp/1129/

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

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

C++ - Reddit

Inconsistent implementation, systemclock is inconsistent in different compilers!

Recently, when I was writing and reading articles revealing the secrets of the STL kernel, I found that the wait\
until interface calls chrono, and I found that the implementation of chrono by gcc and clang is inconsistent. This can easily mislead us during development and cause some hidden bugs.

# systemclock Default Time Units in Different Compilers.

**GCC (**`g++-13`**)**

In GCC, the default time unit for `system
clock is nanoseconds (std::chrono::nanoseconds). This is defined as follows:

struct system_clock
{
typedef chrono::nanoseconds duration;
};

**Clang**

In Clang, the default time unit for 
systemclock` is microseconds (`std::chrono::microseconds`). It is defined as:

class
LIBCPPTYPEVIS systemclock
{
public:
typedef microseconds duration;
};

This discrepancy means that when compiling the same code with different compilers, the precision and behavior of time calculations can vary.

# But steady
clock is indeed consistent.




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

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

C++ - Reddit

Integrating C++ header units into Office using MSVC (3/n) - C++ Team Blog
https://devblogs.microsoft.com/cppblog/integrating-c-header-units-into-office-using-msvc-3-n/

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

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

C++ - Reddit

Make it Async: Building Shared Async Resources with ASIO
https://blog.vito.nyc/posts/make-it-async/

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

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

C++ - Reddit

April talk video posted: “Safety, Security, Safety[sic] and C/C++[sic]”
https://herbsutter.com/2024/06/03/april-talk-video-posted-safety-security-safetysic-and-c-csic/

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

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

C++ - Reddit

Using namespaces effectively
https://biowpn.github.io/bioweapon/2024/06/05/using-namespaces-effectively.html

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

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

C++ - Reddit

I need a local memory cache in C++, can I use any useful lib or tools?

I know SQLite is a simple and useful database.

I wonder if i can find a simple and useful Memory Cache in C++.



I always use std::map to be a memory cache, it's useful and easily.

But sometimes std::map is not enough to deal with the problem, so I had to coding for more function.



Can I find a lib or tools jut like "Redis lite" in C++?



I hope the memory cache comes with advanced features such as timers and queues.

I hope the memory cache is thread safe.

Clustering and data persistence features like Redis are unnecessary.

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

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

C++ - Reddit

Building a fast single source GPGPU language in C++, and rendering black holes in it
https://20k.github.io/c++/2024/06/10/gpgpgpu.html

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

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

C++ - Reddit

What is the most efficient way to build a string with many parts?

In this example, there are many intermediate copies and memory allocation for intermediate strings.

    std::string str = "First ";
for (auto obj : list){
str += obj.get_word() + ": " + std::to_string(obj.number());
if (obj.has_extra()){
str += " - " + obj.get_extra();
}
str += "!";
}


I could perform a first iteration to count the total size, allocate memory and perform a second iteration to concatenate everything manually. The problem is that it is too verbose.

I know about std::fmt, but the number of fragments has to be known at compile-time.

Java has the StringBuilder class. It collects each fragment and build the full string in the end. Maybe C++ has some third-party library with this feature.


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

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

C++ - Reddit

I've developed a VS Code extension to make code variables easier to distinguish!

Hi everyone!
Although I know not all programmers here use VS Code, I just want to share my first VS Code extension: Bread Jam! 🎉

NOTE: You must install the ms-vscode.cpptools extension to make this extension work.

Bread Jam is designed to enhance readability in your code by making lengthy variable names easier to manage. It allows you to customize the colors of these components, helping you to quickly identify and differentiate between various parts of your codebase.

Features:

11 Render Patterns to select
Customizable Color Coding: Tailor the appearance of your code to suit your style or project needs.
Multi-Language Support: Currently supports JavaScript, TypeScript, Python, Java, Dart and more.
Quick Toggle: Easily switch the extension's effects on or off using keyboard shortcuts. Use Alt + B, Alt + J for Windows & Linux or ⌥ + B, ⌥ + J for MacOS.

I'd love for you to try it out and share any feedback you might have!

VS Code Marketplace
GitHub repository

PS: A screenshot of the effects of this extension is in the comment section.

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

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

C++ - Reddit

Related C++ framework toward an Android developer

Hi everyone,

I have experience in developing mobile applications (Flutter, Kotlin Android).

Currently, I'm interested in C++ when doing Leetcode, I wonder if there's any C++ framework or application that an Android developer can benefit from them. I want to try something new on boring days.

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

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

C++ - Reddit

libg203lightsync: lib for programmatically interacting with the Logitech G203 LS mouse
https://github.com/carlos-menezes/libg203lightsync

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

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

C++ - Reddit

Will Work for Free

Hey I’m still a beginner programmer, but I know a handful of languages(just the basics) and I would like to gain experience and build my portfolio by completing real projects. Are there advice or leads anyone can give me?

I’m a quick learner, an excellent problem solver and most importantly I am a very hard worker.

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

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

C++ - Reddit

What's the deal with std::type_identity?
https://devblogs.microsoft.com/oldnewthing/20240607-00/?p=109865

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

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

C++ - Reddit

BRANCH AND BOUND / DFS SEARCH PARALLELISM IN CPP/CUDA

Hi guys im currently working on a project regarding finding the max common substructure between two molecules, and i'm modelling the problem as a Integer Programming with Branch and Bound. I have two algorithms for now, one recursive and one iterative, im trying to write a parallel approach for both CPU and GPU and test them.
For the GPU to be worth a try i need to do a WFS so i can actually create a simultaneous DFS for each node, by using differents thread pools.
Instead for the CPU im trying to find a good DFS parallel approach to branch and bound faster, since usually B&B problems makes sense if you do a DFS, did someone already deal with this CPU implementation of a parallel DFS search? Does someone has some suggestions on how to approach it better without dealing with too many thread pool locks ?

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

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

C++ - Reddit

C++ Temporary Lifetime Extension: Mistakes and Solutions
https://hackernoon.com/temporary-lifetime-extension-mistakes-and-solutions

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

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

C++ - Reddit

C++ assignments/programs to work on while learning?

Hi, so I took a lot of programming classes in high school, and went to school for computer science for 2 years. I ended up going for something else, but I've been brushing up on my programming for a possible internship opportunity. In high school/college, all my classes were Java based.

So, I've been watching a TON of tutorials/lectures/and series for C++ and I'm feeling pretty good, and I'm remembering a lot of programming concepts, and learning the C++ syntax. Only issue is that I don't have the school-like assignment setup, where I'm using these concepts that I'm learning for programs and turning them in. I was wondering if there is any good online resources that have a school-like assignment process for C++, preferably something that would be slightly more beginner-friendly? I feel like this would be very useful for me as I'm learning on my own, and it would keep me motivated and give me the opportunity to practice actually programming.

Sorry if this is a strange question, but was wondering if any other self learning C++ programmers have come across online resources. Thanks!

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

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

C++ - Reddit

Multi-version Doxygen documentation with GitHub Pages
https://oleksandrkvl.github.io/2024/06/05/multi-version-doxygen.html

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

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

C++ - Reddit

free IDE for c++ on mac

I use macos sonoma, I often use CodeBlock but on mac it is no longer supported. So can anyone suggest me some free IDEs for mac?

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

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

C++ - Reddit

Perfect Hashing in an Imperfect World

Unlike regular hash functions, so-called perfect hash functions guarantee that no collisions ever happen, that is, every two distinct keys map to different hash values, which allows for the construction of hash tables with strict O(1) performance. This seemingly impossible feat comes with the tradeoff that the set of elements must be known in advance prior to table initialization. In this talk we'll review the basics of perfect hashing theory, explain some of the most common algorithms found in the literature, review some C++ perfect hashing libraries and learn how perfect hashing can be used to improve the efficiency of our programs.

* [Video](https://youtu.be/yOo6GnbKzp8)
* [Presentation](https://github.com/joaquintides/usingstdcpp2024/raw/main/Perfect%20hashing%20in%20an%20imperfect%20world.pdf)
* [Repo](https://github.com/joaquintides/usingstdcpp2024)

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

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

C++ - Reddit

Chess Console Game in C++
https://www.codeproject.com//Articles/1214018/Chess-Console-Game-in-Cplusplus

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

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

C++ - Reddit

Made a N-Body Simulator with custom start configuration

Hey guys, I've been working in a project in the past months that I would love you to test and give me some feedback about compilation, performance and general stuff. Basically the project is a N-Body Simulator with custom start positions for the celestial bodies. It uses C++ and Axolote Engine (A graphical engine that I made last year, that uses OpenGL), so if you have some problems with it please tell me. The link for the repo is here: https://github.com/JotaEspig/nbody-simulation

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

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