mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
ImStrv: allow constructing from two null pointers.
This commit is contained in:
parent
2b510f541c
commit
1d18540bf4
1 changed files with 1 additions and 1 deletions
2
imgui.h
2
imgui.h
|
|
@ -327,7 +327,7 @@ struct ImStrv
|
||||||
const char* End;
|
const char* End;
|
||||||
ImStrv() { Begin = End = NULL; }
|
ImStrv() { Begin = End = NULL; }
|
||||||
ImStrv(const char* b) { Begin = b; End = b ? b + strlen(b) : 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 size_t length() const { return (size_t)(End - Begin); }
|
||||||
inline bool empty() const { return Begin == End; } // == "" or == NULL
|
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)
|
inline operator bool() const { return Begin != NULL; } // return true when valid ("" is valid, NULL construction is not)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue