Skip to content
This repository was archived by the owner on May 3, 2026. It is now read-only.

Commit 5455004

Browse files
committed
delete SmartPort and AdiPort copy constructors
1 parent 3412f54 commit 5455004

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

include/pros/devices/port.hpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ class SmartPort {
3737
return m_number - 1;
3838
}
3939

40+
// users should always use a reference to a SmartPort
41+
SmartPort(SmartPort& other) = delete;
42+
4043
pros::RecursiveMutex mutex;
4144

4245
private:
@@ -82,6 +85,9 @@ class AdiPort {
8285
return m_index;
8386
}
8487

88+
// users should always use a reference to an AdiPort
89+
AdiPort(AdiPort& other) = delete;
90+
8591
SmartPort& host_port;
8692

8793
private:
@@ -92,7 +98,7 @@ class AdiPort {
9298
* @param port must be uppercase, 'A' - 'H'
9399
* @return constexpr AdiPort
94100
*/
95-
constexpr AdiPort(SmartPort& host_port, char port)
101+
AdiPort(SmartPort& host_port, char port)
96102
: host_port(host_port),
97103
m_index(port - 'A') {}
98104

0 commit comments

Comments
 (0)