purduesigbots/pros

Copy operator for motor_group implicitly deleted

AvereyTheTerrible opened this issue · 5 comments

I get this error when I try to assign a motor_group to another motor_group. It seems improbable that this is an intended behavior of motor groups

System information:

Platform:
PROS Kernel Version: 3.8.0

Additional Information

Screenshots/Output Dumps/Stack Traces

Screenshot 2023-08-26 144953

On further inspection this seems to be because mutexes have explicitly deleted copy operators. If this is intentionally maybe explicitly delete the copy operators for motor_groups?

djava commented

yeah this seems surely unintentional. Easy fix to define a custom copy ctor (and move) ctor.

I don't think that will work since it would still try to copy mutexes which have explicitly deleted copy operators. I'm no expert though.

djava commented

It wouldn't unless you told it too. You'd only copy the ports vector in that copy ctor.

Oh yea I guess that works. The copied motor_group would kind of become a reference then.