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
bca5d79f
Commit
bca5d79f
authored
Jan 14, 2021
by
Max Kellermann
Committed by
Max Kellermann
Mar 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util/AllocatedString: add const_pointer constructor
parent
6e1c8edf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
AllocatedString.hxx
src/util/AllocatedString.hxx
+10
-1
No files found.
src/util/AllocatedString.hxx
View file @
bca5d79f
...
...
@@ -65,7 +65,10 @@ public:
BasicAllocatedString
(
std
::
nullptr_t
n
)
noexcept
:
value
(
n
)
{}
explicit
BasicAllocatedString
(
string_view
src
)
noexcept
explicit
BasicAllocatedString
(
string_view
src
)
:
value
(
Duplicate
(
src
))
{}
explicit
BasicAllocatedString
(
const_pointer
src
)
:
value
(
Duplicate
(
src
))
{}
BasicAllocatedString
(
BasicAllocatedString
&&
src
)
noexcept
...
...
@@ -144,6 +147,12 @@ private:
*
std
::
copy_n
(
src
.
data
(),
src
.
size
(),
p
)
=
SENTINEL
;
return
p
;
}
static
pointer
Duplicate
(
const_pointer
src
)
{
return
src
!=
nullptr
?
Duplicate
(
std
::
string_view
(
src
))
:
nullptr
;
}
};
class
AllocatedString
:
public
BasicAllocatedString
<
char
>
{
...
...
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