summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2020-03-13 19:32:51 +0100
committerMax Kellermann <max@musicpd.org>2020-03-13 19:43:23 +0100
commit58c7ec07a49f19ce8bf04df805c6f93b783d22e6 (patch)
treea8245f366303d713ea43e8c9116ea5dc074af0f2
parent3796247d6d904f8d980c64e35bacbf6f05459cee (diff)
fs: use `using` instead of `typedef`
-rw-r--r--src/fs/AllocatedPath.hxx8
-rw-r--r--src/fs/NarrowPath.hxx6
-rw-r--r--src/fs/Path.hxx2
-rw-r--r--src/fs/Traits.hxx24
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<value_type> 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<value_type>;
+ 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 = '/';