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

Which one are you?



View Poll

https://redd.it/18q3wbm
@r_cpp

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

C++ - Reddit

Getting Started with Projects

I've gained a good bit of knowledge to start making beginner projects but I always had this thing I worried about. I currently don't know how to make these projects I want to make, I know you need to learn things but I worry that me learning to make it and making it isn't me making the project but instead copying. It feels like imposter syndrome, when I show my project to others I feel as if I didn't truly make it myself. How do I learn to make projects and make them without following step-by-step instructions like a "How to make a tic tac toe game" tutorial?

​

Apologies if this was a scattered post I don't know how better to truly explain this.

https://redd.it/18ph5kc
@r_cpp

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

C++ - Reddit

How do you pronounce "cout"?



View Poll

https://redd.it/18pr4wn
@r_cpp

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

C++ - Reddit

,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>>>>,std::less<std::string>,std::allocator<std::pair<std::string const ,std::map<autopilot::DynamicCompute::QuotaBoundSkuDimensions,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>,std::less<autopilot::DynamicCompute::QuotaBoundSkuDimensions>,std::allocator<std::pair<autopilot::DynamicCompute::QuotaBoundSkuDimensions const ,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>>>>>>,0>>::~_Tree<std::_Tmap_traits<std::string,std::map<autopilot::DynamicCompute::QuotaBoundSkuDimensions,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>,std::less<autopilot::DynamicCompute::QuotaBoundSkuDimensions>,std::allocator<std::pair<autopilot::DynamicCompute::QuotaBoundSkuDimensions const ,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>>>>,std::less<std::string>,std::allocator<std::pair<std::string const ,std::map<autopilot::DynamicCompute::QuotaBoundSkuDimensions,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>,std::less<autopilot::DynamicCompute::QuotaBoundSkuDimensions>,std::allocator<std::pair<autopilot::DynamicCompute::QuotaBoundSkuDimensions const ,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>>>>>>,0>>() Line 1085 C++`

`> AllocationAgentUnitTest.exe!std::map<std::string,std::map<autopilot::DynamicCompute::QuotaBoundSkuDimensions,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>,std::less<autopilot::DynamicCompute::QuotaBoundSkuDimensions>,std::allocator<std::pair<autopilot::DynamicCompute::QuotaBoundSkuDimensions const ,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>>>>,std::less<std::string>,std::allocator<std::pair<std::string const ,std::map<autopilot::DynamicCompute::QuotaBoundSkuDimensions,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>,std::less<autopilot::DynamicCompute::QuotaBoundSkuDimensions>,std::allocator<std::pair<autopilot::DynamicCompute::QuotaBoundSkuDimensions const ,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>>>>>>>::~map<std::string,std::map<autopilot::DynamicCompute::QuotaBoundSkuDimensions,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>,std::less<autopilot::DynamicCompute::QuotaBoundSkuDimensions>,std::allocator<std::pair<autopilot::DynamicCompute::QuotaBoundSkuDimensions const ,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>>>>,std::less<std::string>,std::allocator<std::pair<std::string const ,std::map<autopilot::DynamicCompute::QuotaBoundSkuDimensions,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>,std::less<autopilot::DynamicCompute::QuotaBoundSkuDimensions>,std::allocator<std::pair<autopilot::DynamicCompute::QuotaBoundSkuDimensions const ,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>>>>>>>() C++`

`AllocationAgentUnitTest.exe!QuotaChecker::~QuotaChecker() C++`

&#x200B;

https://redd.it/18pqa1v
@r_cpp

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

C++ - Reddit

What editor do you use for c++?

Honorable mentions( i guess...):
Eclipse
Code Lite
NetBeans
Dev C++
Xcode
C++ Builder
Kite
Sublime
Helix


View Poll

https://redd.it/18j806w
@r_cpp

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

C++ - Reddit

Printing non English letters

\#include <iostream>
using namespace std;
int main(){
cout<<"Ugnė";
return 0;
}
This is my code, it works, but it wont print the letter ė because it's not part of the English alphabet, is there any way to make it print the letter?


https://redd.it/18j3skf
@r_cpp

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

C++ - Reddit

Searching participants for a study about coding efficiency

Hi! I am currently working on a study for my school, which tries to determine how the quality of code effects programmers, and would need some interested peeps 🙂 The study shouldn't take too long to complete, approximately 10-25min, and is written in C++. You'd be tasked to solve a number of problems in a codebase, and after that report on your experience.
I'm thankful for anyone who wants to participate!
Here's the link: https://maroltingergasse-my.sharepoint.com/:f:/g/personal/reinthaler_laurenz_maroltingergasse_at/EtQzOagwxbZNri0K3gTmuN8BT2TldKOSflbHg75VfMCZUA?e=0cW9u5

https://redd.it/18iz843
@r_cpp

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

C++ - Reddit

Will cpp template programming enlarge the code size



https://redd.it/18iszi4
@r_cpp

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

C++ - Reddit

What would you expect from a hypothetical greenfield compiler?

(Compiler and stdlib)

What would you expect to see?

What advantages do you think such a project would have?

Would it even be worthwhile now, given how good existing compilers are, and how complex C++ is?

&nbsp;

This post just exists to generate interesting discussion.

https://redd.it/18ir6mz
@r_cpp

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

C++ - Reddit

Blitzar: asynchronous multi-GPU computation of cryptographic proof primitives

https://github.com/spaceandtimelabs/blitzar

Blitzar provides algorithms for computing cryptographic proof primitives and a modern C++20 coroutine framework for managing asynchronous CUDA computations modeled after the future-promises design used in seastar.io.

Specifically, it focuses on providing an implementation of an inner product argument (e.g. Bulletproofs) ([1\]). The inner product argument can be used as a polynomial commitment scheme and a building block for higher level proofs. For background and details on how it relates to other polynomial commitment schemes, see section 16.3 of [2\].

The library can be used either directly as a C++ project or from Rust with a prebuilt binary:
https://github.com/spaceandtimelabs/blitzar-rs.

It's still fairly early in development and I'm sure that are lots of areas that can be improved; but we decided to make it available as an open-source project to see if there's any broader interest.

References

[1\]: Bunz B., Bootle J., Boneh D., Poelstra A., Wuille P., Maxwell G. "Bulletproofs: Short Proofs for Confidential Transactions and More". Stanford, UCL, Blockstream, 2017
https://eprint.iacr.org/2017/1066.pdf

[2\]: Thaler J. "Proofs, Arguments, and Zero-Knowledge" , 2022 https://people.cs.georgetown.edu/jthaler/ProofsArgsAndZK.html




&#x200B;

https://redd.it/18ig0if
@r_cpp

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

C++ - Reddit

How your perfect IDE would look like ?

crossposting:
https://www.reddit.com/r/cprogramming/comments/18i7g94/how_your_perfect_ide_would_look_like/


https://redd.it/18i8ush
@r_cpp

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

C++ - Reddit

ACCU Overload Journal 178 - December 2023
https://accu.org/journals/overload/overload178

https://redd.it/18i2y00
@r_cpp

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

C++ - Reddit

I finally learned the arrow operator

I did it! It also helped me learn the malloc() and free() function for pointers! Today was an amazing day!

https://redd.it/18hzrqy
@r_cpp

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

C++ - Reddit

Email Sending Library called Koenig-Email

I've been working on a very simple library for sending emails in C++. I find most email C/C++ libraries are not that straightforward to use, so my goal is for this library to be as simple and easy to use as possible. I've been using it for an https server which sends email to users of a personal website.

I'd be happy for feedback or if anyone wants to contribute to it.

Koenig-Email

https://redd.it/18hzsh8
@r_cpp

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

C++ - Reddit

Runtime/ Or Compile Time Extraction of Struct Fields!

Hi Everyone,

I'm working on a specific application with a ton of constraints.

My hope is to basically take 'structures' of messages and be able to understand each field name and order (so when the application writes a CSV later... it knows how to).

&#x200B;

I should say.. struct field names..

I'm trying to figure out how to do that though and if its even possible.

Would like to try and avoid 3rd party libraries if I can. It can be at compile or build time. Preprocessor Macros are fine too. I just used some to solve another problem actually.

&#x200B;

Any ideas?

&#x200B;

https://redd.it/18htkti
@r_cpp

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

C++ - Reddit

std::print in C++23
https://vitaut.net/posts/2023/print-in-cpp23/

https://redd.it/18q0lh3
@r_cpp

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

C++ - Reddit

Memory Safety is a Red Herring
https://steveklabnik.com/writing/memory-safety-is-a-red-herring

https://redd.it/18pm6so
@r_cpp

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

C++ - Reddit

Unintuitive benchmark results between SoA, AoS and AoS

I was playing a bit with quick bench as I wanted to have an idea about the difference a structure size can make, as well as the cost of constantly jumping everywhere in memory.
So I wrote this, and I must admit I'm a bit surprised by the results...

Clang 17 version:
https://quick-bench.com/q/zVkoTrFVwkPDTVNTfCm5J4dLxlQ, how can the absence of difference between the RigidBody and RigidBody\ vector examples be explained ?

GCC 13.2 version: https://quick-bench.com/q/ekBHBpHcemsVEAaaxg-gXp3ewA4, this one I'm totally confused... How can the array of vec be that much slower than everything else ? Anything wrong with the code ? 🤔

https://redd.it/18pre0f
@r_cpp

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

C++ - Reddit

Weird error in destructor

I am getting error in destructor with below stacktrace. any clue what could be happening? I know it is something related to new map which I added, and it is not able to erase.

&#x200B;

`AllocationAgentUnitTest.exe!std::_Tree_val<std::_Tree_simple_types<std::pair<std::string const ,std::map<autopilot::DynamicCompute::QuotaBoundSkuDimensions,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>,std::less<autopilot::DynamicCompute::QuotaBoundSkuDimensions>,std::allocator<std::pair<autopilot::DynamicCompute::QuotaBoundSkuDimensions const ,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>>>>>>>::_Erase_tree<std::allocator<std::_Tree_node<std::pair<std::string const ,std::map<autopilot::DynamicCompute::QuotaBoundSkuDimensions,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>,std::less<autopilot::DynamicCompute::QuotaBoundSkuDimensions>,std::allocator<std::pair<autopilot::DynamicCompute::QuotaBoundSkuDimensions const ,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>>>>>,void *>>>(std::allocator<std::_Tree_node<std::pair<std::string const ,std::map<autopilot::DynamicCompute::QuotaBoundSkuDimensions,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>,std::less<autopilot::DynamicCompute::QuotaBoundSkuDimensions>,std::allocator<std::pair<autopilot::DynamicCompute::QuotaBoundSkuDimensions const ,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>>>>>,void *>> & _Al, std::_Tree_node<std::pair<std::string const ,std::map<autopilot::DynamicCompute::QuotaBoundSkuDimensions,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>,std::less<autopilot::DynamicCompute::QuotaBoundSkuDimensions>,std::allocator<std::pair<autopilot::DynamicCompute::QuotaBoundSkuDimensions const ,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>>>>>,void *> * _Rootnode) Line 743 C++`

`AllocationAgentUnitTest.exe!std::_Tree_val<std::_Tree_simple_types<std::pair<std::string const ,std::map<autopilot::DynamicCompute::QuotaBoundSkuDimensions,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>,std::less<autopilot::DynamicCompute::QuotaBoundSkuDimensions>,std::allocator<std::pair<autopilot::DynamicCompute::QuotaBoundSkuDimensions const ,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>>>>>>>::_Erase_head<std::allocator<std::_Tree_node<std::pair<std::string const ,std::map<autopilot::DynamicCompute::QuotaBoundSkuDimensions,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>,std::less<autopilot::DynamicCompute::QuotaBoundSkuDimensions>,std::allocator<std::pair<autopilot::DynamicCompute::QuotaBoundSkuDimensions const ,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>>>>>,void *>>>(std::allocator<std::_Tree_node<std::pair<std::string const ,std::map<autopilot::DynamicCompute::QuotaBoundSkuDimensions,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>,std::less<autopilot::DynamicCompute::QuotaBoundSkuDimensions>,std::allocator<std::pair<autopilot::DynamicCompute::QuotaBoundSkuDimensions const ,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>>>>>,void *>> & _Al) Line 753 C++`

`AllocationAgentUnitTest.exe!std::_Tree<std::_Tmap_traits<std::string,std::map<autopilot::DynamicCompute::QuotaBoundSkuDimensions,std::map<std::string,int,std::less<std::string>,std::allocator<std::pair<std::string const ,int>>>,std::less<autopilot::DynamicCompute::QuotaBoundSkuDimensions>,std::allocator<std::pair<autopilot::DynamicCompute::QuotaBoundSkuDimensions const

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

C++ - Reddit

CppCast: SIMD
https://cppcast.com/simd/

https://redd.it/18j54ug
@r_cpp

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

C++ - Reddit

A curiously recurring lifetime issue
https://blog.dureuill.net/articles/recurring-lifetime/

https://redd.it/18j1bb3
@r_cpp

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

C++ - Reddit

Conan2 running very slow

I recently upgraded from Conan 1.x to 2.0.14. When I run my conan install, it seems to take a long time to download packages, specifically boost/1.83.0. It's downloading about 0.3MB every 30 seconds. I don't know if this is just a slow server or if something is wrong on my side.

https://redd.it/18iwri2
@r_cpp

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

C++ - Reddit

Need for a framework/library to develop asynchronous web services layer, any experienced advices welcome

I’m trying to building a proxy service layer,

1. Gets requests from clients in standart json format
2. Modify request for requested transaction,
3. Route modified request to provider
4. Return back to providers response to client
5. Log all proxy routing

Layer will be stateless and high scalable

Am I prefer go or rust language or can you advice me framework/libraries (boost etc..) that you used before.

Thank u

https://redd.it/18islxz
@r_cpp

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

C++ - Reddit

Would it be possible to create a perfectly constant time data structure like this?

I'm an sdev student in my last year of college. I've dealt primarily with Java when. working on back-end/more complex problems, but I've always been intrigued by the idea of having more control over memory.

The way I understand arrays, you have one reference for the start of the array, and then the other memory addresses are just the first index's address plus the amount of memory the datatype takes up the number of the desired index. For example, if a short array has a memory address of 0010, the second index will be at 0018, the third at 0026, etc. So myArr[0] goes to 0010+80, myArr1 goes to 0010+81, myArr[2] goes to 0010+82

I'm wondering if it's possible to have one pointer that points directly to several memory addresses, so that myArr0 goes to 0010, myArr1 goes to 0018, and myArr2 goes to 0026 with no math in-between. The reason I'm asking is because I'd also want to overload the square bracket operator in a custom data structure to be able to search for an element's index using a hash code and get a result back in constant time. Theoretically, if what I'm asking is possible, adding, searching, and removing would all be possible in constant time if you're willing to sacrifice all memory efficiency.

https://redd.it/18ip1gn
@r_cpp

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

C++ - Reddit

Do you need to know all the different ways of getting undefined behaviour?

Do you have to keep it all in your head when writing production code or do you just rely on sanitizers, static analyzers and fuzzers to ensure your code is free from undefined behaviour?

https://redd.it/18ifp0i
@r_cpp

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

C++ - Reddit

Release of TeaScript 0.11.0

Hi everyone,

recently I made a new Release of the TeaScript C++ Library.

TeaScript is a modern C++ Library and acts as a possible embedded scripting solution for C++ applications.

The new version 0.11.0 comes with integrated TOML Support, Subscript Operator, Raw String Literals and more.

Read more in the news article:
https://tea-age.solutions/2023/12/11/release-of-teascript-0-11-0/


The source code is also on GitHub:
https://github.com/Florian-Thake/TeaScript-Cpp-Library


The capabilities of the modern C++ API are illustrated the best in the teascript_demo.cpp
( teascript\_demo.cpp )

What do you think about it?
I would also like to know if you have feature wishes for either the C++ API or the TeaScript language itself.

Any feedback is highly welcome.

PS: For those of you who are knowing ChaiScript (which is more or less not maintained anymore), TeaScript might be a possible alternative.


https://redd.it/18i8csi
@r_cpp

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

C++ - Reddit

What's your go-to unit testing tool?

I am a prospective developer who just started using NUnit to create unit tests. I am interested to know whether anyone favors alternative testing tools to NUnit. If so, why is that?

https://redd.it/18i34sv
@r_cpp

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

C++ - Reddit

Any good tutorial on C++/CLI?

I want to make a desktop todo app using C++/CLI and want to know how to fully debug, optimizing performance, identifying memory leaks, etc.

https://redd.it/18hyse4
@r_cpp

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

C++ - Reddit

Boost Version 1.84.0
https://www.boost.org/users/history/version_1_84_0.html

https://redd.it/18hycda
@r_cpp

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

C++ - Reddit

Exam cheatsheet

Hey fellow coders, I've got an cpp exam tomorrow and the professor has allowed us to bring a 2 sided cpp cheatsheet for references. Have any of you got a great Csheet that i can use tmw?

https://redd.it/18hqcyt
@r_cpp

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