util/StringPointer: add method empty()
This commit is contained in:
parent
b9a8b0d146
commit
a944927b56
@ -40,6 +40,8 @@ public:
|
||||
typedef T *pointer;
|
||||
typedef const T *const_pointer;
|
||||
|
||||
static constexpr value_type SENTINEL = '\0';
|
||||
|
||||
private:
|
||||
const_pointer value;
|
||||
|
||||
@ -59,6 +61,10 @@ public:
|
||||
constexpr const_pointer c_str() const {
|
||||
return value;
|
||||
}
|
||||
|
||||
bool empty() const {
|
||||
return *value == SENTINEL;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user