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
a4019cb6
Commit
a4019cb6
authored
Aug 07, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util/StringBuffer: use std::array::const_iterator
parent
d29bdf3e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
StringBuffer.hxx
src/util/StringBuffer.hxx
+7
-5
No files found.
src/util/StringBuffer.hxx
View file @
a4019cb6
...
@@ -42,15 +42,17 @@ public:
...
@@ -42,15 +42,17 @@ public:
typedef
T
&
reference
;
typedef
T
&
reference
;
typedef
T
*
pointer
;
typedef
T
*
pointer
;
typedef
const
T
*
const_pointer
;
typedef
const
T
*
const_pointer
;
typedef
const_pointer
const_iterator
;
typedef
size_t
size_type
;
typedef
size_t
size_type
;
static
constexpr
value_type
SENTINEL
=
'\0'
;
static
constexpr
value_type
SENTINEL
=
'\0'
;
protected
:
protected
:
std
::
array
<
value_type
,
CAPACITY
>
the_data
;
typedef
std
::
array
<
value_type
,
CAPACITY
>
Array
;
Array
the_data
;
public
:
public
:
typedef
typename
Array
::
const_iterator
const_iterator
;
constexpr
size_type
capacity
()
const
{
constexpr
size_type
capacity
()
const
{
return
CAPACITY
;
return
CAPACITY
;
}
}
...
@@ -72,7 +74,7 @@ public:
...
@@ -72,7 +74,7 @@ public:
}
}
constexpr
value_type
front
()
const
{
constexpr
value_type
front
()
const
{
return
c_str
()[
0
]
;
return
the_data
.
front
()
;
}
}
/**
/**
...
@@ -90,11 +92,11 @@ public:
...
@@ -90,11 +92,11 @@ public:
}
}
constexpr
const_iterator
begin
()
const
{
constexpr
const_iterator
begin
()
const
{
return
the_data
;
return
the_data
.
begin
()
;
}
}
constexpr
const_iterator
end
()
const
{
constexpr
const_iterator
end
()
const
{
return
the_data
+
capacity
();
return
the_data
.
end
();
}
}
constexpr
operator
const_pointer
()
const
{
constexpr
operator
const_pointer
()
const
{
...
...
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