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
c629ac71
Commit
c629ac71
authored
May 17, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net/SocketAddress: add more "noexcept"
parent
0195d559
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
SocketAddress.cxx
src/net/SocketAddress.cxx
+1
-1
SocketAddress.hxx
src/net/SocketAddress.hxx
+10
-9
No files found.
src/net/SocketAddress.cxx
View file @
c629ac71
...
...
@@ -49,7 +49,7 @@ SocketAddress::operator==(SocketAddress other) const noexcept
#ifdef HAVE_TCP
unsigned
SocketAddress
::
GetPort
()
const
SocketAddress
::
GetPort
()
const
noexcept
{
if
(
IsNull
())
return
0
;
...
...
src/net/SocketAddress.hxx
View file @
c629ac71
...
...
@@ -59,29 +59,30 @@ private:
public
:
SocketAddress
()
=
default
;
constexpr
SocketAddress
(
std
::
nullptr_t
)
:
address
(
nullptr
),
size
(
0
)
{}
constexpr
SocketAddress
(
std
::
nullptr_t
)
noexcept
:
address
(
nullptr
),
size
(
0
)
{}
constexpr
SocketAddress
(
const
struct
sockaddr
*
_address
,
size_type
_size
)
size_type
_size
)
noexcept
:
address
(
_address
),
size
(
_size
)
{}
static
constexpr
SocketAddress
Null
()
{
static
constexpr
SocketAddress
Null
()
noexcept
{
return
nullptr
;
}
constexpr
bool
IsNull
()
const
{
constexpr
bool
IsNull
()
const
noexcept
{
return
address
==
nullptr
;
}
const
struct
sockaddr
*
GetAddress
()
const
{
const
struct
sockaddr
*
GetAddress
()
const
noexcept
{
return
address
;
}
constexpr
size_type
GetSize
()
const
{
constexpr
size_type
GetSize
()
const
noexcept
{
return
size
;
}
constexpr
int
GetFamily
()
const
{
constexpr
int
GetFamily
()
const
noexcept
{
return
address
->
sa_family
;
}
...
...
@@ -89,7 +90,7 @@ public:
* Does the object have a well-defined address? Check !IsNull()
* before calling this method.
*/
bool
IsDefined
()
const
{
bool
IsDefined
()
const
noexcept
{
return
GetFamily
()
!=
AF_UNSPEC
;
}
...
...
@@ -98,7 +99,7 @@ public:
* Extract the port number. Returns 0 if not applicable.
*/
gcc_pure
unsigned
GetPort
()
const
;
unsigned
GetPort
()
const
noexcept
;
#endif
gcc_pure
...
...
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