r/cpp • u/meetingcpp • May 03 '13
r/cpp • u/jpakkane • May 13 '17
Emulating the Rust borrow checker with C++ move-only types
nibblestew.blogspot.comLiving on the edge with reinterpret_cast
Given a statically allocated array, is it defined behavior to reinterpret_cast the pointer to the array to a pointer of the element type? It feels doable since the array is static and hence laid contiguously in memory but I'm really not sure at all whether it is standard. It works on my compiler but I need it to be defined behavior as per the standard.
r/cpp • u/EducationalCicada • Jan 01 '22
Everything You Never Wanted To Know About C++'s random_device
pcg-random.orgr/cpp • u/muungwana • Jul 21 '17
My first UB causing g++ and clang++ to take different code paths leading to clang++ causing segfault.
r/cpp • u/FlibbleMr • Oct 25 '20
Creating a C++ logging framework from scratch
r/cpp • u/antara33 • Dec 17 '23
Cpp std features and tech domains
Hello fello C++ developers!
I been reading a lot this sub and it always comes to the conversation that the std have a lot of things, and that you are expected to learn what its related to your tech domain.
So here is my question:
What parts of the std do you link to what domains?
If you were to recommend someone that aims to build servers what they should start learning, what would you suggest? Why?
Same for other domains ofc, I'm curious on how the experience and language features varies per domain and usage, and how you find out what you need or where to search for it.
Edit: it seems that my question was not laid out correctly.
Im not asking specifically about server stuff for my line of work, I'm asking about yours.
So, what do you do? What parts of C++ do you use? Why those?
Sorry if my initial post was unclear!
r/cpp • u/CoralKashri • Apr 24 '23
The View of The String
std::string_view can optimize both performance and code readability in code sections which handle strings. However it can also lead to UB and to memory issues if used incorrectly.
r/cpp • u/New_Positive8091 • Apr 01 '22
C++ and job opportunities
So, I wanted to ask what are the job opportunities with c++ especially as a junior. For more context, I'm in high school, almost finishing it and I've been writing codes in c++, but it was more oriented towards to contests or competitive programming on sites like codeforces, so it was more based in solving problems and logic, I've tried creating an app, but I had a burn out since I should've done it very fast and I didn't get to actually understand what I was writing, so I was wondering what can I do in terms of getting a job, maybe not well paid for the moment, but more so that I could get some experience. And also, if you have some recommendations on YouTube channels that could help me with learning, I would gladly received them. Thanks in advance.
r/cpp • u/bsdooby • Mar 01 '23
[Q] Windows: non-MSVC Toolchains
I'm unsure what the "best" C++ compilers (ease of installation, updateability usability, supported C++ standard, code perf.) are on current Windows systems, not counting MSVC. MSys, MinGW, Gygwin, etc. ...
r/cpp • u/acwsupremacy • Mar 30 '15
Simple Question
So I was thinking the other day, and I came up with an idea that I decided to try... a function returning an anonymous struct!
I tried it, and lo and behold, it doesn't compile. A closer look reveals that the Standard specifically disallows defining new types as the return type of a function definition! Though it does appear that I can return an anonymous struct using decltype, that is even more code than simply defining a new type name.
My Simple Question is... why? What reason did the standards committee have to explicitly disallow this? Is this a case of them trying to save users from their own stupidity, or is this technically infeasible somehow?
r/cpp • u/lewispringle • Dec 13 '22
Stroika - an open-source, modern, portable, thread-savvy, C++ application framework – is released
Key features include:
high performance, copy-on-write container class library
streams library (not like stl streams)
serialization support (c++ objects to/from json, and other formats)
networking library
Integrated webservice support, making it easy to build web-service functionality into your c++ application
See https://github.com/SophistSolutions/Stroika#readme for more details
r/cpp • u/drashia • Oct 29 '13
This is going to be an incredibly noob question but... (about pointers)
Were pointers always an available data type in the early days of the C language? Just a curious question.
r/cpp • u/cosmotriton • May 18 '12
Developing Windows 8 Metro style apps with C++ -> Live Streaming at 0900 PDT, May 18 (Channel 9)
r/cpp • u/cppnext • Feb 05 '18
Exceptions is one of the controversy mechanism in C++. Should I use them?
r/cpp • u/lingua_franca • Feb 25 '13
Stanford RAMCloud: a new class of storage, based entirely in DRAM, that is 2-3 orders of magnitude faster than existing storage systems.
ramcloud.stanford.edur/cpp • u/grahamcj3 • Nov 04 '12
Help with C++
I will need some help sometime soon but I want to know the correct subreddit in which to ask for help on it, so if this isn't the correct thread please direct me to the correct one. :) Please and thank you.
r/cpp • u/BoxConscious7480 • 4d ago
Specific features you look for in a logger
For the past months I've been developing a c++20 async logging library similar in architecture to Quill or fmtlog. It started out just as a small project mostly for learning more about multithreading and lock-free algorithms, but then it grew to be pretty competitive in feature set and performance, so I decided to try and release it.
It's not ready yet but it's getting there. Performance wise it either beats or matches Quill in frontend latency depending on the cpu, and backend throughput is consistently about twice as high partly thanks to c++20 consteval. Feature wise it is much slimmer than Quill obviously, but that could be an advantage for compile times and general ease of use and configuration (I've focused a lot on making configuration easy).
Now to my question: Outside of the standard feature set like levels, level filtering, rolling file sinks, etc, do you look for any specific features in a logging library? Maybe some specific sink type, structured logging to a niche format, more advanced runtime log filtering (for example filtering on file, named log statement groups, or even individual statements), or something else that comes to mind.
I realise logging is a very mature field and that most things can be done in the popular libraries, but if there's still a feature you want but don't see very often I'd love to know.
r/cpp • u/[deleted] • May 01 '24
Proving Immediate Mode GUI's are Performant