uz
Feedback
C++ - Reddit

C++ - Reddit

Kanalga Telegram’da o‘tish

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

Ko'proq ko'rsatish
228
Obunachilar
Ma'lumot yo'q24 soatlar
Ma'lumot yo'q7 kunlar
Ma'lumot yo'q30 kunlar
Postlar arxiv
Is game development C++ and “office” C++ the same thing or is game development C++ just C++ with more stuff for making games https://redd.it/1ohage3 @r_cpp

C++ or Python for first year clg students?? Yo a first year CSE student here. which language should i learn first- python or C++?? I already know some C++ since i studied it for two years in 11th and 12th grade?? any suggestions pls?? https://redd.it/1oh7ymy @r_cpp

Tired of feeling lost in C++ syntax? I'm hosting a FREE 12-session, project-first bootcamp on Schoolhouse.world (12 Sessions, 36 Projects). Hey everyone! 👋 If you're a complete beginner who's been frustrated by dry lectures, endless syntax memorization, or getting nowhere with YouTube tutorials, this is for you. I'm running a highly interactive, hands-on series called "🔥 Conquer C++ Basics" through Schoolhouse.world. (100% FREE) Enroll NOW (start in 2 days): https://schoolhouse.world/series/66582?ref=share-button https://redd.it/1oh4hs4 @r_cpp

JarvisAgent — a C++ background service for AI tasks Project: JarvisAgent What it does: JarvisAgent is a C++ background service that automates AI workflows by monitoring a folder for prompt and task files, sending them to an AI model (like GPT) through REST, and saving the results. Tech stack: libcurl, spdlog, simdjson, BS thread pool, tracy Build system: Premake5 OS: Cross-platform (Linux, Windows, macOS) Goal: Enable file-based AI automation and serve as a backend for workflow or tool integrations. Would love feedback, feature ideas, or collaboration offers. If it sounds cool, please ⭐ the repo on GitHub — it helps visibility! 🔗 github.com/beaumanvienna/JarvisAgent https://redd.it/1oh2xyi @r_cpp

Cross-Platform & Cross-Compile C++ action workflow build Just sharing a practical GitHub Actions workflow for testing cross-platform and cross-compilation builds - something many (if not the most) C++ projects eventually need. 👉 View the full YAML workflow here It’s part of a small demo project that integrates another open-source project -- Areg SDK. A quick note about Areg SDK for context: it provides its own internal CMake variables (AREG_*) to detect and configure target platforms, and these can be combined with standard CMake toolchain files for flexible cross-builds. The YAML demonstrates both methods: Example 1: Using a Toolchain File for ARM32 Install the compiler first (!!!): - name: Install GNU 32-bit ARM compilers run: sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf binutils-arm-linux-gnueabihf Configure and build using a predefined toolchain file: - name: Configure (ARM32 toolchain) run: | cmake -B ./product/cache/gnu-linux-arm32 \ -DCMAKETOOLCHAINFILE=${{github.workspace}}/toolchains/gnu-linux-arm32.cmake \ -DAREGEXTENDED:BOOL=OFF - name: Build (ARM32) run: cmake --build ./product/cache/gnu-linux-arm32 -j20 In this example, the project is configured in `./product/cache/gnu-linux-arm32`. The build artifacts are generated in `./product/build/gnu-g++/linux-32-arm32-release-shared`, which follows Areg SDK’s *custom directory structure*. Your project may use a different layout. **Example 2:** Using Areg SDK *Custom CMake Variables* Same cross-build, but without a toolchain file: - name: Configure (GNU on ARM32, shared) run: cmake -B ./product/cache/gnu-arm-so \ -DAREGCOMPILERFAMILY=gnu \ -DAREGPROCESSOR=arm - name: Build (GNU on ARM32, shared) run: cmake --build ./product/cache/gnu-arm-so -j20 The workflow also includes additional configurations (x86, x86_64, ARM64). Sharing it as a ready-to-use reference for anyone building portable C++ projects that need to run across multiple architectures. P.S. If this isn’t the right sub, feel free to point me to a better one. https://redd.it/1ogm11y @r_cpp

How to Mock Any Dependency in C++ “Test Base Class Injection” is a technique that uses C++’s name resolution rules to replace a dependency at compile-time with your own test double/fake/mock. https://github.com/MiddleRaster/tbci It works on data-members, arguments, return types, C calls, etc. One use case is mocking a type that is an automatic variable in a static method or constructor, where subclass-and-override doesn’t work. https://redd.it/1ogl9ur @r_cpp

Tips to improve in cpp I was good in 23-24 , for some reason i felt like i am loosing my skills(less practice might be the reason or incompleted project) I want to build some projects but sometimes struggling using docs, of any experienced developers can guide me how to overcome this, reading docs and implementations…. i was building a socket client program and using docs i tried to build secure socket client but at the end including all headers some keywords show undefined and there is no resources , I ask to AI , AI implemented its own class . https://redd.it/1oge9yu @r_cpp

GSoC 2025: Usability Improvements for the Undefined Behavior Sanitizer https://blog.llvm.org/posts/2025-09-01-gsoc-ubsan-trap-messages/ https://redd.it/1ogcatn @r_cpp

When did you start learning C++? https://redd.it/1og113m @r_cpp

Hello pythoneers,Does a n y o n e k n o w h o w t o c o n e c t t o c o p i l o t t h r u a p i Who knows how to login to Microsoft API for copilot enterprise edition from my account so I can use my free unrestricted access to gpt5 so my prechewing app can process my shit work ? Sorry for s h i t text up top its because this reddit has some engine that check if its a question and doesn't let me post thank you. https://redd.it/1og0315 @r_cpp

compatible with bunsen 504101 Add a "vgstack" script 504177 FILE DESCRIPTORS banner shows when closing some inherited fds 504265 FreeBSD: missing syscall wrappers for fchroot and setcred 504341 Valgrind killed by LTP syscall testcase setrlimit05 504466 Double close causes SEGV 504904 Hide "bad act handler address" warnings when -q (quiet) flag is set 504909 Hide "Bad oldset address" warnings when -q (quiet) flag is set 504919 Hide "client tried to modify addresses" warnings when -q (quiet) set 504936 Add FreeBSD amd64 sysarch subcommands AMD64_SET_TLSBASE and AMD64_GET_TLSBASE 505228 Wrap linux specific mseal syscall 505673 Valgrind crashes with an internal error and SIGBUS when the guest tries to open its own file with O_WRONLY|O_CREAT|O_TRUNC 506076 unimplemented fcntl command: 1028 (F_CREATED_QUERY) 506499 Unhandled syscall 592 (exterrctl - FreeBSD 506795 Better report which clone flags are problematic 506806 Fix execveat() with AT_FDCWD and relative path 506813 The execveat wrapper needs to do more checking 506816 futex2, futex_waitv WARNING: unhandled amd64-linux syscall: 449 506910 openat2 with RESOLVE_NO_MAGICLINKS succeeds on /proc/self/exe 506928 Wrap (deprecated) linux specific ustat syscall 506929 Wrap (deprecated) linux sysfs syscall 506930 valgrind allows SIGKILL being reset to SIG_DFL 506967 Implement and override mallinfo2 506970 mmap needs an EBADF fd_allowed check 507033 Remove deprecated Iop_Clz32/64 and Iop_Ctz32/64 507173 s390x: Crash when constant folding is disabled 507188 memcheck with track-fds=yes on x86 with popen: Assertion 507720 Review syscalls returning file descriptors (other platforms) 507721 Wire up illumos and Solaris mallinfo 507853 faccessat and faccessat2 should handle AT_FDCWD and absolute paths 507866 fanotify_mark dirfd isn't checked 507867 perf_event_open group_fd isn't checked 507868 futimesat doesn't handle AT_FDCWD 507869 Various at syscalls don't check dirfd argument 507873 Make fchmodat and fchmodat2 syscall wrappers accept AT_FDCWD 507897 Allow for patching LTP sources 507970 -Wcalloc-transposed-args warnings in valgrind-di-server.c 508027 Fix mips32 FTBFS 508029 Review the vmsplice syscall wrapper 508030 Add several missing syscall hooks to ppc64-linux 508093 VALGRIND_CLO_CHANGE does not update vex_control 508145 ppc64le needs ld.so hardwire for strcmp 508154 PRE(sys_fchownat) not handling VKI_AT_FDCWD 508638 Self-hosting not working on FreeBSD 508777 amd64-linux: add minimal scalar test 508778 syscall-wrapper waitid warns about infop=null 508779 PRE(sys_prlimit64): reorder check for memory validity 508869 x86-linux: simplify scalar test output 508958 FreeBSD: add getgroups and setgroups wrappers 509103 Fix tests/arm64/bug484935.c build with "-O2 -flto -ffat-lto-objects" 509107 memcheck/tests/duplicate_align_size_errors.cpp fails 509139 Update BadSize error messages 509258 FreeBSD: add jail_attach_jd and jail_remove_jd syscall wrappers 509406 FreeBSD 15 issues 509517 s390x: Even/odd lane confusion in various vector insns 509566 Wrap amd64-linux syscall: 442 (mount_setattr) 509572 s390x: Overhaul BFP testsuite 509590 Run the LTP tests with LTP_QUIET 509567 unhandled amd64-linux syscall: 443 (quotactl_fd) 509642 Add missing ppc64-linux syswraps 509643 Add missing s390x-linux syswraps 510169 Update the LTP version in valgrind testsuite to 20250930 510292 Silence false positive failure of LTP munmap01 510436 Don't warn about fcntl F_GETFD with --track-fds 510694 Handle qExecAndArgs remote protocol packet To see details of a given bug, visit https://bugs.kde.org/show\_bug.cgi?id=XXXXXX where XXXXXX is the bug number as listed above. (3.26.0.RC1: 17 Oct 2025) https://redd.it/1ofu1xb @r_cpp

debug.ptrace_attach_transparent=0 See also https://bugs.freebsd.org/bugzilla/show\_bug.cgi?id=290008 * ==================== TOOL CHANGES =================== * There is a new utility script, "vgstack". It has two option, -h for minimal help, and -v for the version information. In normal use pass it the PID of a running Valgrind process and it will perform a vgdb attach and print the backtrace(s) of the guest executable. * Memcheck handling of aligned allocation functions with a size of zero has changed. Firstly, 'free_aligned_sized' with a size of zero is no longer considered an error. This was intended so that deallocation had the same behaviour as allocation. In practice, platforms that allow aligned allocation with a size of zero will already generate an error at allocation. Other platforms will get an 'Invalid free' error. The case where the allocation and deallocation sizes are different with the deallocation size being zero is already covered by "Mismatched [alloc/dealloc\] size" errors. Secondly, the three C aligned allocation functions memalign, aligned_alloc and posix_memalign have a different error message if used with a size of zero. Previously the error was "[function\] invalid size value: [number\]". This was an overstatement of the issue. The problem is that such usage is not portable across platforms. memalign and aligned_alloc are poorly documented, saying things like "Behavior is undefined if size is not an integral multiple of alignment.". Clearly this does not include negative integers though it does not say so explicitly. Does that include zero? posix_memalign is well documented but says that using a size of 0 is implementation-defined. These functions now produce an error "Unsafe allocation with size of zero is implementation-defined". The associated suppression name has also changed from "BadSize" to "UnsafeZeroSize". Checks for C23 free_sized and free_aligned_sized have been added to Linux. Almost no libraries support these functions yet, with the exception being Google tcmalloc. * ==================== FIXED BUGS ==================== The following bugs have been fixed or resolved. Note that "n-i-bz" stands for "not in bugzilla" -- that is, a bug that was reported to us but never got a bugzilla entry. We encourage you to file bugs in bugzilla (https://bugs.kde.org/enter\_bug.cgi?product=valgrind) rather than mailing the developers (or mailing lists) directly -- bugs that are not entered into bugzilla tend to get forgotten about or ignored. 286849 [PATCH\] Interceptors for new/delete on Darwin were erroneously commented out in r12043 306098 s390x: Alternate opcode form for convert to/from fixed and friends 309100 s390x: Testcases for extended BFP 309554 Wrap syscall remap_file_pages (216) 331311 Valgrind shows open files in /proc/self/fd that don't work for the process 338803 Handling of dwz debug alt files or cross-CU is broken 368791 Handle swapon and swapoff syscalls as linux generic 369030 Wrap linux syscall: 171 (setdomainname) 388526 Inconsistent severity in message text: "WARNING: Serious error" 418756 MAP_FIXED_NOREPLACE mmap flag unsupported 454276 Some IPC syscalls is missing for x86 linux 476465 AArch64 ARMv8.3 LDAPR/LDAPRH/LDAPRB instructions not supported 493430 Review all syscalls that use or return (new) file descriptors 493434 Add --track-fds=bad mode (no "leak" tracking) 501741 syscall cachestat not wrapped 502359 Add --modify-fds=yes option 502968 Wrap linux specific syscalls 457 (listmount) and 458 (statmount) 503098 Incorrect NAN-boxing for float registers in RISC-V 503241 s390x: Support z17 changes to the NNPA instruction 503641 close_range syscalls started failing with 3.25.0 503677 duplicated-cond compiler warning in dis_RV64M 503817 s390x: fix 'ordered comparison of pointer with integer zero' compiler warnings 503914 mount syscall param filesystemtype may be NULL 503969 Make test results of make ltpchecks

Valgrind 3.26 released We are pleased to announce a new release of Valgrind, version 3.26.0, available from https://valgrind.org/downloads/current.html This release adds an upgrade to GPL version 3, build control for html and/or pdf docs, added LibVEX_set_VexControl, removed Iop_Clz32/64 and Iop_Ctz32/64, integrated LTP v20250930, 13 new Linux syscall wrappers, new --modify-fds=yes, use log output protocol 6 with --xml=yes, new --track-fds=bad, gdb qExecAndArgs packet support, rewrite of DWARF inlined subroutine handling, new vgstack utility, handling of aligned allocation with size of zero changed, checks for C23 free_sized and free_aligned_sized. See the release notes below for details of the changes. Our thanks to all those who contribute to Valgrind's development. This release represents a great deal of time, energy and effort on the part of many people. It was a busy release, with more than 400 commits by 12 people, fixing 90 bugs. Happy and productive debugging and profiling, \-- The Valgrind Developers Release 3.26.0 (24 Oct 2025) \~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~ This release supports X86/Linux, AMD64/Linux, ARM32/Linux, ARM64/Linux, PPC32/Linux, PPC64BE/Linux, PPC64LE/Linux, S390X/Linux, MIPS32/Linux, MIPS64/Linux, RISCV64/Linux, ARM/Android, ARM64/Android, MIPS32/Android, X86/Android, X86/Solaris, AMD64/Solaris, AMD64/MacOSX 10.12, X86/FreeBSD, AMD64/FreeBSD and ARM64/FreeBSD There is also preliminary support for X86/macOS 10.13, AMD64/macOS 10.13 and nanoMIPS/Linux. * ==================== CORE CHANGES =================== * Upgrade to the GNU General Public License version 3. * Control building documentation. When using make dist set the Makefile BUILD_DOCS to none, all or html. none, does not build any documentation. all, builds all documentation. html, builds HTML docs but skips building PDFs. See also README_DEVELOPERS. * New VEX API function LibVEX_set_VexControl * The deprecated IROps: Iop_Clz32/64 and Iop_Ctz32/64 have been removed * The Linux Test Project (LTP) integration has been updated to v20250930. The test output has been made compatible with bunsen. Various issues with the linux syscall wrappers have been fixed. New Linux syscall wrappers for: cachestat, futex_waitv, listmount, mount_setattr, mseal, quotactl_fd, remap_file_pages, setdomainname, statmount, swapoff, swapon, sysfs and ustat. * --modify-fds=yes has been added. It acts like --modify-fds=high (the highest available file descriptor is returned first) except when when the lowers stdin/stdout/stderr (file descriptors 0, 1, 2) are available. With --modify-fds=yes 0, 1 or 2 are always returned first when still available before higher file descriptor numbers are. * With --xml=yes log output protocol 6 is now always used (unlike protocol 5 which was only used with--track-fds). The main difference is that the xml output now contains error summaries. See also xml-output-protocol6.txt. * Add "bad" option for --track-fds. When --track-fds=bad is specified, do not produce errors about unclosed file descriptors at program exit. Only produce errors for bad file descriptor usage, either double close or use of file descriptor that is (no longer) valid. * vgdb will now handle the qExecAndArgs packet. * DWARF inlined subroutine handling has been rewritten to work cross compile units. This should get rid of backtraces with "UnknownInlinedFun". * ================== PLATFORM CHANGES ================= FreeBSD 15 (which is expected to ship in December 2025, after Valgrind 3.26 is released) contains a change to ptrace that affects use of Valgrind with vgdb. This impacts the mechanism that vgdb uses to interrupt Valgrind if all threads are blocked and you want to get back to the gdb prompt by hitting ctrl-c. This mechanism is no longer reliable. On arm64 Valgrind will crash with an assert. On amd64 syscalls may give spurious and incorrect return codes. There is a workaround. Run the following command (as root). sysctl

Alternatives for visual studio code for learning OOP Everyone says to use VSC. I tried to setup vsc but failed every time. I also tried codeblocks but, it's very outdated or I don't know how to use it. Hence I am asking here. Are there any good alternatives which are easy to install and setup like codeblocks but are not outdated? https://redd.it/1ofqfs2 @r_cpp

Which is more ideal and better practice? Which architecture is better, cleaner and overall better in c++ Example A class Light { //abstract class } And then example class PointLight: Light{} class SpotLight: Light{} Or example B class Light final{ enum class LightType { Spot, Point } LightType type; } https://redd.it/1ofeeri @r_cpp

Question about header files So I'm committing some serious taboo and using chatGPT to help me make a CLI text based game I'm making. One thing that struck me as odd was that it kept wanting me to make header files. I asked about this and it said that it was good practice, and I questioned it because from my understanding this adds another file to compile and can create more overhead than needed especially if it's only used once. Now I haven't gotten to a point where I need to use the header files or source code more than once but I want it to be scalable as I work on it. So the main question is this. is it good to make a lot of header files for the game or should I just stick to source code. Why and why not. P.S. I also have looked into what other people say and official documentation but I can't make heads or tails of it. https://redd.it/1ofd72j @r_cpp

Modules on MacOs Hello, I know Apple Clang is behind normal clang. Thus, I installed LLVM and started a new project in CLion. I provided the path to LLVM and everything. However I could still not make import std; work. Is anyone here on MacOS (Tahoe/M2 Max) and using import std; in his project? Or are magical compiler flags needed and it still does not work out of the box? https://redd.it/1of0nf9 @r_cpp

Structured binding with std::div() I have the following code: int indx; ... int row = indx / 9; int col = indx % 9; It is attractive to substitute the following: auto row, col = std::div(indx, 9); However, it's not equivalent. The problem is that in the std::div_t struct that std::div() returns, the order of quot & rem members is not specified. So in my structured binding code, it is unspecified if row and col are assigned quot & rem respectively, or the other way around. In fact, my algorithm words whether I scan my array row-wise or column-wise, so I used the structured binding construct successfully. But in general, it is not usable if you care about the order of your tuple members. The structured binding code combined with std::div() is so attractive, it's a shame you can't rely on it in general. It's desirable for C++ features to work together in expected ways. That's what they call "orthogonality". One possible fix is to specify the order of the div_t members. This would not break correct legacy code which refers to div_t members by name. But div() inherits from c, so changing it is not so simple. Any thoughts? https://redd.it/1of72qx @r_cpp

Parallel C++ for Scientific Applications: The C++ Standard Library, Iterators and Ranges https://www.youtube.com/watch?v=vlJ2C3M1-Hw https://redd.it/1of4uje @r_cpp