util/AllocatedString: add operator[]

This commit is contained in:
Max Kellermann 2016-04-12 22:56:10 +02:00
parent 55be8e6f52
commit fab5f58ee0
1 changed files with 8 additions and 0 deletions

View File

@ -115,6 +115,14 @@ public:
return *value == SENTINEL;
}
reference_type operator[](size_type i) {
return value[i];
}
const reference_type operator[](size_type i) const {
return value[i];
}
pointer_type Steal() {
pointer_type result = value;
value = nullptr;