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
41dc36ba
Commit
41dc36ba
authored
Apr 03, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
client/List: add `noexcept`
parent
fe32db17
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
12 deletions
+13
-12
List.cxx
src/client/List.cxx
+3
-3
List.hxx
src/client/List.hxx
+10
-9
No files found.
src/client/List.cxx
View file @
41dc36ba
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
#include <assert.h>
#include <assert.h>
void
void
ClientList
::
Remove
(
Client
&
client
)
ClientList
::
Remove
(
Client
&
client
)
noexcept
{
{
assert
(
!
list
.
empty
());
assert
(
!
list
.
empty
());
...
@@ -31,13 +31,13 @@ ClientList::Remove(Client &client)
...
@@ -31,13 +31,13 @@ ClientList::Remove(Client &client)
}
}
void
void
ClientList
::
CloseAll
()
ClientList
::
CloseAll
()
noexcept
{
{
list
.
clear_and_dispose
(
DeleteDisposer
());
list
.
clear_and_dispose
(
DeleteDisposer
());
}
}
void
void
ClientList
::
IdleAdd
(
unsigned
flags
)
ClientList
::
IdleAdd
(
unsigned
flags
)
noexcept
{
{
assert
(
flags
!=
0
);
assert
(
flags
!=
0
);
...
...
src/client/List.hxx
View file @
41dc36ba
...
@@ -33,33 +33,34 @@ class ClientList {
...
@@ -33,33 +33,34 @@ class ClientList {
List
list
;
List
list
;
public
:
public
:
ClientList
(
unsigned
_max_size
)
explicit
ClientList
(
unsigned
_max_size
)
noexcept
:
max_size
(
_max_size
)
{}
:
max_size
(
_max_size
)
{}
~
ClientList
()
{
~
ClientList
()
noexcept
{
CloseAll
();
CloseAll
();
}
}
List
::
iterator
begin
()
{
List
::
iterator
begin
()
noexcept
{
return
list
.
begin
();
return
list
.
begin
();
}
}
List
::
iterator
end
()
{
List
::
iterator
end
()
noexcept
{
return
list
.
end
();
return
list
.
end
();
}
}
bool
IsFull
()
const
{
bool
IsFull
()
const
noexcept
{
return
list
.
size
()
>=
max_size
;
return
list
.
size
()
>=
max_size
;
}
}
void
Add
(
Client
&
client
)
{
void
Add
(
Client
&
client
)
noexcept
{
list
.
push_front
(
client
);
list
.
push_front
(
client
);
}
}
void
Remove
(
Client
&
client
);
void
Remove
(
Client
&
client
)
noexcept
;
void
CloseAll
();
void
CloseAll
()
noexcept
;
void
IdleAdd
(
unsigned
flags
);
void
IdleAdd
(
unsigned
flags
)
noexcept
;
};
};
#endif
#endif
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