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
d5efab49
Commit
d5efab49
authored
Jan 17, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src: Add inequality operator for StringRef
parent
919e9eee
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
src/template.h
src/template.h
+16
-0
src/template_test.cc
src/template_test.cc
+8
-0
No files found.
src/template.h
View file @
d5efab49
...
...
@@ -342,6 +342,22 @@ inline bool operator==(const char *lhs, const StringRef &rhs) {
return
rhs
==
lhs
;
}
inline
bool
operator
!=
(
const
StringRef
&
lhs
,
const
std
::
string
&
rhs
)
{
return
!
(
lhs
==
rhs
);
}
inline
bool
operator
!=
(
const
std
::
string
&
lhs
,
const
StringRef
&
rhs
)
{
return
!
(
rhs
==
lhs
);
}
inline
bool
operator
!=
(
const
StringRef
&
lhs
,
const
char
*
rhs
)
{
return
!
(
lhs
==
rhs
);
}
inline
bool
operator
!=
(
const
char
*
lhs
,
const
StringRef
&
rhs
)
{
return
!
(
rhs
==
lhs
);
}
inline
int
run_app
(
std
::
function
<
int
(
int
,
char
**
)
>
app
,
int
argc
,
char
**
argv
)
{
try
{
...
...
src/template_test.cc
View file @
d5efab49
...
...
@@ -87,6 +87,14 @@ void test_template_immutable_string(void) {
CU_ASSERT
(
"bravo"
==
from_lit
);
CU_ASSERT
(
5
==
from_lit
.
size
());
// equality
ImmutableString
eq
(
"delta"
);
CU_ASSERT
(
"delta1"
!=
eq
);
CU_ASSERT
(
"delt"
!=
eq
);
CU_ASSERT
(
eq
!=
"delta1"
);
CU_ASSERT
(
eq
!=
"delt"
);
}
void
test_template_string_ref
(
void
)
{
...
...
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