Make Print and Stream constructors constexpr.main
class Print | class Print | ||||
{ | { | ||||
public: | public: | ||||
Print() : write_error(0) {} | |||||
constexpr Print() : write_error(0) {} | |||||
virtual size_t write(uint8_t b) = 0; | virtual size_t write(uint8_t b) = 0; | ||||
size_t write(const char *str) { return write((const uint8_t *)str, strlen(str)); } | size_t write(const char *str) { return write((const uint8_t *)str, strlen(str)); } | ||||
virtual size_t write(const uint8_t *buffer, size_t size); | virtual size_t write(const uint8_t *buffer, size_t size); |
class Stream : public Print | class Stream : public Print | ||||
{ | { | ||||
public: | public: | ||||
Stream() : _timeout(1000), read_error(0) {} | |||||
constexpr Stream() : _timeout(1000), read_error(0) {} | |||||
virtual int available() = 0; | virtual int available() = 0; | ||||
virtual int read() = 0; | virtual int read() = 0; | ||||
virtual int peek() = 0; | virtual int peek() = 0; |