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
e7bebb00
Commit
e7bebb00
authored
May 17, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net/AllocatedSocketAddress: add more "noexcept"
parent
7b05df8d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
AllocatedSocketAddress.cxx
src/net/AllocatedSocketAddress.cxx
+1
-1
AllocatedSocketAddress.hxx
src/net/AllocatedSocketAddress.hxx
+15
-15
No files found.
src/net/AllocatedSocketAddress.cxx
View file @
e7bebb00
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
#endif
#endif
AllocatedSocketAddress
&
AllocatedSocketAddress
&
AllocatedSocketAddress
::
operator
=
(
SocketAddress
src
)
AllocatedSocketAddress
::
operator
=
(
SocketAddress
src
)
noexcept
{
{
if
(
src
.
IsNull
())
{
if
(
src
.
IsNull
())
{
Clear
();
Clear
();
...
...
src/net/AllocatedSocketAddress.hxx
View file @
e7bebb00
...
@@ -55,13 +55,13 @@ private:
...
@@ -55,13 +55,13 @@ private:
public
:
public
:
AllocatedSocketAddress
()
=
default
;
AllocatedSocketAddress
()
=
default
;
explicit
AllocatedSocketAddress
(
SocketAddress
src
)
{
explicit
AllocatedSocketAddress
(
SocketAddress
src
)
noexcept
{
*
this
=
src
;
*
this
=
src
;
}
}
AllocatedSocketAddress
(
const
AllocatedSocketAddress
&
)
=
delete
;
AllocatedSocketAddress
(
const
AllocatedSocketAddress
&
)
=
delete
;
AllocatedSocketAddress
(
AllocatedSocketAddress
&&
src
)
AllocatedSocketAddress
(
AllocatedSocketAddress
&&
src
)
noexcept
:
address
(
src
.
address
),
size
(
src
.
size
)
{
:
address
(
src
.
address
),
size
(
src
.
size
)
{
src
.
address
=
nullptr
;
src
.
address
=
nullptr
;
src
.
size
=
0
;
src
.
size
=
0
;
...
@@ -71,51 +71,51 @@ public:
...
@@ -71,51 +71,51 @@ public:
free
(
address
);
free
(
address
);
}
}
AllocatedSocketAddress
&
operator
=
(
SocketAddress
src
);
AllocatedSocketAddress
&
operator
=
(
SocketAddress
src
)
noexcept
;
AllocatedSocketAddress
&
operator
=
(
const
AllocatedSocketAddress
&
)
=
delete
;
AllocatedSocketAddress
&
operator
=
(
const
AllocatedSocketAddress
&
)
=
delete
;
AllocatedSocketAddress
&
operator
=
(
AllocatedSocketAddress
&&
src
)
{
AllocatedSocketAddress
&
operator
=
(
AllocatedSocketAddress
&&
src
)
noexcept
{
std
::
swap
(
address
,
src
.
address
);
std
::
swap
(
address
,
src
.
address
);
std
::
swap
(
size
,
src
.
size
);
std
::
swap
(
size
,
src
.
size
);
return
*
this
;
return
*
this
;
}
}
gcc_pure
gcc_pure
bool
operator
==
(
SocketAddress
other
)
const
{
bool
operator
==
(
SocketAddress
other
)
const
noexcept
{
return
(
SocketAddress
)
*
this
==
other
;
return
(
SocketAddress
)
*
this
==
other
;
}
}
bool
operator
!=
(
SocketAddress
&
other
)
const
{
bool
operator
!=
(
SocketAddress
&
other
)
const
noexcept
{
return
!
(
*
this
==
other
);
return
!
(
*
this
==
other
);
}
}
gcc_const
gcc_const
static
AllocatedSocketAddress
Null
()
{
static
AllocatedSocketAddress
Null
()
noexcept
{
return
AllocatedSocketAddress
(
nullptr
,
0
);
return
AllocatedSocketAddress
(
nullptr
,
0
);
}
}
bool
IsNull
()
const
{
bool
IsNull
()
const
noexcept
{
return
address
==
nullptr
;
return
address
==
nullptr
;
}
}
size_type
GetSize
()
const
{
size_type
GetSize
()
const
noexcept
{
return
size
;
return
size
;
}
}
const
struct
sockaddr
*
GetAddress
()
const
{
const
struct
sockaddr
*
GetAddress
()
const
noexcept
{
return
address
;
return
address
;
}
}
operator
SocketAddress
()
const
{
operator
SocketAddress
()
const
noexcept
{
return
SocketAddress
(
address
,
size
);
return
SocketAddress
(
address
,
size
);
}
}
operator
const
struct
sockaddr
*
()
const
{
operator
const
struct
sockaddr
*
()
const
noexcept
{
return
address
;
return
address
;
}
}
int
GetFamily
()
const
{
int
GetFamily
()
const
noexcept
{
return
address
->
sa_family
;
return
address
->
sa_family
;
}
}
...
@@ -123,11 +123,11 @@ public:
...
@@ -123,11 +123,11 @@ public:
* Does the object have a well-defined address? Check !IsNull()
* Does the object have a well-defined address? Check !IsNull()
* before calling this method.
* before calling this method.
*/
*/
bool
IsDefined
()
const
{
bool
IsDefined
()
const
noexcept
{
return
GetFamily
()
!=
AF_UNSPEC
;
return
GetFamily
()
!=
AF_UNSPEC
;
}
}
void
Clear
()
{
void
Clear
()
noexcept
{
free
(
address
);
free
(
address
);
address
=
nullptr
;
address
=
nullptr
;
size
=
0
;
size
=
0
;
...
...
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