Commit 3344953d authored by Max Kellermann's avatar Max Kellermann

util/*FifoBuffer: use `using` instead of `typedef`

parent f909615b
/* /*
* Copyright 2003-2018 Max Kellermann <max.kellermann@gmail.com> * Copyright 2003-2019 Max Kellermann <max.kellermann@gmail.com>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
...@@ -40,10 +40,10 @@ ...@@ -40,10 +40,10 @@
template<typename T> template<typename T>
class DynamicFifoBuffer : protected ForeignFifoBuffer<T> { class DynamicFifoBuffer : protected ForeignFifoBuffer<T> {
public: public:
typedef typename ForeignFifoBuffer<T>::size_type size_type; using typename ForeignFifoBuffer<T>::size_type;
typedef typename ForeignFifoBuffer<T>::pointer_type pointer_type; using typename ForeignFifoBuffer<T>::pointer_type;
typedef typename ForeignFifoBuffer<T>::const_pointer_type const_pointer_type; using typename ForeignFifoBuffer<T>::const_pointer_type;
typedef typename ForeignFifoBuffer<T>::Range Range; using typename ForeignFifoBuffer<T>::Range;
explicit DynamicFifoBuffer(size_type _capacity) noexcept explicit DynamicFifoBuffer(size_type _capacity) noexcept
:ForeignFifoBuffer<T>(new T[_capacity], _capacity) {} :ForeignFifoBuffer<T>(new T[_capacity], _capacity) {}
......
/* /*
* Copyright (C) 2003-2017 Max Kellermann <max.kellermann@gmail.com> * Copyright 2003-2019 Max Kellermann <max.kellermann@gmail.com>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
...@@ -51,10 +51,10 @@ ...@@ -51,10 +51,10 @@
template<typename T> template<typename T>
class ForeignFifoBuffer { class ForeignFifoBuffer {
public: public:
typedef size_t size_type; using size_type = size_t;
typedef WritableBuffer<T> Range; using Range = WritableBuffer<T>;
typedef typename Range::pointer_type pointer_type; using pointer_type = typename Range::pointer_type;
typedef typename Range::const_pointer_type const_pointer_type; using const_pointer_type = typename Range::const_pointer_type;
protected: protected:
size_type head = 0, tail = 0, capacity; size_type head = 0, tail = 0, capacity;
......
/* /*
* Copyright (C) 2003-2017 Max Kellermann <max.kellermann@gmail.com> * Copyright 2003-2019 Max Kellermann <max.kellermann@gmail.com>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
...@@ -46,10 +46,8 @@ ...@@ -46,10 +46,8 @@
template<class T, size_t size> template<class T, size_t size>
class StaticFifoBuffer { class StaticFifoBuffer {
public: public:
typedef size_t size_type; using size_type = size_t;
using Range = WritableBuffer<T>;
public:
typedef WritableBuffer<T> Range;
protected: protected:
size_type head = 0, tail = 0; size_type head = 0, tail = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment