Skip to content

Commit 84b0542

Browse files
committed
Changed operator bool to explicit rather than implicit conversion in Serial
1 parent ceacc17 commit 84b0542

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cores/arduino/UART.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class UartClass : public HardwareSerial
164164
inline size_t write(unsigned int n) { return write((uint8_t)n); }
165165
inline size_t write(int n) { return write((uint8_t)n); }
166166
using Print::write; // pull in write(str) and write(buf, size) from Print
167-
operator bool() { return true; }
167+
explicit constexpr operator bool() { return true; }
168168

169169
// Interrupt handlers - Not intended to be called externally
170170
inline void _rx_complete_irq(void);

libraries/SoftwareSerial/src/SoftwareSerial.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class SoftwareSerial : public Stream
103103
virtual int read();
104104
virtual int available();
105105
virtual void flush();
106-
operator bool() { return true; }
106+
explicit constexpr operator bool() { return true; }
107107

108108
using Print::write;
109109

0 commit comments

Comments
 (0)