Parcourir la source

Add support for if (String) syntax

teensy4-core
PaulStoffregen il y a 8 ans
Parent
révision
253da1599d
1 fichiers modifiés avec 7 ajouts et 0 suppressions
  1. +7
    -0
      teensy3/WString.h

+ 7
- 0
teensy3/WString.h Voir le fichier

@@ -196,6 +196,13 @@ protected:
void init(void);
unsigned char changeBuffer(unsigned int maxStrLen);
String & append(const char *cstr, unsigned int length);
private:
// allow for "if (s)" without the complications of an operator bool().
// for more information http://www.artima.com/cppsource/safebool.html
typedef void (String::*StringIfHelperType)() const;
void StringIfHelper() const {}
public:
operator StringIfHelperType() const { return buffer ? &String::StringIfHelper : 0; }
};

class StringSumHelper : public String

Chargement…
Annuler
Enregistrer