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

Looking for someone interested in collaborating on designing a variant of slic3r

I am working on developing an ATL(automated tape laying) machine for winding PEEK/CF COPVs (composite overwrapped pressure vessels). I have some coding skills, but they are mainly in Python. I believe I can use the source code of slic3r, which is mainly C++ with a bit of Perl, to create a modified version for CF tape wrapping on tank-shaped mandrels. Unfortunately, I do not know enough C++ to handle this project by myself. I would greatly appreciate someone who could get interested in this project and would assist me in modifying the source code to handle this type of winding.

Thanks in advance!

https://redd.it/1ceqr43
@r_cpp

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

C++ - Reddit

Create a List of factory functions at compile time

I have a rather esotheric question. I would like to create a list of `std::function<FactoryType>` using CRTP. Goal is to allow another class to access the static list of factories to create instances for all derived classes. My current solution looks as follows:

class Base {
public:
using FactoryType = std::function<std::shared_ptr<Base>()>;

static const std::vector<FactoryType>& GetFactories() { return mFactories; }

public:
static std::vector<FactoryType> mFactories;
}

template<class T>
class RegisteredBase : public Base {
public:
// Force initialization of the flag
RegisteredBase() { static const auto ignore = mRegistered; } // std::ignore does not suffice for some reason.

private:
static bool RegisterBaseType() {
Base::mFactories.emplace_back([] { return std::shared_ptr<T>(); });
return true;
}

static bool mRegistered;
}

template<class T>
inline bool RegisteredBase<T>::mRegistered = RegisteredBase<T>::RegisterBaseType();

In my mind, this should allow me to define classes deriving from `RegisteredBase<...>`, e.g.: `class Derived : public RegisteredBase<Derived> {...};` which should initialize the vector of factories automatically.
After that I want to be able to do something along the lines of:

std::vector<std::shared_ptr<Base>> instances;
std::ranges::transform(Base::GetFactories(), std::back_inserter(instances),
[](const auto& factory) { return factory(); });

to create a list of all derived classes instances.

This compiles fine. Problem is that this code leads to runtime errors and lets my application fail on startup. Questions are:

1. Is this valid? I have the feeling that I am running into ordering problems because the factoryList was not populated before accessing it and will only be populated after accessing it the first time.
2. Can this be done using constexpr to move it to compile time?
3. Is there a better way to achieve such behavior?

Thanks in advance! :)

https://redd.it/1cemczn
@r_cpp

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

C++ - Reddit

C++ Visual Programing tool

i dont know anything about c++ yet and i need it just to make a really simple task but text coding feels very hard to me

i prefer visual programing tools like Scratch for example



whats the best visual programing tool out there for c++ language to help me out ?

https://redd.it/1ceirqu
@r_cpp

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

C++ - Reddit

Is cmake Turing complete?Can I make a game just use cmakelists?

I think it would be interesting

https://redd.it/1cegwdv
@r_cpp

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

C++ - Reddit

Roadmap by Software Engineer

Greetings to everyone, I recently decided to become a Software engineer, can someone recommend a high-quality and good roadmap please?

https://redd.it/1cecon3
@r_cpp

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

C++ - Reddit

Is anyone using the Facebook Proxygen library?

I discovered Proxygen when browsing HTTP libraries. It seems like it has a lot of great features, but it doesn't seem extremely well tested and there's barely any discussion about it online. What do people think about it?

https://redd.it/1ce8t4j
@r_cpp

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

C++ - Reddit

only exit
on one of the listed errors.
475498 Add reallocarray wrapper
476025 Vbit expected test results for Iop_CmpGT64Ux2 are wrong
476320 Build failure with GCC
476331 clean up generated/distributed filter scripts
476535 Difference in allocation size for massif/tests/overloaded-new between
clang++/libc++ and g++/libstdc++
476548 valgrind 3.22.0 fails on assertion when loading debuginfo file
produced by mold
476708 valgrind-monitor.py regular expressions should use raw strings
476780 Extend strlcat and strlcpy wrappers to GNU libc
476787 Build of Valgrind 3.21.0 fails when SOLARIS_PT_SUNDWTRACE_THRP is
defined
476887 WARNING: unhandled amd64-freebsd syscall: 578
477198 Add fchmodat2 syscall on linux
477628 Add mremap support for Solaris
477630 Include ucontext.h rather than sys/ucontext.h in Solaris sources
477719 vgdb incorrectly replies to qRcmd packet
478211 Redundant code for vgdb.c and Valgrind core tools
478624 Valgrind incompatibility with binutils-2.42 on x86 with new nop patterns
(unhandled instruction bytes: 0x2E 0x8D 0xB4 0x26
478837 valgrind fails to read debug info for rust binaries
479041 Executables without RW sections do not trigger debuginfo reading
480052 WARNING: unhandled amd64-freebsd syscall: 580
480126 Build failure on Raspberry Pi 5 / OS 6.1.0-rpi7-rpi-v8
480405 valgrind 3.22.0 "m_debuginfo/image.c:586 (set_CEnt):
Assertion '!sr_isError(sr)' failed."
480488 Add support for FreeBSD 13.3
480706 Unhandled syscall 325 (mlock2)
481127 amd64: Implement VFMADD213 for Iop_MAddF32
481131 [PATCH] x86 regtest: fix clobber lists in generated asm statements
481676 Build failure on Raspberry Pi 5 Ubuntu 23.10 with clang
481874 Add arm64 support for FreeBSD
483786 Incorrect parameter indexing in FreeBSD clock_nanosleep syscall wrapper
484002 Add suppression for invalid read in glibc's __wcpncpy_avx2() via wcsxfrm()
484426 aarch64: 0.5 gets rounded to 0
484480 False positives when using sem_trywait
484935 [patch] Valgrind reports false "Conditional jump or move depends on
uninitialised value" errors for aarch64 signal handlers
485148 vfmadd213ss instruction is instrumented incorrectly (the remaining
part of the register is cleared instead of kept unmodified)
485487 glibc built with -march=x86-64-v3 does not work due to ld.so strcmp
485778 Crash with --track-fds=all and --gen-suppressions=all
n-i-bz Add redirect for memccpy

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.23.0.RC1: 19 Apr 2024)
(3.23.0.RC2: 24 Apr 2024)

https://redd.it/1ce6n98
@r_cpp

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

C++ - Reddit

I need a c++ coder for hire

Its a three part assignment using bubblesort. The code is written. I just need someone to write a report on it. Within 2 hours.

https://redd.it/1ce39l1
@r_cpp

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

C++ - Reddit

Learning cpp question

Hello!

I am a 3rd year CS major, and I have an internship this coming summer.

One of the languages I need to know is C++. Naturally, I have zero experience with it. The extent of my knowledge is that it’s just C, but with objects.

My question is: what’s the best way to start learning other than coding in it? Textbook, online articles, YouTube videos ? I like to have a strong grasp of a language before ever coding a single line in it , so I lean towards textbooks and the like; but I want to make sure I’m not wasting my time; hence the post.

I have ~3 weeks after final exams to cram knowledge about it before the internship (I know this is a very small time frame, but note I am trying to just learn the basics, not become a pro or anything)

For reference, here is my current knowledge level of the languages I know so far (10 being I am proficient, 0 being I have no idea:)

Java: 9/10
Python: 8/10
C: 7/10
JS: 6:10
Swift: 3/10

Thanks!

https://redd.it/1cdvuvs
@r_cpp

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

C++ - Reddit

No macro, no builtin, aggregate field name reflection proof of concept

https://godbolt.org/z/Y536rc3sv

Inspired by magic\_enum reliant on boost/pfr
Biggest limitation right now, is that aggregates have to be constructable at constexpr, otherwise the names are not available at constexpr

https://redd.it/1cdpf3q
@r_cpp

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

C++ - Reddit

Is SCIP good supplement as new programmer?

I'm new to C++ and using C++ Primer and I love this book. I think it's really efficient at teaching the language. I have some exposure to programming with Python. Would it make sense to study SCIP simultaneously to learn fundamental CS/programming concepts? Or should I wait till I have progressed further in C++ Primer?

https://redd.it/1cd9y64
@r_cpp

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

C++ - Reddit

Anybody still using a 2017 MacBook Air for software dev?

Just curious if these machines are still usable for software dev these days. Thanks!!

https://redd.it/1cd70cj
@r_cpp

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

C++ - Reddit

How to get access derived class's method in heterogenous container?

I'm doing my uni homework for programming 2. My project is a simple 3D OpenGL game. The problem the next: I have a GameObject class which is the base class. And I have a DrawableGameObject class which derived from GameObject. DrawableGameObject class contains a void draw() function, but the GameObject doesnt. And I want to store every gameobject in a heterogenous container because I need to use het. con. So I have a render function which want to call every drawableobjects draw function. The render function looks like this:

void App::render(std::vector<GameObject*> gameObjectsToRender)
{
glClearColor(0.25, 0.45, 0.95, 0.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
for (size_t i = 1; i < 2; i++)
{
gameObjectsToRender[i]->draw(); <-- this is what i want to do
}
}

This is my het. container: (Ofc this is before render function)
std::vector<GameObject*> gameobjects;
gameobjects.push_back(new Player());
gameobjects.push_back(new DrawableGameObject());

https://redd.it/1cd0021
@r_cpp

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

C++ - Reddit

Conan 2.2 launches local source folders as Conan repositories
https://blog.conan.io/2024/04/23/Introducing-local-recipes-index-remote.html

https://redd.it/1cct3bb
@r_cpp

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

C++ - Reddit

Advise on Datatypes

Hello is there comparisons about c++ datatypes and phyton and Java??
Advantages disanvantages?
Is some of these languages have better datatypes? Or datatypes that only belong to a certain language?
TIA

https://redd.it/1ccqoyt
@r_cpp

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

C++ - Reddit

What could be wrong with this code asked in Microsoft coding test?

I recently gave Microsoft coding test. I was given below debugging question. I was not able to figure it out during test. I still cannot understand what could be wrong with this. Tried asking this to Gemini, no luck.
Can anyone can point out what's wrong with the code? (I hadn't changed anything in the code. This was the pre-written code.)

Question

https://redd.it/1celosq
@r_cpp

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

C++ - Reddit

Is code::blocks a dead project ?

Is [code::blocks\](https://www.codeblocks.org/) a dead project ? Nightly binaries are being deployed at (https://forums.codeblocks.org/index.php/board,20.0.html), but the source repository doesn't seem to be found, and signing up for the forums doesn't seem feasible.

code::blocks death would be very sad, for it's a great C++ IDE, the best one I could find for Linux.

https://redd.it/1cek3ck
@r_cpp

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

C++ - Reddit

First Job!!!!

I have just graduated and joined in a startup as a cpp developer. What is the future scope of a cpp developer. are cpp developer paid well?

https://redd.it/1cei00w
@r_cpp

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

C++ - Reddit

Can some one explain me this.


Source code:

while (true) {
waitingi = true;
key = 1;
while (waitingi && key == 1)
key = compareandswap(&lock,0,1);
waitingi = false;
/ critical section /
j = (i + 1) % n;
while ((j != i) && !waitingj)
j = (j + 1) % n;
if (j == i)
lock = 0;
else
waitingj = false;
/ remainder section /
}


I can't seem to understand it it is compare and swap hardware solution for process synchronisation in my operating system

https://redd.it/1cef87z
@r_cpp

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

C++ - Reddit

Things std proposals could potentially learn from PEP and JEP

Recently I read a lot stdcpp proposals and PEPs and noticed that PEP includes several more sections. Their format can be found here (for cpp), here (Python) and here (for OpenJDK). Specifically, stdcpp proposals mostly only include technical details, while othr languages also include:

- Security Implications: Despite some use cases might not putting security as the most important goal, keeping that at design stage definitely helps make explicit decisions
- How to Teach This: Good for C++ community
- Migration: This helps users better understand and use the updated feature. Some papers already include it but they are hidden in 'Design' section, rendering poor readability for average users.


Any thought on these suggestions?

https://redd.it/1ce6pq0
@r_cpp

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

C++ - Reddit

Where the heck can I find a remote C++ job (Qt/C++)

Basically the title . I'm a good developer with 20 months of professional experience with C++ & Qt . Did great projects .. etc .

https://redd.it/1ce5soj
@r_cpp

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

C++ - Reddit

Valgrind 3.23 released.

We are pleased to announce a new release of Valgrind, version 3.23.0,
available from https://valgrind.org/downloads/current.html.

See the release notes below for details of 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.

Happy and productive debugging and profiling,

-- The Valgrind Developers

~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This release supports X86/Linux, AMD64/Linux, ARM32/Linux, ARM64/Linux,
PPC32/Linux, PPC64BE/Linux, PPC64LE/Linux, S390X/Linux, MIPS32/Linux,
MIPS64/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 ===================

* --track-fds=yes will now also warn about double closing of file
descriptors. Printing the context where the file descriptor was
originally opened and where it was previously closed.

* --track-fds=yes also produces "real" errors now which can be
suppressed and work with --error-exitcode. When combined with
--xml the xml-output now also includes FdBadClose and FdNotClosed
error kinds (see docs/internals/xml-output-protocol5.txt).

* The option --show-error-list=no|yes now accepts a new value all.
This indicates to also print the suppressed errors.
This is useful to analyse which errors are suppressed by which
suppression entries.
The valgrind monitor command 'v.info all_errors' similarly now
accepts a new optional argument 'also_suppressed' to show
all errors including the suppressed errors.

* ================== PLATFORM CHANGES =================

* Added ARM64 support for FreeBSD.

* ARM64 now supports dotprod instructions (sdot/udot).

* AMD64 better supports code build with -march=x86-64-v3.
fused-multiple-add instructions (fma) are now emulated more
accurately. And memcheck now handles __builtin_strcmp using 128/256
bit vectors with sse4.1, avx/avx2.

* S390X added support for NNPA (neural network processing assist)
facility vector instructions VCNF, VCLFNH, VCFN, VCLFNL, VCRNF and
NNPA (z16/arch14).

* X86 recognizes new binutils-2.42 nop patterns.

* ==================== TOOL CHANGES ===================

* The none tool now also supports xml output.

* ==================== 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.


283429 ARM leak checking needs CLEAR_CALLER_SAVED_REGS
281059 Cannot connect to Oracle using valgrind
328563 make track-fds support xml output
362680 --error-exitcode not honored when file descriptor leaks are found
369723 __builtin_longjmp not supported in clang/llvm on Android arm64 target
390269 unhandled amd64-darwin syscall: unix:464 (openat_nocancel)
401284 False positive "Source and destination overlap in strncat"
428364 Signals inside io_uring_enter not handled
437790 valgrind reports "Conditional jump or move depends on uninitialised
value" in memchr of macOS 10.12-10.15
460616 disInstr(arm64): unhandled instruction 0x4E819402 (dotprod/ASIMDDP)
463458 memcheck/tests/vcpu_fnfns fails when glibc is built for x86-64-v3
463463 none/tests/amd64/fma fails when executed on a x86-64-v3 system
466762 Add redirs for C23 free_sized() and free_aligned_sized()
466884 Missing writev uninit padding suppression for _XSend
471036 disInstr_AMD64: disInstr miscalculated next %rip on RORX imm8, m32/64, r32/6
471222 support tracking of file descriptors being double closed
474160 If errors-for-leak-kinds is specified, exit-on-first-error should

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

C++ - Reddit

advanced C++ skill drills

I saw a video where a basketball player was practicing some very minute dribbling drills that didn't look like they applied to the game at all, but apparently focused some small muscles that are critical for ball handling. I'm looking for a similar set of exercises for my C++ skills, what is this type of training called? do any resources like this exist?

I know there are places like leetcode and project euler, but those are more algorithmic. What I want is to really internalize knowledge of C++ with some hands on coding problems that deal with, say, SFINAE or perfect forwarding, rvalue vs universal-refs, and maybe some spot-the-error questions.

https://redd.it/1ce0yis
@r_cpp

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

C++ - Reddit

Are We (C++20) Modules Yet?
https://arewemodulesyet.org/

https://redd.it/1cdtabj
@r_cpp

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

C++ - Reddit

ClangQL: now supports functions all info, global variables, source locations
https://github.com/AmrDeveloper/ClangQL

https://redd.it/1cdoe4z
@r_cpp

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

C++ - Reddit

Imgui and mupdf

Does anyone know how to render a pdf with Imgui and mupdf or have knowledge of any resources available for this?

Thanks in advance!

https://redd.it/1cd7k7z
@r_cpp

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

C++ - Reddit

Reommendations for writing a compiler in C++

Hey guys,

i have the goal to write a compiler in C++ in the context of a self-guided university project. However, I am unsure what the to be compiled target language should be. Certainly, it has to be some kind of subset of the language as proposed by the teaching staff. I was thinking of Basic or similar, but can you guys give better recommendations?

Thanks in advance!

https://redd.it/1cd0nk7
@r_cpp

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

C++ - Reddit

How about Finite State Machines & Networking in C++?

https://www.oxla.com/blog/how-about-finite-state-machines-networking-in-c

https://redd.it/1cctufa
@r_cpp

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

C++ - Reddit

Fun Example of Unexpected UB Optimization
https://godbolt.org/z/vE7jW4za7

https://redd.it/1cct7me
@r_cpp

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

C++ - Reddit

30+ year-old ideas - are we there yet?
https://dreamsongs.com/Files/Energize.pdf

https://redd.it/1ccq2ke
@r_cpp

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