From 58c7ec07a49f19ce8bf04df805c6f93b783d22e6 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 13 Mar 2020 19:32:51 +0100 Subject: [PATCH] fs: use `using` instead of `typedef` --- src/fs/AllocatedPath.hxx | 8 ++++---- src/fs/NarrowPath.hxx | 6 +++--- src/fs/Path.hxx | 2 +- src/fs/Traits.hxx | 24 ++++++++++++------------ 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/fs/AllocatedPath.hxx b/src/fs/AllocatedPath.hxx index 1d5eb0720..09e805dfe 100644 --- a/src/fs/AllocatedPath.hxx +++ b/src/fs/AllocatedPath.hxx @@ -36,10 +36,10 @@ */ class AllocatedPath { using Traits = PathTraitsFS; - typedef Traits::string string; - typedef Traits::value_type value_type; - typedef Traits::pointer pointer; - typedef Traits::const_pointer const_pointer; + using string = Traits::string; + using value_type = Traits::value_type; + using pointer = Traits::pointer; + using const_pointer = Traits::const_pointer; string value; diff --git a/src/fs/NarrowPath.hxx b/src/fs/NarrowPath.hxx index e93842bfa..9ac5d926b 100644 --- a/src/fs/NarrowPath.hxx +++ b/src/fs/NarrowPath.hxx @@ -37,11 +37,11 @@ */ class NarrowPath { #ifdef _UNICODE - typedef AllocatedString<> Value; + using Value = AllocatedString<>; #else - typedef StringPointer<> Value; + using Value = StringPointer<>; #endif - typedef typename Value::const_pointer const_pointer; + using const_pointer = typename Value::const_pointer; Value value; diff --git a/src/fs/Path.hxx b/src/fs/Path.hxx index b8d5bb3e6..e41345c4b 100644 --- a/src/fs/Path.hxx +++ b/src/fs/Path.hxx @@ -36,7 +36,7 @@ class AllocatedPath; */ class Path : public PathTraitsFS::Pointer { using Traits = PathTraitsFS; - typedef Traits::Pointer Base; + using Base = Traits::Pointer; constexpr Path(const_pointer _value) noexcept:Base(_value) {} diff --git a/src/fs/Traits.hxx b/src/fs/Traits.hxx index 547ad64ff..a6a99634e 100644 --- a/src/fs/Traits.hxx +++ b/src/fs/Traits.hxx @@ -43,15 +43,15 @@ */ struct PathTraitsFS { #ifdef _WIN32 - typedef std::wstring string; + using string = std::wstring; #else - typedef std::string string; + using string = std::string; #endif - typedef string::traits_type char_traits; - typedef char_traits::char_type value_type; - typedef StringPointer Pointer; - typedef Pointer::pointer pointer; - typedef Pointer::const_pointer const_pointer; + using char_traits = string::traits_type; + using value_type = char_traits::char_type; + using Pointer = StringPointer; + using pointer = Pointer::pointer; + using const_pointer = Pointer::const_pointer; #ifdef _WIN32 static constexpr value_type SEPARATOR = '\\'; @@ -176,11 +176,11 @@ struct PathTraitsFS { * This class describes the nature of a MPD internal filesystem path. */ struct PathTraitsUTF8 { - typedef std::string string; - typedef string::traits_type char_traits; - typedef char_traits::char_type value_type; - typedef value_type *pointer; - typedef const value_type *const_pointer; + using string = std::string; + using char_traits = string::traits_type; + using value_type = char_traits::char_type; + using pointer = value_type *; + using const_pointer = const value_type *; static constexpr value_type SEPARATOR = '/';