Go Down

Topic: __FlashStringHelper class source code? (Read 1 time) previous topic - next topic

ultr

Hello.

Where can I find the source code for the __FlashStringHelper class?
I've searched Arduino's IDE internals and source codes on GitHub, but to no avail.

Thanks!

pert

I found this:
https://github.com/arduino/ArduinoCore-avr/blob/1.6.23/cores/arduino/WString.h#L37-L38
Code: [Select]
class __FlashStringHelper;
#define F(string_literal) (reinterpret_cast<const __FlashStringHelper *>(PSTR(string_literal)))

Coding Badly

Where can I find the source code for the __FlashStringHelper class?
There is none (beyond the declaration above).  It's a fictitious class meant to force the compiler's hand.

Originally I believe it was a struct.  I suspect Mr. Hart changed it to a class because classes are cooler.  :)  The point is, the actual type is irrelevant.  What is important is that the type is unique and that a pointer to the whatever is used.


Go Up