Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
c50f9bb9
Commit
c50f9bb9
authored
Sep 15, 2015
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Oops that last change broke everything due to stringification of Vector<char> becoming ambiguous.
parent
6f03c6a9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
string-test.c++
c++/src/kj/string-test.c++
+5
-0
vector.h
c++/src/kj/vector.h
+5
-0
No files found.
c++/src/kj/string-test.c++
View file @
c50f9bb9
...
...
@@ -22,6 +22,7 @@
#include "string.h"
#include <kj/compat/gtest.h>
#include <string>
#include "vector.h"
namespace
kj
{
namespace
_
{
// private
...
...
@@ -38,11 +39,15 @@ TEST(String, Str) {
char
buf
[
3
]
=
{
'f'
,
'o'
,
'o'
};
kj
::
ArrayPtr
<
char
>
a
=
buf
;
kj
::
ArrayPtr
<
const
char
>
ca
=
a
;
kj
::
Vector
<
char
>
v
;
v
.
addAll
(
a
);
EXPECT_EQ
(
"foo"
,
str
(
a
));
EXPECT_EQ
(
"foo"
,
str
(
ca
));
EXPECT_EQ
(
"foo"
,
str
(
v
));
EXPECT_EQ
(
"foo"
,
str
(
mv
(
a
)));
EXPECT_EQ
(
"foo"
,
str
(
mv
(
ca
)));
EXPECT_EQ
(
"foo"
,
str
(
mv
(
v
)));
}
TEST
(
String
,
StartsEndsWith
)
{
...
...
c++/src/kj/vector.h
View file @
c50f9bb9
...
...
@@ -119,6 +119,11 @@ private:
}
};
template
<
typename
T
>
inline
auto
KJ_STRINGIFY
(
const
Vector
<
T
>&
v
)
->
decltype
(
toCharSequence
(
v
.
asPtr
()))
{
return
toCharSequence
(
v
.
asPtr
());
}
}
// namespace kj
#endif // KJ_VECTOR_H_
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