Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pistache
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
pistache
Commits
ce08beed
Commit
ce08beed
authored
Jan 25, 2019
by
Wang Boyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move global type alias size_type inside string_view
parent
12c07ba5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
include/pistache/string_view.h
include/pistache/string_view.h
+6
-6
No files found.
include/pistache/string_view.h
View file @
ce08beed
...
...
@@ -25,15 +25,12 @@
#include <stdexcept>
#include <cstring>
using
size_type
=
std
::
size_t
;
namespace
std
{
class
string_view
{
private:
const
char
*
data_
;
size_type
size_
;
public:
using
size_type
=
std
::
size_t
;
static
constexpr
size_type
npos
=
size_type
(
-
1
);
constexpr
string_view
()
noexcept
:
data_
(
nullptr
),
size_
(
0
)
{
}
...
...
@@ -157,6 +154,9 @@ namespace std {
constexpr
bool
empty
()
const
noexcept
{
return
size_
==
0
;
}
private:
const
char
*
data_
;
size_type
size_
;
};
template
<
>
...
...
@@ -200,7 +200,7 @@ namespace std {
}
public:
size_type
s
tring_view
::
s
ize_type
operator
()(
const
string_view
&
str
)
const
{
const
size_t
len
=
str
.
length
();
const
uint8_t
*
data
=
reinterpret_cast
<
const
uint8_t
*>
(
str
.
data
());
...
...
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