uk
Feedback
C++ - Reddit

C++ - Reddit

Відкрити в Telegram

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

Показати більше
229
Підписники
Немає даних24 години
+17 днів
+230 день
Архів дописів
NDC Techtown conference: Call for papers (talks) The "Call for papers" of the NDC Techtown conference in Kongsberg, Norway is now open for talk submissions. This conference is focused on embedded and systems programming. You will find the talks of the previous years on YouTube. The conference covers travel and accomodation for non-local speakers. Have a look at the link below. If you can give a great talk on an interesting C++ topic then we would love to hear from you. https://ndctechtown.com/call-for-papers https://redd.it/1ijb25b @r_cpp

Opinions on Cpp Primer Simply put, what do you all think about C++ Primer (5e; book)? Moreover, what do you all think about learning C++ through books (with in-book exercises ofc)? https://redd.it/1ij9rlw @r_cpp

Should i use modules instead of headers when using C++ 20? Recently migrated a fairly big project from C++17 to C++20. Should i redo the structure and migrate to modules, or does it barely matter and isn't worth the hustle? https://redd.it/1ij93co @r_cpp

I need help finding the only solution to win at tic tac toc, this is the code for the game https://dogbolt.org/?id=607b40fa-251f-4618-884c-f383e268c885#Ghidra=5271&Hex-Rays=847&angr=4509 https://redd.it/1ij7dwh @r_cpp

Responsive Ncurses application in c++ https://youtu.be/o6yvWePJPww https://redd.it/1ij4top @r_cpp

Experimenting With colors in Ncurses using c++. Experimenting with colors in ncurses In this devlog I made a chess board and experimented with teminal colors, and also ensured that the screen renponds to terminal resize. https://redd.it/1ij3xdp @r_cpp

Working on C++ compiler Hello, I'm a software engineering student and will embark on my masters thesis now. I am writing about C++ and safety-related changes to it, where my main focus will be some implementation of sorts (combination of some static analysis and language changes). I really want to work with an existing compiler, but being a solo-developer, I am unsure if that is the best move. I am spending this and the next week deciding whether I should work with an existing compiler, or build a compiler/interpreter myself to work with (most likely working on a subset of the language). Do any of you have a suggestion to what? I'm currently looking for a "guide" on how to get starting developing/contributing to clang, but I find it hard to find any resources, and generally process the source code. Do anyone know of some resources I could use? I'm not locked on clang, if there exist another C++ compiler that may be easier to work with, I'm all ears? So, my questions boil down to: Should I develop on existing compiler, or make my own? If yes, what compiler, and what resources do I have available? If these questions have already been answered somewhere, I apologize. I tried looking and could not find any. https://redd.it/1ij2981 @r_cpp

Missing parameter while compilation in vscode Hello, as you read from the title i have a small problem in my vscode workspace, something i have no idea how to fix at this point. This is the file tasks.json { "tasks": { "type": "cppbuild", "label": "C/C++: g++ build active file", "command": "/usr/bin/clang++", "args": [ "-I/opt/homebrew/opt/ncurses/include", "-L/opt/homebrew/opt/ncurses/lib", "-lncurses", "${file}", "-o", "${fileDirname}/${fileBasenameNoExtension}" , "options": { "cwd": "${fileDirname}" }, "problemMatcher": "$gcc" , "group": { "kind": "build", "isDefault": true }, "detail": "Task generated by Debugger." } ], "version": "2.0.0" } However, the argument -lncurses is not passed in the command line: user@user % [path of file] g++ [file.cpp] -o [file] && [executable] all i miss is that parameter between g++ and the active file name https://redd.it/1ij0qo2 @r_cpp

What is John Carmack's subset of C++? In his interview on Lex Fridman's channel, John Carmack said that he thinks that C++ with a flavor of C is the best language. I'm pretty sure I remember him saying once that he does not like references. But other than that, I could not find more info. Which features of C++ does he use, and which does he avoid? https://redd.it/1iirax1 @r_cpp

Cmake design Hello! Iam new to cmake and I am confused implementing something. Now, i have a project that has multiple targets. What is the best way to do this in cmake - it is a big project. Also some targets may share the same “object” file but different “header” file. How could i handle that too. I can think of ways but what would be the practical/best way to achieve this? Iam trying to have at a minimum a cmakelists.txt in each directory. https://redd.it/1iiqgms @r_cpp

Searching for cpp conference video Sometime in the past year or two I remember watching a video about functional programming in c++. The speaker was a guy from Nvidia I think. In his talk and slides he solved the same toy problem multiple times and each time used more and more compositional/functional approach. The slides were "dark mode" friendly iirc. Did this ring any bells for anyone? https://redd.it/1iinv0h @r_cpp

Starting with C++ Hi everyone, I'm in the Optimization/Linear Programming area, and I'm just starting with C++ (I know a few things), but I'm not sure if I'm at a basic or beginner level. I'll be starting to work on maintenance and development of solutions using C++. I'm quite lost on what to focus on and how to train. Do you have any suggestions? I have ADHD and am looking for active ways to study so I don't lose focus. I've already studied programming logic, variables, function creation, loops, and decision structures. I know a bit about pointers and memory allocation (I can use them, but I don't fully master them yet) They gave me the chance to take the position, but they probably won't give me much time, so I need to focus as much as possible on the essentials. I also want to follow best practices so I don't harm anyone! https://redd.it/1iil9y8 @r_cpp

Need some learning Resources I've knowledge of python (basic OOP), C and Javascript. For a project I need to shift to C++. Most of the resources are for beginners like explaining what variables is, how to assign value, what's a loop etc. But as I know programming (may be intermediate), I don't need to learn from scratch. So, I am looking for resources that can help me. Thanks in advance. https://redd.it/1iii89c @r_cpp

Compiler Optimization of is_palindrome with std::views I always wonder if all the nice abstractions we get make performance suffer so I was pleasantly surprised that both clang and gcc produce practically identical asm in optimized build for the following code. bool is_palindrome(const std::string& str) { const auto len = str.size()/2; return sr::equal( str | sv::take(len), sv::reverse(str)| sv::take(len)); } bool is_palindrome_old(const std::string& str) { const auto len = str.size()/2; return std::equal( str.begin(), str.begin()+len, str.rbegin(), str.rbegin()+len); } bool is_palindrome_older(const std::string& str) { const auto len = str.size()/2; return std::equal( str.begin(), str.begin()+len, str.rbegin()); } [https://godbolt.org/z/jorWGbMWx](https://godbolt.org/z/jorWGbMWx) Three legged std::equal has a bit different codegen, but nothing major :) disclaimer: I did not benchmark this, so it is possible those tiny asm differences matter. 🙂 What I find interesting that generated asm shows clang figured out that for strings shorter than 2 answer is always true. If this is beneficial depends on the distribution of input values, but still interesting to see that when you just look at the source code. mov rcx,QWORD PTR [rdi+0x8] // load string size mov al,0x1 // set return to true cmp rcx,0x2 // compare size with 2 jb 117a <is_palindrome(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)+0x4a> // maybe return https://redd.it/1iierin @r_cpp

importizer 1.0.1 released After getting some feedback, I realized I miss a lot of stuff that was supposed to be in 1.0.0 such as integer literals, raw strings that went unhandled. I feel kinda bad for not testing it thoroughly, but 1.0.1 fixed most of it and should allow for a whole lot smoother experience (thanks glaze json that help me find these bugs). Here is the full changelog: https://github.com/msqr1/importizer/blob/main/ChangeLog.md#101 Thank you for the kind support! https://redd.it/1ii48sy @r_cpp

coawait inside Lambda's Let's say I got some RunTask typed coroutine, and inside a body of that coroutine I can easily do things like: coawait awreqstart(0, 4); coawait awrdywait(); coawait awreqend(); Now, let's say I want to (in order to reduce typing) abstract the above and place it inside lambda, like this: auto performawtransaction = & -> TestImpl2::RunTask { coawait awreqstart(id, len); coawait awrdywait(); coawait awreqend(); }; And then, inside same coroutine I want to call the above abstracted lambda as: coawait performawtransaction(0, 4); So, as of now, the above is not allowed: "Cannot resolve the call to member 'await\_ready' of RunTask: no viable function found" The real issue is that when I try to wrap this inside a lambda, it no longer works. But RunTask is already awaitable! It works fine when I co_await explicitly, so why does the compiler complain when I wrap it in a lambda? Any ideas for workarounds that don't break coroutine execution? So, can this somehow now with modern cpp (c++23?) be achieved? or could maybe there be new update to language allowing co_await inside Lambdas? https://redd.it/1ii3ixm @r_cpp

Quite concerned about C++ It's been sometime now all over the world is getting into AI I am a developer have around 3.5 years of experience in automotive domain.I have some knowledge on cpp not much opportunities to work in challenging task it made me relearn all oops concepts again. Now I am thinking the work what I have done is not quite worthy for my experience and now I am looking for a job switch should I have to learn other tech stack like AI or Just with C++ again I am currently learning DSA and cpp concepts and solving dsa problems in leetcode.Any suggestions would be highly appreciated. https://redd.it/1ihwe20 @r_cpp