Browse Source

Merge pull request #232 from tni/master

Make Print and Stream constructors constexpr.
main
Paul Stoffregen 7 years ago
parent
commit
36996042c7
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      teensy3/Print.h
  2. +1
    -1
      teensy3/Stream.h

+ 1
- 1
teensy3/Print.h View File

@@ -49,7 +49,7 @@ class __FlashStringHelper;
class Print
{
public:
Print() : write_error(0) {}
constexpr Print() : write_error(0) {}
virtual size_t write(uint8_t b) = 0;
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);

+ 1
- 1
teensy3/Stream.h View File

@@ -26,7 +26,7 @@
class Stream : public Print
{
public:
Stream() : _timeout(1000), read_error(0) {}
constexpr Stream() : _timeout(1000), read_error(0) {}
virtual int available() = 0;
virtual int read() = 0;
virtual int peek() = 0;

Loading…
Cancel
Save