Skip to content

Commit 36ea569

Browse files
committed
allow Print's overloaded write() calls to be used with Adafruit_GFX
Adafruit_GFX overrides one of the Print::write() functions. The rules of overload resolution say that all the overloaded options need to be visible in the class where the first option is found. Since Adafruit_GFX only overrides write(uint8_t), the other version, write(const uint8_t *buffer, size_t size) cannot be called on a Adafruit_GFX display from sketches. This change adds the "using" directive, which tells C++ to consider all of Print's write members to be in scope of Adafruit_GFX, even though only one is overridden.
1 parent 6d51319 commit 36ea569

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Adafruit_GFX.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ class Adafruit_GFX : public Print {
163163
/**********************************************************************/
164164
void cp437(boolean x=true) { _cp437 = x; }
165165

166+
using Print::write;
166167
#if ARDUINO >= 100
167168
virtual size_t write(uint8_t);
168169
#else

0 commit comments

Comments
 (0)