瀏覽代碼

Add support for if (String) syntax

main
PaulStoffregen 7 年之前
父節點
當前提交
253da1599d
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. +7
    -0
      teensy3/WString.h

+ 7
- 0
teensy3/WString.h 查看文件

@@ -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

Loading…
取消
儲存