util/{Const,Writable}Buffer: drop "_type" from type names

Behave like STL.
This commit is contained in:
Max Kellermann
2020-01-03 15:49:29 +01:00
parent 53f8053188
commit 4937d77cb6
26 changed files with 176 additions and 180 deletions

View File

@@ -45,12 +45,12 @@ template<>
struct ConstBuffer<void> {
typedef std::size_t size_type;
typedef void value_type;
typedef const void *pointer_type;
typedef pointer_type const_pointer_type;
typedef pointer_type iterator;
typedef pointer_type const_iterator;
typedef const void *pointer;
typedef pointer const_pointer;
typedef pointer iterator;
typedef pointer const_iterator;
pointer_type data;
pointer data;
size_type size;
ConstBuffer() = default;
@@ -58,7 +58,7 @@ struct ConstBuffer<void> {
constexpr ConstBuffer(std::nullptr_t) noexcept
:data(nullptr), size(0) {}
constexpr ConstBuffer(pointer_type _data, size_type _size) noexcept
constexpr ConstBuffer(pointer _data, size_type _size) noexcept
:data(_data), size(_size) {}
constexpr static ConstBuffer<void> FromVoid(ConstBuffer<void> other) noexcept {
@@ -95,12 +95,12 @@ struct ConstBuffer {
typedef T value_type;
typedef const T &reference_type;
typedef reference_type const_reference_type;
typedef const T *pointer_type;
typedef pointer_type const_pointer_type;
typedef pointer_type iterator;
typedef pointer_type const_iterator;
typedef const T *pointer;
typedef pointer const_pointer;
typedef pointer iterator;
typedef pointer const_iterator;
pointer_type data;
pointer data;
size_type size;
ConstBuffer() = default;
@@ -108,10 +108,10 @@ struct ConstBuffer {
constexpr ConstBuffer(std::nullptr_t) noexcept
:data(nullptr), size(0) {}
constexpr ConstBuffer(pointer_type _data, size_type _size) noexcept
constexpr ConstBuffer(pointer _data, size_type _size) noexcept
:data(_data), size(_size) {}
constexpr ConstBuffer(pointer_type _data, pointer_type _end) noexcept
constexpr ConstBuffer(pointer _data, pointer _end) noexcept
:data(_data), size(_end - _data) {}
/**
@@ -127,7 +127,7 @@ struct ConstBuffer {
*/
static constexpr ConstBuffer<T> FromVoidFloor(ConstBuffer<void> other) noexcept {
static_assert(sizeof(T) > 0, "Empty base type");
return ConstBuffer<T>(pointer_type(other.data),
return ConstBuffer<T>(pointer(other.data),
other.size / sizeof(T));
}
@@ -282,7 +282,7 @@ struct ConstBuffer {
* Move the front pointer to the given address, and adjust the
* size attribute to retain the old end address.
*/
void MoveFront(pointer_type new_data) noexcept {
void MoveFront(pointer new_data) noexcept {
#ifndef NDEBUG
assert(IsNull() == (new_data == nullptr));
assert(new_data <= end());
@@ -296,7 +296,7 @@ struct ConstBuffer {
* Move the end pointer to the given address (by adjusting the
* size).
*/
void SetEnd(pointer_type new_end) noexcept {
void SetEnd(pointer new_end) noexcept {
#ifndef NDEBUG
assert(IsNull() == (new_end == nullptr));
assert(new_end >= begin());