C++ Must Become Safer
https://www.alilleybrinker.com/blog/cpp-must-become-safer/
https://redd.it/1e5lqa1
@r_cpp
If a project only uses STL, how hard is it to port
Hey! I use Linux and im currently developing a game that I would like to have both windows and Linux builds. My game should only need to use stl functions, so how hard would it be to port from Linux to windows. I’ve also heard of mingw++ but have never used it
https://redd.it/1e5in0y
@r_cpp
C C++ language resources
Hi, I'm interested to learn C C++ language like codes used in llama.c by @Andrej Karpathy. Kindly share some resources.
Thanks
https://redd.it/1e5gata
@r_cpp
Difference between ODR and Naming collision?
ODR
https://www.learncpp.com/cpp-tutorial/forward-declarations/
Naming collision
https://www.learncpp.com/cpp-tutorial/naming-collisions-and-an-introduction-to-namespaces/
​
Is there more clear, short example that illustrations the difference between violation of ODR and naming collision? Are all violation of ODR same thing as naming collision and vice-versa?
​
​
https://redd.it/1e5ch94
@r_cpp
Google C++ open-source projects
I’m a C++ engineer who’s worked on Chromium, Node.js, and currently gRPC. I decided to summarize the open-source projects I use for my experiments. Check it out here: https://uchenml.tech/cpp-stack/
https://redd.it/1e569nh
@r_cpp
Debugger similar to CLion’s GUI debugger?
Hello,
Currently I am trying to move away from using CLion IDE, but I really love the GUI debugger, especially the part where I can set breakpoints pretty much wherever I want in code and the memory viewer. I was wondering if there were any debuggers similar to this on linux?
Thanks
https://redd.it/1e50c3s
@r_cpp
WG21, aka C++ Standard Committee, July 2024 Mailing
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/#mailing2024-07
https://redd.it/1e520d3
@r_cpp
interfacing python with c/c++ performance
I want to write a heavy app with a web interface. I've been writing C++ for about three years, and I'm reluctant to give up its performance and flexibility for Python's ease of use and connectivity. I understand that sometimes C++ can pose challenges when connecting with a web interface. However, I don't want to abandon it entirely. Instead, I'm considering writing both Python and C++ in the backend of the project.
My main concern is performance. Will pure C++ be significantly faster, or can I achieve comparable optimization with a combination of C++ and Python? I would appreciate any insights or experiences you have with using both languages in a project, like what Meta or PyTorch does.
https://redd.it/1e4z2m4
@r_cpp
Cant add a library to save my life
I failed to add libcurl libraries to both visual Studio Code & CodeLite.
In CodeLite I added the library, but when using the libraries functions the application gives missing dll errors.
In visual studio code, I tried using vcpkg to install the libcurl library and I tried adding the library to the C/C++ extension include path.
But VSC still says it can not find the header file.
How do I add a library to my cpp code?
I about to move on to visual studio community.
https://redd.it/1e4sovu
@r_cpp
Forward declarations and concepts (is MSVC wrong here?)
I've been hitting the same issue with MSVC over the course of the last few years, that is, it really does not like when forward declarations and concepts get mixed in.
I wrote an (arguably dumb) example to better clarify what I'm talking about. Note that if I remove the concept, this sample works perfectly under every compiler I tested it with:
#include <iostream>
#include <type_traits>
std::ostream& operator<<(std::ostream &os, const std::byte b) {
return os << "byte(" << static_cast<unsigned>(b) << ')';
}
template <typename T>
struct serializer;
template <typename T>
concept Serializable = requires(struct accumulator &p, const T &t) {
typename serializer<std::decay_t<T>>;
serializer<std::decay_t<T>>{}.serialize(p, t);
};
template <Serializable T>
void serialize(class accumulator &p, const T &val) {
serializer<std::decay_t<T>>{}.serialize(p, val);
}
struct accumulator {
void accumulate(const auto &val) {
std::cout << "accepting' " << val << '\n';
}
};
template<>
struct serializer<std::byte> {
void serialize(accumulator &p, const std::byte b) {
p.accumulate(b);
}
};
int main() {
const std::byte b { 23 };
accumulator p {};
serialize(p, b);
return 0;
}
This code:
- builds fine on GCC 14.1
- builds fine on Clang 18.1
- fails on CL 19.38, with an incredibly vague error message that implies that the `Serializable` concept failed:
Microsoft (R) C/C++ Optimizing Compiler Version 19.38.33134 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
dump.cc
dump.cc(41): error C2672: 'serialize': no matching overloaded function found
dump.cc(19): note: could be 'void serialize(accumulator &,const T &)'
dump.cc(41): note: the associated constraints are not satisfied
dump.cc(18): note: the concept 'Serializable<std::byte>' evaluated to false
dump.cc(15): note: the expression is invalid
The ultimate cause for this is the forward declaration of `accumulator` inside the `requires` block; indeed, moving the definition of `accumulator` above the concept immediately fixes the issue.
I first met this behaviour 2 or 3 years ago when I first started writing C++20 code with concepts; given that it still doesn't work it makes me suspect it's deliberate and not a shortcoming in MSVC's frontend. It's clearly related to the class being forward declared, though.
Am I missing something? Is this UB?
https://redd.it/1e4lh3a
@r_cpp
How does multimap allows duplicate key ??
Since std::multimap uses balanced BST or RBT how does duplicate key get stored if it used the "<" than comparison operator as well??on what basis does the comparison occurs sorry if this is a noob question
https://redd.it/1e4hw38
@r_cpp
Natvis for boost::concurrent_flat_map, and why fancy pointers are hard
https://blog.ganets.ky/NatvisForUnordered2/
https://redd.it/1e4fmta
@r_cpp
Less crashy crashes with signal handling
https://www.robopenguins.com/less-crashy-crashes/
This is an article I wrote with a companion github repo https://github.com/axlan/crash\_tutorial . The goal is to explore what happens when a segfault or some other fatal operation occurs, and what actions your program can still take. It mostly explores signal handling, core dumps, and backtraces.
I end it with a very cursed example of designing a unit test framework to test if functions crash without actually crashing the process.
https://redd.it/1e47p9o
@r_cpp
Is STL forbidden in technical interviews?
I have read some companies interviews and some folks say interviewers don't allow them to use stl. Is that true? Do we have to do everything on our own? I will much appreciate if you share your experience.
https://redd.it/1e3wasf
@r_cpp
How would you capture the runtime state of a program?
The Problem:
How does one program can capture the state of another program during runtime?
Example:
I have the following program:
#include <iostream>
int main() {
int i = 0;
char ch;
while ((ch = std::cin.get()) != 120) // (x in ASCII)
{
i++;
}
std::cout << i;
return 0;
}
I want to code another program, in a different file, which at compile time inject the necessary code to main, so whenever the value of i is changing, my program gets notified of the new value.
I would be happy for any leads / tips / interesting references.
https://redd.it/1e5ppda
@r_cpp
Choosing a C++ Formatting/Naming Convention
Hey everyone,
Our team is in the middle of deciding on new formatting and naming conventions for our C++ projects. We've got it down to two big names: Microsoft's and Google's style guides. If you want to check out a comparison, you can find it here: motine/cppstylelineup: a comparison of common C++ style guides (github.com).
Just to clarify, we're focusing specifically on formatting and naming conventions. For everything else, we're planning to stick to the Cpp Core Guidelines.
We're a bit stuck on which one to go with, as this topic is very opinionated within our team. One idea we had was to see which style is most commonly used in open-source software projects. We figure that following a widely adopted convention might make integration of OSS projects smoother.
Does anyone know if there are any stats or resources that show how often these formatting and naming rules are used in OSS projects? Any insights or data would be super helpful.
Thanks a lot for your help!
https://redd.it/1e5jy3y
@r_cpp
Cmake can’t find installed packages from vcpkg in visual studio.
https://link.medium.com/Qrms7O8rgLb
https://redd.it/1e5i2kj
@r_cpp
Thinking of learning C++
Hey everyone,
I just thought I'll reach out for some advice here to all the C++ veterans here.
I'm a 8yoe software developer, I'd say I'm a mediocre dev mostly worked in web application companies and using tech stack like Java, Nodejs, Kotlin, React etc.,
My career so far has been nice and I see it growing as well for my line of role. Now I have two paths and I'm deciding which one to take.
Shift to HFT/Hedge funds
This would require a total shift from whatever i know I've done some research and it seems like I have to learn C++ and Python and I don't know either of them even on hello world basis
Pros
Good money
Lots of new learning in finance/trading domain which can be exciting
Can switch to hardware companies like Nvidia etc., which I totally can't do right now. I also know some specific teams in FAANG use C++ the high performance ones
Cons
WLB might take a hit as I get older I'm already 30
Career progression is well defined in tech startups or FAANG like companies not sure how good the growth is in HFTs
Lesser options and higher bar in lateral moves to shift jobs so might be pretty difficult to switch places.
Significant learning curve and I might as well be New grad level and suck at it. I've read C++ is a long journey to master and can even take upto 2 years before I even become decent at it
Path two is defined in Big Tech area
Pros:
I already am a Senior and can keep hopping as Senior for higher compensations until I decide to move to Staff/EM leadership roles
Management/IC tracks are well defined and even if I have a bad year I know that stocks will still save the day as opposed to HFT where it's all bonus based
Good amounts of opportunities
Learning curve exists as well but it's more abstract level than low level such as C++
Cons:
Restricted to just Internet Tech companies
Very much dependent on tools or providers such as Kafka, AWS etc., so it's more like connecting things with tools at hand and choosing the best possible architecture for problem solving
Money isn't as good as HFT and too much Politics/Promotion driven in pretty much every place where the pay is decent. Plus in this climate seems like Layoffs are the new norm in Tech companies constantly so not sure how long the wave will continue with AI.
I'm reaching out for advice here because I'm sure people here have been probably in the space of C++ for a while and can help tell me whether it's worth pivoting my options. Due to steep learning curve and letting go of my seniority it's a bit difficult choice and I want to understand a little bit of what I'm getting myself into.
I'm just seeing what's worth investing my personal time in learning obviously I can continue to learn things I know/heard of and continue to master it which can pay me off down the line or take a step back and pivot. I get maybe 1 hour a day even with utmost planning to learn something due to work, commute, family stuff etc., and it's only gonna continue being more so its important for me to understand this.
Thanks for taking time to read this.
https://redd.it/1e5dsua
@r_cpp
C++ Modules: Build ‘Em All with CMake and Clang - 2024 EuroLLVM
https://www.youtube.com/watch?v=9OwQZ-LRb0c
https://redd.it/1e587m0
@r_cpp
type hint C++ in Visual Studio
can I ask everyone this question. if I use C# in Visual Studio, I can press enter to apply type hint, but C++ must use tab to im apply this. In vscode, C++ can press enter to apply type hint. I feel very angry when have to press tab everywhere. how to fix it
https://redd.it/1e56f02
@r_cpp
Is there a way to use vcpkg with PortableBuildTools
I don't like the Visual Studio editor so I installed MSVC via [PortableBuildTools](https://github.com/Data-Oriented-House/PortableBuildTools). For package management I installed vcpkg, but every time I try to install a package, this error message appears:
-- Running vcpkg install
Fetching registry information from https://github.com/microsoft/vcpkg (HEAD)...
error: in triplet x64-windows: Unable to find a valid Visual Studio instance
Could not locate a complete Visual Studio instance
-- Running vcpkg install - failed
CMake Error at %VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake:902 (message):
vcpkg install failed. See logs for more information:
.\build\vcpkg-manifest-install.log
The message is not exactly the same because I shortened paths for where vcpkg is installed and the location of the log file, everything else is the same.
https://redd.it/1e54b8g
@r_cpp
Problem with installing cpp to postgresql connector
Hi, i recently decided to create a new project for my portfolio and my qt-app is OK, db on postgre is OK, but the library pqxx is not working. Im looking for person would like help me and discuss this topic in discord. Im glad to get any kind of help) A willing person will be rewarded with a small amount for his efforts!
https://redd.it/1e51pcp
@r_cpp
Latest News From Upcoming C++ Conferences (07/16/2024)
This Reddit post will now be a roundup of any **new** news from upcoming conferences with then the full list now being available at [https://programmingarchive.com/upcoming-conference-news/](https://programmingarchive.com/upcoming-conference-news/)
**New News**
* **ACCU** - Have started releasing their videos! If you want to stay up to date as new videos are released, then subscribe to their YouTube Channel! [ACCUConf" rel="nofollow">https://www.youtube.com/@ACCUConf](ACCUConf" rel="nofollow">https://www.youtube.com/@ACCUConf)
* **C++Now** - Have added a third batch of 2024 videos to their early access portal. More information about early access including what videos have been added to the early access portal can be found here [https://cppnow.org/announcements/2024/06/early-access-now-open-for-cnow-2024-youtube-videos/](https://cppnow.org/announcements/2024/06/early-access-now-open-for-cnow-2024-youtube-videos/) and anyone who attended C++Now 2024 or who has purchased an early access pass should already have information about how to access the portal.
* **C++OnSea** - The main Conference starts tomorrow! You can still buy tickets here [https://cpponsea.uk/tickets/](https://cpponsea.uk/tickets/).
* **CppNorth** - Have extended their special offer which gives a $800 discount. More information can be found here [https://cppnorth.ca/news-2024-hotel-discount-extension.html](https://cppnorth.ca/news-2024-hotel-discount-extension.html) and is now available while stock lasts
* **CppIndiaCon**
* The call for speakers has now closed.
* Early Bird Tickets have now finished. Regular tickets can be purchased here [https://konfhub.com/cppindiacon2024](https://konfhub.com/cppindiacon2024)
* **CppCon**
* Early Bird Tickets are no longer available with tickets now being sold at the standard price.
* Applications for the "Attendance Support Ticket program" is now closed
* **C++ Under the Sea** - have announced details and released tickets for workshops that will take place on the 10th October. More information can be found here [https://cppunderthesea.nl/workshops/](https://cppunderthesea.nl/workshops/)
* **Audio Developer Conference (ADC)**
* Registration is now open for ADC 2024 and early bird tickets can be purchased at [https://audio.dev/tickets](https://audio.dev/tickets)
* The call for speakers is now closed
* **Meeting C++** - The call for speakers has been extended with the deadline now being midnight on the 3rd July. Find out more at [https://meetingcpp.com/meetingcpp/news/items/Contribute-your-talk-to-Meeting-Cpp-2024-.html](https://meetingcpp.com/meetingcpp/news/items/Contribute-your-talk-to-Meeting-Cpp-2024-.html)
https://redd.it/1e4rr7q
@r_cpp
What software will replace Cmake?
I am tired of cmake but it's now clearly an industry standard.
Let's look at the future: who has chances to replace it?
https://redd.it/1e4lwni
@r_cpp
POLL C++ Developers working professionally, how happy are you with working with c++ ?
As the title say, I wonder how c++ developers feels about working professionally with c++ ?
There is a poll, but I'm more interested in your personal experience:
Are you maintaining legacy code ?
Does your workplace make you work on another language than C++ on the side ?
Which languages are you working with ?
Do you find the salary satisfying ?
Is C++ your goal or a mean to an end ?
How difficult are the problems you encounter at work ?
View Poll
https://redd.it/1e4kn0r
@r_cpp
When `__cxa_pure_virtual` is just a different flavor of SEGFAULT
https://blog.the-pans.com/pure_virtual/
https://redd.it/1e4gyar
@r_cpp
How to use vcpkg and cmake in Visual studio
https://link.medium.com/Qrms7O8rgLb
https://redd.it/1e4flda
@r_cpp
New C++ Conference Videos Released This Month - July 2024 (Updated To Include Videos Released 07/08/2024 - 07/14/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
**ACCU Conference**
07/08/2024 - 07/14/2024
* Amplifying Black Women's Voices - Building Inclusive Tech Spaces Beyond Tokenism - Yemi Adenekan - [https://youtu.be/0makY11qYs8](https://youtu.be/0makY11qYs8)
* Shaping Perception - The Evolution of 3D Graphics and Cultural Transformation - Ben Kyd - [https://youtu.be/0T7r6zWWUBw](https://youtu.be/0T7r6zWWUBw)
* Gamification - Falling Down the Leader Board? - Char Ryder - [https://youtu.be/qO5sxo\_liR8](https://youtu.be/qO5sxo_liR8)
07/01/2024 - 07/07/2024
* How to Maximize the Benefits of Neurodiversity in Software Development Teams and Support Neurodivergent Developers - Dom Davis - [https://youtu.be/bt25w\_O05KI](https://youtu.be/bt25w_O05KI)
* Future of Software Programming with AI Bots at Hand - Amir Kirsh - [https://youtu.be/bz7M6rOKZLo](https://youtu.be/bz7M6rOKZLo)
* Contracts for C++ - Timur Doumler - [https://youtu.be/lHRyuTFig0U](https://youtu.be/lHRyuTFig0U)
**C++Now**
07/08/2024 - 07/14/2024
* C++ Reflection - Back on Track - David Olsen - [https://youtu.be/nBUgjFPkoto](https://youtu.be/nBUgjFPkoto)
* C++ Coroutines at Scale - Implementation Choices at Google - Aaron Jacobs - [https://youtu.be/k-A12dpMYHo](https://youtu.be/k-A12dpMYHo)
* Keynote: Employing Senders & Receivers to Tame Concurrency in C++ Embedded Systems - Michael Caisse - [https://youtu.be/wHmvszK8WCE](https://youtu.be/wHmvszK8WCE)
**C++Online**
07/08/2024 - 07/14/2024
* Lightning Talk: How I Became a C++ Mentor the "Hard" Way - Paulo Chiliguano - [https://youtu.be/dLobaazrvYg](https://youtu.be/dLobaazrvYg)
* Lightning Talk: Coccinelle for C++ - Julia Lawall - [https://youtu.be/eLyyfXMtR9o](https://youtu.be/eLyyfXMtR9o)
* Lightning Talk: Disentangling The Mikado Method When Refactoring C++ Legacy Code - Phil Nash - [https://youtu.be/W\_v0pvr9pT4](https://youtu.be/W_v0pvr9pT4)
07/01/2024 - 07/07/2024
* Lightning Talk: Keeping Up to LLVM IR: An Introduction to LLVM IR - Isaac David Bermudez Lara - [https://youtu.be/5FbhwOxoJsg](https://youtu.be/5FbhwOxoJsg)
* Lightning Talk: Use SIMD Pairwise Reduction in C++! - Andrew Drakeford - [https://youtu.be/QYkU0u9M9Mg](https://youtu.be/QYkU0u9M9Mg)
* Lightning Talk: Why False Is Less Than True in Boolean Algebra - Ben Deane - [https://youtu.be/vAwYP0Ox96I](https://youtu.be/vAwYP0Ox96I)
**Audio Developer Conference**
07/08/2024 - 07/14/2024
* Why You Shouldn’t Write a DAW - David Rowland - [https://youtu.be/GMlnh6\_9aTc](https://youtu.be/GMlnh6_9aTc)
* Inference Engines and Audio - Harriet Drury - [https://youtu.be/CcSi\_Lgxz-4](https://youtu.be/CcSi_Lgxz-4)
* Building an Accessible Juce App - Harry Morley - [https://youtu.be/wrZyRMxLlx0](https://youtu.be/wrZyRMxLlx0)
07/01/2024 - 07/07/2024
* Creating Ubiquitous, Composable, Performant DSP Modules - Stefano D’Angelo - [https://youtu.be/lKhVtbnILDk](https://youtu.be/lKhVtbnILDk)
* Running High Channel Count Audio Applications on Linux RT - Olivier Petit - [https://youtu.be/1TgzjOoiqIs](https://youtu.be/1TgzjOoiqIs)
* Odd Challenges of Using Deep Learning in Designing a Feedback Delay Network Reverb - ADC23 - [https://youtu.be/5URLvwFmlb0](https://youtu.be/5URLvwFmlb0)
https://redd.it/1e3zfir
@r_cpp
Reversing PE files statically modified by Microsoft Detours
https://www.codeproject.com//Articles/5322891/Reversing-PE-files-statically-modified-by-Microsof
https://redd.it/1e3vy71
@r_cpp