Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
9f0f5c60
Commit
9f0f5c60
authored
Jan 17, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ImmutableString: Remove std::unique_ptr<char[]> ctor overload
parent
09de3320
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
11 deletions
+3
-11
src/template.h
src/template.h
+0
-4
src/template_test.cc
src/template_test.cc
+3
-7
No files found.
src/template.h
View file @
9f0f5c60
...
...
@@ -232,10 +232,6 @@ public:
ImmutableString
(
const
char
*
s
,
size_t
slen
)
:
len
(
slen
),
base
(
copystr
(
s
,
len
))
{}
ImmutableString
(
const
char
*
s
)
:
len
(
strlen
(
s
)),
base
(
copystr
(
s
,
len
))
{}
ImmutableString
(
std
::
unique_ptr
<
char
[]
>
s
)
:
len
(
strlen
(
s
.
get
())),
base
(
len
==
0
?
""
:
s
.
release
())
{}
ImmutableString
(
std
::
unique_ptr
<
char
[]
>
s
,
size_t
slen
)
:
len
(
slen
),
base
(
len
==
0
?
""
:
s
.
release
())
{}
ImmutableString
(
const
std
::
string
&
s
)
:
len
(
s
.
size
()),
base
(
copystr
(
s
.
c_str
(),
s
.
size
()))
{}
template
<
typename
InputIt
>
...
...
src/template_test.cc
View file @
9f0f5c60
...
...
@@ -50,20 +50,16 @@ void test_template_immutable_string(void) {
CU_ASSERT
(
std
::
string
(
"alpha"
)
==
from_cstr
);
CU_ASSERT
(
from_cstr
==
std
::
string
(
"alpha"
));
ImmutableString
from_uniq
(
strcopy
(
"charlie"
));
CU_ASSERT
(
"charlie"
==
from_uniq
);
CU_ASSERT
(
7
==
from_uniq
.
size
());
// copy constructor
ImmutableString
copy
=
from_uniq
;
ImmutableString
src
(
"charlie"
);
ImmutableString
copy
=
src
;
CU_ASSERT
(
"charlie"
==
copy
);
CU_ASSERT
(
7
==
copy
.
size
());
// copy assignment
ImmutableString
copy2
;
copy2
=
from_uniq
;
copy2
=
src
;
CU_ASSERT
(
"charlie"
==
copy2
);
CU_ASSERT
(
7
==
copy2
.
size
());
...
...
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