diff --git a/src/lib/nfs/Cancellable.hxx b/src/lib/nfs/Cancellable.hxx index 9e3ab4087..d3dd9f914 100644 --- a/src/lib/nfs/Cancellable.hxx +++ b/src/lib/nfs/Cancellable.hxx @@ -33,14 +33,14 @@ class CancellablePointer : public boost::intrusive::list_base_hook> { public: typedef T *pointer; - typedef T &reference_type; - typedef const T &const_reference_type; + typedef T &reference; + typedef const T &const_reference; private: pointer p; public: - explicit CancellablePointer(reference_type _p):p(&_p) {} + explicit CancellablePointer(reference _p):p(&_p) {} CancellablePointer(const CancellablePointer &) = delete; @@ -54,13 +54,13 @@ public: p = nullptr; } - reference_type Get() { + reference Get() { assert(p != nullptr); return *p; } - constexpr bool Is(const_reference_type other) const { + constexpr bool Is(const_reference other) const { return p == &other; } }; @@ -68,8 +68,8 @@ public: template> class CancellableList { public: - typedef typename CT::reference_type reference_type; - typedef typename CT::const_reference_type const_reference_type; + typedef typename CT::reference reference; + typedef typename CT::const_reference const_reference; private: typedef boost::intrusive::list - CT &Add(reference_type p, Args&&... args) { + CT &Add(reference p, Args&&... args) { assert(Find(p) == list.end()); CT *c = new CT(p, std::forward(args)...); @@ -144,14 +144,14 @@ public: delete &ct; } - void Cancel(reference_type p) { + void Cancel(reference p) { auto i = Find(p); assert(i != list.end()); i->Cancel(); } - CT &Get(reference_type p) noexcept { + CT &Get(reference p) noexcept { auto i = Find(p); assert(i != list.end()); diff --git a/src/util/AllocatedArray.hxx b/src/util/AllocatedArray.hxx index ead3a49b3..f05460d24 100644 --- a/src/util/AllocatedArray.hxx +++ b/src/util/AllocatedArray.hxx @@ -47,8 +47,8 @@ class AllocatedArray { public: typedef typename Buffer::size_type size_type; - typedef typename Buffer::reference_type reference_type; - typedef typename Buffer::const_reference_type const_reference_type; + typedef typename Buffer::reference reference; + typedef typename Buffer::const_reference const_reference; typedef typename Buffer::iterator iterator; typedef typename Buffer::const_iterator const_iterator; @@ -147,33 +147,33 @@ public: return buffer.size; } - reference_type front() noexcept { + reference front() noexcept { return buffer.front(); } - const_reference_type front() const noexcept { + const_reference front() const noexcept { return buffer.front(); } - reference_type back() noexcept { + reference back() noexcept { return buffer.back(); } - const_reference_type back() const noexcept { + const_reference back() const noexcept { return buffer.back(); } /** * Returns one element. No bounds checking. */ - reference_type operator[](size_type i) noexcept { + reference operator[](size_type i) noexcept { return buffer[i]; } /** * Returns one constant element. No bounds checking. */ - const_reference_type operator[](size_type i) const noexcept { + const_reference operator[](size_type i) const noexcept { return buffer[i]; } diff --git a/src/util/AllocatedString.hxx b/src/util/AllocatedString.hxx index f575aa0a7..523ab23a4 100644 --- a/src/util/AllocatedString.hxx +++ b/src/util/AllocatedString.hxx @@ -44,8 +44,8 @@ template class AllocatedString { public: typedef typename StringPointer::value_type value_type; - typedef typename StringPointer::reference_type reference_type; - typedef typename StringPointer::const_reference_type const_reference_type; + typedef typename StringPointer::reference reference; + typedef typename StringPointer::const_reference const_reference; typedef typename StringPointer::pointer pointer; typedef typename StringPointer::const_pointer const_pointer; typedef std::size_t size_type; @@ -127,11 +127,11 @@ public: return value; } - reference_type operator[](size_type i) { + reference operator[](size_type i) { return value[i]; } - const reference_type operator[](size_type i) const { + const reference operator[](size_type i) const { return value[i]; } diff --git a/src/util/ConstBuffer.hxx b/src/util/ConstBuffer.hxx index 0009270fd..b60ced4bc 100644 --- a/src/util/ConstBuffer.hxx +++ b/src/util/ConstBuffer.hxx @@ -93,8 +93,8 @@ template struct ConstBuffer { typedef std::size_t size_type; typedef T value_type; - typedef const T &reference_type; - typedef reference_type const_reference_type; + typedef const T &reference; + typedef reference const_reference; typedef const T *pointer; typedef pointer const_pointer; typedef pointer iterator; @@ -198,7 +198,7 @@ struct ConstBuffer { #ifdef NDEBUG constexpr #endif - reference_type operator[](size_type i) const noexcept { + reference operator[](size_type i) const noexcept { #ifndef NDEBUG assert(i < size); #endif @@ -213,7 +213,7 @@ struct ConstBuffer { #ifdef NDEBUG constexpr #endif - reference_type front() const noexcept { + reference front() const noexcept { #ifndef NDEBUG assert(!empty()); #endif @@ -227,7 +227,7 @@ struct ConstBuffer { #ifdef NDEBUG constexpr #endif - reference_type back() const noexcept { + reference back() const noexcept { #ifndef NDEBUG assert(!empty()); #endif @@ -263,8 +263,8 @@ struct ConstBuffer { * Remove the first element and return a reference to it. * Buffer must not be empty. */ - reference_type shift() noexcept { - reference_type result = front(); + reference shift() noexcept { + reference result = front(); pop_front(); return result; } diff --git a/src/util/HugeAllocator.hxx b/src/util/HugeAllocator.hxx index 93c06d5f9..63ecc43eb 100644 --- a/src/util/HugeAllocator.hxx +++ b/src/util/HugeAllocator.hxx @@ -142,8 +142,8 @@ class HugeArray { public: typedef typename Buffer::size_type size_type; typedef typename Buffer::value_type value_type; - typedef typename Buffer::reference_type reference; - typedef typename Buffer::const_reference_type const_reference; + typedef typename Buffer::reference reference; + typedef typename Buffer::const_reference const_reference; typedef typename Buffer::iterator iterator; typedef typename Buffer::const_iterator const_iterator; diff --git a/src/util/StringPointer.hxx b/src/util/StringPointer.hxx index 9d44a1398..2974f7f5a 100644 --- a/src/util/StringPointer.hxx +++ b/src/util/StringPointer.hxx @@ -37,8 +37,8 @@ template class StringPointer { public: typedef T value_type; - typedef T &reference_type; - typedef const T &const_reference_type; + typedef T &reference; + typedef const T &const_reference; typedef T *pointer; typedef const T *const_pointer; diff --git a/src/util/WritableBuffer.hxx b/src/util/WritableBuffer.hxx index 37c4b9623..c6a579fc3 100644 --- a/src/util/WritableBuffer.hxx +++ b/src/util/WritableBuffer.hxx @@ -92,8 +92,8 @@ template struct WritableBuffer { typedef std::size_t size_type; typedef T value_type; - typedef T &reference_type; - typedef const T &const_reference_type; + typedef T &reference; + typedef const T &const_reference; typedef T *pointer; typedef const T *const_pointer; typedef pointer iterator; @@ -191,7 +191,7 @@ struct WritableBuffer { #ifdef NDEBUG constexpr #endif - reference_type operator[](size_type i) const noexcept { + reference operator[](size_type i) const noexcept { #ifndef NDEBUG assert(i < size); #endif @@ -206,7 +206,7 @@ struct WritableBuffer { #ifdef NDEBUG constexpr #endif - reference_type front() const noexcept { + reference front() const noexcept { #ifndef NDEBUG assert(!empty()); #endif @@ -220,7 +220,7 @@ struct WritableBuffer { #ifdef NDEBUG constexpr #endif - reference_type back() const noexcept { + reference back() const noexcept { #ifndef NDEBUG assert(!empty()); #endif @@ -252,8 +252,8 @@ struct WritableBuffer { * Remove the first element and return a reference to it. * Buffer must not be empty. */ - reference_type shift() noexcept { - reference_type result = front(); + reference shift() noexcept { + reference result = front(); pop_front(); return result; }