util/AllocatedString: add typedef size_type

This commit is contained in:
Max Kellermann 2016-04-12 22:56:37 +02:00
parent c75b9b0d12
commit 55be8e6f52
1 changed files with 2 additions and 1 deletions

View File

@ -48,6 +48,7 @@ public:
typedef typename StringPointer<T>::const_reference_type const_reference_type;
typedef typename StringPointer<T>::pointer_type pointer_type;
typedef typename StringPointer<T>::const_pointer_type const_pointer_type;
typedef size_t size_type;
static constexpr value_type SENTINEL = '\0';
@ -91,7 +92,7 @@ public:
}
static AllocatedString Duplicate(const_pointer_type begin,
size_t length) {
size_type length) {
auto p = new value_type[length + 1];
*std::copy_n(begin, length, p) = SENTINEL;
return Donate(p);