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
eef5b582
Commit
eef5b582
authored
Jan 20, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tag/Tag: add "noexcept"
parent
1de68b72
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
19 deletions
+19
-19
Tag.cxx
src/tag/Tag.cxx
+2
-2
Tag.hxx
src/tag/Tag.hxx
+16
-16
test_queue_priority.cxx
test/test_queue_priority.cxx
+1
-1
No files found.
src/tag/Tag.cxx
View file @
eef5b582
...
...
@@ -40,7 +40,7 @@ Tag::Clear() noexcept
num_items
=
0
;
}
Tag
::
Tag
(
const
Tag
&
other
)
Tag
::
Tag
(
const
Tag
&
other
)
noexcept
:
duration
(
other
.
duration
),
has_playlist
(
other
.
has_playlist
),
num_items
(
other
.
num_items
),
items
(
nullptr
)
...
...
@@ -64,7 +64,7 @@ Tag::Merge(const Tag &base, const Tag &add) noexcept
}
std
::
unique_ptr
<
Tag
>
Tag
::
Merge
(
std
::
unique_ptr
<
Tag
>
base
,
std
::
unique_ptr
<
Tag
>
add
)
Tag
::
Merge
(
std
::
unique_ptr
<
Tag
>
base
,
std
::
unique_ptr
<
Tag
>
add
)
noexcept
{
if
(
add
==
nullptr
)
return
base
;
...
...
src/tag/Tag.hxx
View file @
eef5b582
...
...
@@ -56,9 +56,9 @@ struct Tag {
*/
Tag
()
=
default
;
Tag
(
const
Tag
&
other
);
Tag
(
const
Tag
&
other
)
noexcept
;
Tag
(
Tag
&&
other
)
Tag
(
Tag
&&
other
)
noexcept
:
duration
(
other
.
duration
),
has_playlist
(
other
.
has_playlist
),
num_items
(
other
.
num_items
),
items
(
other
.
items
)
{
other
.
items
=
nullptr
;
...
...
@@ -68,13 +68,13 @@ struct Tag {
/**
* Free the tag object and all its items.
*/
~
Tag
()
{
~
Tag
()
noexcept
{
Clear
();
}
Tag
&
operator
=
(
const
Tag
&
other
)
=
delete
;
Tag
&
operator
=
(
Tag
&&
other
)
{
Tag
&
operator
=
(
Tag
&&
other
)
noexcept
{
duration
=
other
.
duration
;
has_playlist
=
other
.
has_playlist
;
MoveItemsFrom
(
std
::
move
(
other
));
...
...
@@ -126,7 +126,7 @@ struct Tag {
* @return a newly allocated tag
*/
static
std
::
unique_ptr
<
Tag
>
Merge
(
std
::
unique_ptr
<
Tag
>
base
,
std
::
unique_ptr
<
Tag
>
add
);
std
::
unique_ptr
<
Tag
>
add
)
noexcept
;
/**
* Returns the first value of the specified tag type, or
...
...
@@ -155,52 +155,52 @@ struct Tag {
friend
struct
Tag
;
const
TagItem
*
const
*
cursor
;
constexpr
const_iterator
(
const
TagItem
*
const
*
_cursor
)
constexpr
const_iterator
(
const
TagItem
*
const
*
_cursor
)
noexcept
:
cursor
(
_cursor
)
{}
public
:
constexpr
const
TagItem
&
operator
*
()
const
{
constexpr
const
TagItem
&
operator
*
()
const
noexcept
{
return
**
cursor
;
}
constexpr
const
TagItem
*
operator
->
()
const
{
constexpr
const
TagItem
*
operator
->
()
const
noexcept
{
return
*
cursor
;
}
const_iterator
&
operator
++
()
{
const_iterator
&
operator
++
()
noexcept
{
++
cursor
;
return
*
this
;
}
const_iterator
operator
++
(
int
)
{
const_iterator
operator
++
(
int
)
noexcept
{
auto
result
=
cursor
++
;
return
const_iterator
{
result
};
}
const_iterator
&
operator
--
()
{
const_iterator
&
operator
--
()
noexcept
{
--
cursor
;
return
*
this
;
}
const_iterator
operator
--
(
int
)
{
const_iterator
operator
--
(
int
)
noexcept
{
auto
result
=
cursor
--
;
return
const_iterator
{
result
};
}
constexpr
bool
operator
==
(
const_iterator
other
)
const
{
constexpr
bool
operator
==
(
const_iterator
other
)
const
noexcept
{
return
cursor
==
other
.
cursor
;
}
constexpr
bool
operator
!=
(
const_iterator
other
)
const
{
constexpr
bool
operator
!=
(
const_iterator
other
)
const
noexcept
{
return
cursor
!=
other
.
cursor
;
}
};
const_iterator
begin
()
const
{
const_iterator
begin
()
const
noexcept
{
return
const_iterator
{
items
};
}
const_iterator
end
()
const
{
const_iterator
end
()
const
noexcept
{
return
const_iterator
{
items
+
num_items
};
}
};
...
...
test/test_queue_priority.cxx
View file @
eef5b582
...
...
@@ -8,7 +8,7 @@
#include <cppunit/ui/text/TestRunner.h>
#include <cppunit/extensions/HelperMacros.h>
Tag
::
Tag
(
const
Tag
&
)
{}
Tag
::
Tag
(
const
Tag
&
)
noexcept
{}
void
Tag
::
Clear
()
noexcept
{}
static
void
...
...
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