How do they use C++ in HFT(High Frequency Trade ) industry?
I know certain company like Optiver use C++/Rust to create real-time/low-latency trading platform, and what do they exactly mean?
https://redd.it/1d8ukso
@r_cpp
GWPSan: Sampling-Based Sanitizer Framework
https://github.com/google/gwpsan
https://redd.it/1d8vw7k
@r_cpp
The limits of [[maybe_unused]]
https://www.sandordargo.com/blog/2024/06/05/the-limits-of-maybe-unused
https://redd.it/1d8ruzr
@r_cpp
How To Develop A Simple Hopfield Network In C++
https://learncplusplus.org/how-to-develop-a-simple-hopfield-network-in-c/
https://redd.it/1d8lrxd
@r_cpp
A video about forwarding references
https://youtu.be/RW9KnqszYj4
https://redd.it/1d8jazt
@r_cpp
CPP/C equivalent of requirements.txt
Hi,
I'm currently trying to configure GitHub Dependabot for a C/Cpp project. I'm having the issue of specifying the dependencies. I've previously done this for a python project using the requirements.txt file but I haven't found anything similar for C, any suggestion
https://redd.it/1d88pt4
@r_cpp
Latest News From Upcoming C++ Conferences (06/04/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/
New News
Very Early Bird Tickets have now closed for CppIndiaConf 2024. Early Bird tickets can be purchased here [https://konfhub.com/cppindiacon2024](https://konfhub.com/cppindiacon2024)
The call for speakers for Audio Developer Conference (ADC) is now open and is open until the 28th June. Find out more at https://audio.dev/conference/ and submit your talk at https://submit.audio.dev/
ACCU should be releasing videos to the YouTube Channel this week. Subscribe to the YouTube Channel to receive notifications as each video is released. [ACCUConf" rel="nofollow">https://www.youtube.com/@ACCUConf](https://www.youtube.com/@ACCUConf)
C++Now have opened their early access to the C++Now 2024 videos. More information about early access can be found here 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.
https://redd.it/1d80nr8
@r_cpp
Internal Compiler Error with MSVC
this should result in an error saying that it cannot convert from `initializer_list` to `const int&` but it throws an internal compiler error
#include <functional>
#include <type_traits>
// this shouldn't be called in runtime contexts
void is_implicitly_constructible_function(const int&);
int main() {
int a;
static_assert(std::is_void<decltype(is_implicitly_constructible_function({std::reference_wrapper<const int>{a}}))>::value,"!");
}
fatal error C1001: Internal compiler error.
(compiler file 'D:\a_work\1\s\src\vctools\Compiler\CxxFE\sl\p1\c\convert.cpp', line 11356)
To work around this problem, try simplifying or changing the program near the locations listed above.
If possible please provide a repro here: https://developercommunity.visualstudio.com
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information
interestingly if we change from `const int` to `int` it will correctly error out saying it cannot convert
#include <functional>
#include <type_traits>
// this shouldn't be called in runtime contexts
void is_implicitly_constructible_function(int&);
int main() {
int a;
static_assert(std::is_void<decltype(is_implicitly_constructible_function({std::reference_wrapper<int>{a}}))>::value,"!");
}
https://redd.it/1d7trt2
@r_cpp
More on harmful overuse of std::move - The Old New Thing
https://devblogs.microsoft.com/oldnewthing/20240603-00/?p=109842
https://redd.it/1d7qakm
@r_cpp
ML through C++
I want to learn Machine Learning through C++.How to proceed about? Suggest some books/ resources.
https://redd.it/1d7l4t5
@r_cpp
Natvis for boost::unordered_map
https://blog.ganets.ky/NatvisForUnordered/
https://redd.it/1d7a3e6
@r_cpp
Reddit C++ channel traffic has significantly slowed down recently
Why?
https://redd.it/1d75zwp
@r_cpp
C++ Show and Tell - June 2024
Use this thread to share anything you've written in C++. This includes:
* a tool you've written
* a game you've been working on
* your first non-trivial C++ program
The rules of this thread are very straight forward:
* The project must involve C++ in some way.
* It must be something you (alone or with others) have done.
* Please share a link, if applicable.
* Please post images, if applicable.
If you're working on a C++ library, you can also share new releases or major updates in a dedicated post as before. The line we're drawing is between "written in C++" and "useful for C++ programmers specifically". If you're writing a C++ library or tool for C++ developers, that's something C++ programmers can use and is on-topic for a main submission. It's different if you're just using C++ to implement a generic program that isn't specifically about C++: you're free to share it here, but it wouldn't quite fit as a standalone post.
Last month's thread: https://www.reddit.com/r/cpp/comments/1cilqq4/c_show_and_tell_may_2024/
https://redd.it/1d6zoku
@r_cpp
New compilers, new timings
https://peter.eisentraut.org/blog/2024/05/21/new-compilers-new-timings
https://redd.it/1d6xkf3
@r_cpp
I Tried Out Modules With MSVC and I Don't Think They Are Ready Yet
https://alexwritesablog.com/posts/modules-arent-the-move-yet/
https://redd.it/1d6nal2
@r_cpp
Crypto: Clang optimisation introduce branches to branchless code
https://pqshield.com/pqshield-plugs-timing-leaks-in-kyber-ml-kem-to-improve-pqc-implementation-maturity/
https://redd.it/1d8ybbb
@r_cpp
LDB: An Efficient Latency Profiling Tool for Multithreaded Applications
https://www.usenix.org/conference/nsdi24/presentation/cho
https://redd.it/1d8u6j9
@r_cpp
can i connect one header to multiple cpp files?
upd: now I understood that my code just was wrong
https://redd.it/1d8nt3g
@r_cpp
Speaking about C++ is tomorrow!
https://www.meetup.com/meeting-cpp-online/events/300734310/
https://redd.it/1d8l7p3
@r_cpp
CMake configs for Python modules (Pytest, Sphinx, ...)
As Python is one of the most popular languages, many C++ projects end up using Python bindings of some sort. Pytest and Sphinx are very popular frameworks, so many modules have been written, and most projects end up including a copy of these modules or using some hardcoded paths.
I wrote two Python packages to manage the installation and update of CMake configs for Pytest and Sphinx.
[https://github.com/python-cmake/pytest-cmake](https://github.com/python-cmake/pytest-cmake)
https://github.com/python-cmake/sphinx-cmake
It uses the pip
package management, providing a module for each package and automatically generating a configuration based on the package version found.
> pip install pytest-cmake
> pip install sphinx-cmake
I hope this method can standardize module integration for common Python tools. Let me know what you think!
https://redd.it/1d8dazq
@r_cpp
C++ , Recursion
Why is it necessary to pass array as a pointer in recursive question ?
https://redd.it/1d83m4v
@r_cpp
Blend2D 0.11.1
Blend2D 0.11.1 has been released and regardless of the conservative version number the project is progressing and offering more features & optimizations than before.
Blend2D started in 2015 as an experiment to use a JIT compiler for generating 2D pipelines. It was written for fun with no intention of releasing it. However, because of the excellent results it was indeed released in 2019 under Zlib license and tagged as Beta. The initial version only targeted X86 hardware in its JIT compiler, which was a serious limitation.
Blend2D's development never stopped and during the years it got new features such as multi-threaded rendering, AVX2 & AVX-512 optimizations, dithered gradients, and even cherries such as SIMD-optimized TrueType font outlines decoding. However, the most important feature, which is AArch64 support, is now part of 0.11.1 release. It means out of box support for AArch64 based SoCs and Apple Silicon.
Interestingly, the rendering performance is really great on Apple Silicon and in many cases it's even better against competing libraries than on X86 hardware. Results from running a Blend2D benchmarking tool on Apple M3 Pro hardware are available on the Performance page (https://blend2d.com/performance.html) together with AMD Ryzen 9 7950X dataset for comparison. Users can also run their own tests and visualize their results on the Performance page via a "Custom Dataset" functionality. The benchmarking tool now outputs JSON after all tests finish.
Blend2D homepage: https://blend2d.com
Blend2D fiddle: https://fiddle.blend2d.com
https://redd.it/1d7x3lq
@r_cpp
Resources to learning C++ FAST
Hi everyone,
I'm transferring to UCSC in the Fall and have admittedly fallen off on my coding skills as I had to take a 2-year hiatus. Truthfully I don't remember much...I'm trying to learn C++, Java, and Python quickly over the summer to get back up to speed for my Junior year as a Computer Engineering student. I've begun scouring the internet and the resources are dense and a tad overwhelming, and chatgpt is recommending 700+ page textbooks which I fear will take too long.
Thank you so much to anyone who has resources that can help.
https://redd.it/1d7qrr1
@r_cpp
Input stream causes program to crash
So I’m using this library to communicate via TCP with a device which stores the response from the device in an input stream. When I read the message character by character I get the expected response however it looks like the program doesn’t know where the message ends. When I extract all the characters and try to extract another it will cause the program to become unresponsive.
So let’s say my input stream is denoted by is and my expected response is “Hi”. If I do is>>c;, is>>c; I will extract both H and I but when I call is>>c; again I get the issue. You might say “you need to check if any flags are raised” but .eof() or any of the other checkers don’t indicate anything.
I’ve heard that istreams have their end flag raised by a terminating character, usually \n. So is there a way I can just tack this on to the end of the input stream after reading the response from the device? Thanks for any help
https://redd.it/1d7ky8z
@r_cpp
Yay! I just got my first real job as software engineer after a two-hours interview. Really excited about this!
https://redd.it/1d7fts1
@r_cpp
New C++ Conference Videos Released This Month - June 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
05/27/2024 - 06/02/2024
Designing for C++ Concurrency Using Message Passing - Anthony Williams - [https://youtu.be/D1oBq4PIEW8](https://youtu.be/D1oBq4PIEW8)
Beginners' Guide to C++20 Coroutines - Andreas Fertig - https://youtu.be/4xdef0fRsQ0
Keynote: Can AI Replace Programmers? - Frances Buontempo - [https://youtu.be/jX\_NoK-xdrk](https://youtu.be/jX_NoK-xdrk)
Audio Developer Conference
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
https://redd.it/1d77pk2
@r_cpp
Trying vs code but something is not working
I have a main.cpp file a header file and a header.cpp file but for some reason I can not define the default contractor or public member functions(PMF). I am using #include "header.h" but it is not recognizing the PMF so I can't actually code them, is there something im missing like maybe an extension or maybe a proper make file?
https://redd.it/1d732y7
@r_cpp
Visual Studio Code and std modules
Hi all,
I have the lates version of Visual Studio Code with CppExtension installed. I have "Microsoft (R) C/C++ Optimizing Compiler Version 19.40.33811 for x64"
I'm trying to test the hello world program with import and module. I know how to build from tasks.json but I don't know how to solve intellisense issues
1: import std;
2:
3: int main() {
4: std::println("Hello World");
5: }
In this code, the lines 1 and 4 are marked as errors and the message is "could not find module 'std'"
Any idea how to configure it?
https://redd.it/1d6ynyk
@r_cpp
C++ to Java
I need to convert C++code to Java language, but I think it will take a long time to convert manually. I'm pretty sure there good options to automate this task with code converters that can help me speed up my tasks. I'be grateful for recommendations
https://redd.it/1d6od7s
@r_cpp
Developing a Memory Safe Subset of C++
While it is evident that C++ lacks crucial memory safety features, addressing this issue within the existing structure of C++ is challenging. A viable solution could be to create a subset of C++ dedicated to memory safety and security.
When trying to implement a borrow checker in C++ we need to address the challenges posed by features like raw pointers, destructors, and operator overloading, which conflict with a borrow checker's strict ownership and borrowing rules. However features such as smart pointers, RAII, const correctness, move semantics, scoped locks, and mutexes align well with the principles of a borrow checker.
Why not extract the compatible elements of C++ and integrate them with a borrow checker to develop a new subset of C++ dedicated to memory safety? This subset could be designed to be interoperable with the existing presumably unsafe C++ programs through bridge code. While it wouldn't immediately address legacy code memory safety issue, over time, more developers could transition to this memory safe version of C++.
Undoubtedly, it would be a massive endeavor, but wouldn't this approach represent the optimal solution for ensuring the future of memory safety in C++?
https://redd.it/1d6l0ab
@r_cpp