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
f04a2457
Commit
f04a2457
authored
Apr 03, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util/AllocatedString: add `noexcept`
parent
a8687fb7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
16 deletions
+17
-16
AllocatedString.hxx
src/util/AllocatedString.hxx
+17
-16
No files found.
src/util/AllocatedString.hxx
View file @
f04a2457
...
...
@@ -55,24 +55,25 @@ public:
private
:
pointer
value
;
explicit
AllocatedString
(
pointer
_value
)
explicit
AllocatedString
(
pointer
_value
)
noexcept
:
value
(
_value
)
{}
public
:
AllocatedString
(
std
::
nullptr_t
n
)
:
value
(
n
)
{}
AllocatedString
(
std
::
nullptr_t
n
)
noexcept
:
value
(
n
)
{}
AllocatedString
(
AllocatedString
&&
src
)
AllocatedString
(
AllocatedString
&&
src
)
noexcept
:
value
(
src
.
Steal
())
{}
~
AllocatedString
()
{
~
AllocatedString
()
noexcept
{
delete
[]
value
;
}
static
AllocatedString
Donate
(
pointer
value
)
{
static
AllocatedString
Donate
(
pointer
value
)
noexcept
{
return
AllocatedString
(
value
);
}
static
AllocatedString
Null
()
{
static
AllocatedString
Null
()
noexcept
{
return
nullptr
;
}
...
...
@@ -98,44 +99,44 @@ public:
return
Donate
(
p
);
}
AllocatedString
&
operator
=
(
AllocatedString
&&
src
)
{
AllocatedString
&
operator
=
(
AllocatedString
&&
src
)
noexcept
{
std
::
swap
(
value
,
src
.
value
);
return
*
this
;
}
constexpr
bool
operator
==
(
std
::
nullptr_t
)
const
{
constexpr
bool
operator
==
(
std
::
nullptr_t
)
const
noexcept
{
return
value
==
nullptr
;
}
constexpr
bool
operator
!=
(
std
::
nullptr_t
)
const
{
constexpr
bool
operator
!=
(
std
::
nullptr_t
)
const
noexcept
{
return
value
!=
nullptr
;
}
constexpr
bool
IsNull
()
const
{
constexpr
bool
IsNull
()
const
noexcept
{
return
value
==
nullptr
;
}
constexpr
const_pointer
c_str
()
const
{
constexpr
const_pointer
c_str
()
const
noexcept
{
return
value
;
}
bool
empty
()
const
{
bool
empty
()
const
noexcept
{
return
*
value
==
SENTINEL
;
}
constexpr
pointer
data
()
const
{
constexpr
pointer
data
()
const
noexcept
{
return
value
;
}
reference
operator
[](
size_type
i
)
{
reference
operator
[](
size_type
i
)
noexcept
{
return
value
[
i
];
}
const
reference
operator
[](
size_type
i
)
const
{
const
reference
operator
[](
size_type
i
)
const
noexcept
{
return
value
[
i
];
}
pointer
Steal
()
{
pointer
Steal
()
noexcept
{
return
std
::
exchange
(
value
,
nullptr
);
}
...
...
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