Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
bdfe6c2c
Commit
bdfe6c2c
authored
Jul 23, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib/dbus/Values: use `using` instead of `typedef`
parent
5e1a2e2a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
Values.hxx
src/lib/dbus/Values.hxx
+15
-15
No files found.
src/lib/dbus/Values.hxx
View file @
bdfe6c2c
...
...
@@ -48,20 +48,20 @@ struct BasicValue {
const
T
&
value
;
explicit
constexpr
BasicValue
(
const
T
&
_value
)
noexcept
:
value
(
_value
)
{}
:
value
(
_value
)
{}
};
struct
String
:
BasicValue
<
const
char
*>
{
explicit
constexpr
String
(
const
char
*
const
&
_value
)
noexcept
:
BasicValue
(
_value
)
{}
:
BasicValue
(
_value
)
{}
};
struct
Boolean
{
typedef
BooleanTypeTraits
Traits
;
using
Traits
=
BooleanType
Traits
;
dbus_bool_t
value
;
explicit
constexpr
Boolean
(
bool
_value
)
noexcept
:
value
(
_value
)
{}
:
value
(
_value
)
{}
};
using
Uint32
=
BasicValue
<
dbus_uint32_t
>
;
...
...
@@ -69,21 +69,21 @@ using Uint64 = BasicValue<dbus_uint64_t>;
template
<
typename
T
,
template
<
typename
U
>
class
WrapTraits
>
struct
WrapValue
{
typedef
typename
T
::
Traits
Contained
Traits
;
typedef
WrapTraits
<
ContainedTraits
>
Traits
;
using
ContainedTraits
=
typename
T
::
Traits
;
using
Traits
=
WrapTraits
<
ContainedTraits
>
;
const
T
&
value
;
explicit
constexpr
WrapValue
(
const
T
&
_value
)
noexcept
:
value
(
_value
)
{}
:
value
(
_value
)
{}
};
template
<
typename
T
>
struct
WrapVariant
:
BasicValue
<
T
>
{
typedef
typename
T
::
Traits
Contained
Traits
;
typedef
VariantTypeTraits
Traits
;
using
ContainedTraits
=
typename
T
::
Traits
;
using
Traits
=
VariantType
Traits
;
explicit
constexpr
WrapVariant
(
const
T
&
_value
)
noexcept
:
BasicValue
<
T
>
(
_value
)
{}
:
BasicValue
<
T
>
(
_value
)
{}
};
template
<
typename
T
>
...
...
@@ -93,13 +93,13 @@ static WrapVariant<T> Variant(const T &_value) noexcept {
template
<
typename
T
>
struct
WrapFixedArray
{
typedef
TypeTraits
<
T
>
ContainedTraits
;
typedef
ArrayTypeTraits
<
ContainedTraits
>
Traits
;
using
ContainedTraits
=
TypeTraits
<
T
>
;
using
Traits
=
ArrayTypeTraits
<
ContainedTraits
>
;
ConstBuffer
<
T
>
value
;
explicit
constexpr
WrapFixedArray
(
const
T
*
_data
,
size_t
_size
)
noexcept
:
value
(
_data
,
_size
)
{}
:
value
(
_data
,
_size
)
{}
};
template
<
typename
T
>
...
...
@@ -110,12 +110,12 @@ static WrapFixedArray<T> FixedArray(const T *_data,
template
<
typename
...
T
>
struct
WrapStruct
{
typedef
StructTypeTraits
<
T
...
>
Traits
;
using
Traits
=
StructTypeTraits
<
T
...
>
;
std
::
tuple
<
const
T
&
...
>
values
;
explicit
constexpr
WrapStruct
(
const
T
&
...
_values
)
noexcept
:
values
(
_values
...)
{}
:
values
(
_values
...)
{}
};
template
<
typename
...
T
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment