util/ConstBuffer, ...: use using instead of typedef

This commit is contained in:
Max Kellermann 2020-04-06 15:19:06 +02:00
parent cc3e71d8c7
commit 3a51fe31df
3 changed files with 32 additions and 32 deletions

View File

@ -44,11 +44,11 @@ struct ConstBuffer;
template<>
struct ConstBuffer<void> {
typedef std::size_t size_type;
typedef void value_type;
typedef const void *pointer;
typedef pointer const_pointer;
typedef pointer iterator;
typedef pointer const_iterator;
using value_type = void;
using pointer = const void *;
using const_pointer = pointer;
using iterator = pointer;
using const_iterator = pointer;
pointer data;
size_type size;
@ -91,14 +91,14 @@ struct ConstBuffer<void> {
*/
template<typename T>
struct ConstBuffer {
typedef std::size_t size_type;
typedef T value_type;
typedef const T &reference;
typedef reference const_reference;
typedef const T *pointer;
typedef pointer const_pointer;
typedef pointer iterator;
typedef pointer const_iterator;
using size_type = std::size_t;
using value_type = T;
using reference = const T &;
using const_reference = reference;
using pointer = const T *;
using const_pointer = pointer;
using iterator = pointer;
using const_iterator = pointer;
pointer data;
size_type size;

View File

@ -39,19 +39,19 @@ template<typename T, std::size_t CAPACITY>
class BasicStringBuffer {
public:
typedef T value_type;
typedef T &reference;
typedef T *pointer;
typedef const T *const_pointer;
typedef std::size_t size_type;
using reference = T &;
using pointer = T *;
using const_pointer = const T *;
using size_type = std::size_t;
static constexpr value_type SENTINEL = '\0';
protected:
typedef std::array<value_type, CAPACITY> Array;
using Array = std::array<value_type, CAPACITY>;
Array the_data;
public:
typedef typename Array::const_iterator const_iterator;
using const_iterator = typename Array::const_iterator;
constexpr size_type capacity() const noexcept {
return CAPACITY;

View File

@ -45,11 +45,11 @@ struct WritableBuffer;
template<>
struct WritableBuffer<void> {
typedef std::size_t size_type;
typedef void value_type;
typedef void *pointer;
typedef const void *const_pointer;
typedef pointer iterator;
typedef const_pointer const_iterator;
using value_type = void;
using pointer = void *;
using const_pointer = const void *;
using iterator = pointer;
using const_iterator = const_pointer;
pointer data;
size_type size;
@ -90,14 +90,14 @@ struct WritableBuffer<void> {
*/
template<typename T>
struct WritableBuffer {
typedef std::size_t size_type;
typedef T value_type;
typedef T &reference;
typedef const T &const_reference;
typedef T *pointer;
typedef const T *const_pointer;
typedef pointer iterator;
typedef const_pointer const_iterator;
using size_type = std::size_t;
using value_type = T;
using reference = T &;
using const_reference = const T &;
using pointer = T *;
using const_pointer = const T *;
using iterator = pointer;
using const_iterator = const_pointer;
pointer data;
size_type size;