1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-25 02:24:24 +00:00

ImStrv: allow constructing from two null pointers.

This commit is contained in:
ocornut 2024-05-03 16:24:52 +02:00 committed by ocornut
parent 2a3fa8123c
commit d94a403b17

View file

@ -327,7 +327,7 @@ struct ImStrv
const char* End;
ImStrv() { Begin = End = NULL; }
ImStrv(const char* b) { Begin = b; End = b ? b + strlen(b) : NULL; }
ImStrv(const char* b, const char* e){ Begin = b; End = e ? e : b + strlen(b); }
ImStrv(const char* b, const char* e){ Begin = b; End = e ? e : b ? b + strlen(b) : NULL; }
inline size_t length() const { return (size_t)(End - Begin); }
inline bool empty() const { return Begin == End; } // == "" or == NULL
inline operator bool() const { return Begin != NULL; } // return true when valid ("" is valid, NULL construction is not)