Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
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
fmt
Commits
c2fbadb9
Commit
c2fbadb9
authored
Jun 10, 2018
by
gabime
Committed by
Victor Zverovich
Jun 12, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issue #779
parent
47268ecd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
include/fmt/core.h
include/fmt/core.h
+16
-16
No files found.
include/fmt/core.h
View file @
c2fbadb9
...
...
@@ -237,8 +237,8 @@ class basic_string_view {
FMT_CONSTEXPR
basic_string_view
()
FMT_NOEXCEPT
:
data_
(
FMT_NULL
),
size_
(
0
)
{}
/** Constructs a string reference object from a C string and a size. */
FMT_CONSTEXPR
basic_string_view
(
const
Char
*
s
,
size_t
size
)
FMT_NOEXCEPT
:
data_
(
s
),
size_
(
size
)
{}
FMT_CONSTEXPR
basic_string_view
(
const
Char
*
s
,
size_t
count
)
FMT_NOEXCEPT
:
data_
(
s
),
size_
(
count
)
{}
/**
\rst
...
...
@@ -274,8 +274,8 @@ class basic_string_view {
// Lexicographically compare this string reference to other.
int
compare
(
basic_string_view
other
)
const
{
size_t
size
=
size_
<
other
.
size_
?
size_
:
other
.
size_
;
int
result
=
std
::
char_traits
<
Char
>::
compare
(
data_
,
other
.
data_
,
size
);
size_t
s
tr_s
ize
=
size_
<
other
.
size_
?
size_
:
other
.
size_
;
int
result
=
std
::
char_traits
<
Char
>::
compare
(
data_
,
other
.
data_
,
s
tr_s
ize
);
if
(
result
==
0
)
result
=
size_
==
other
.
size_
?
0
:
(
size_
<
other
.
size_
?
-
1
:
1
);
return
result
;
...
...
@@ -327,13 +327,13 @@ class basic_buffer {
std
::
size_t
capacity_
;
protected:
basic_buffer
(
T
*
p
=
FMT_NULL
,
std
::
size_t
size
=
0
,
std
::
size_t
capacity
=
0
)
FMT_NOEXCEPT:
ptr_
(
p
),
size_
(
size
),
capacity_
(
capacity
)
{}
basic_buffer
(
T
*
p
=
FMT_NULL
,
std
::
size_t
buf_size
=
0
,
std
::
size_t
buf_
capacity
=
0
)
FMT_NOEXCEPT:
ptr_
(
p
),
size_
(
buf_size
),
capacity_
(
buf_
capacity
)
{}
/** Sets the buffer data and capacity. */
void
set
(
T
*
data
,
std
::
size_t
capacity
)
FMT_NOEXCEPT
{
ptr_
=
data
;
capacity_
=
capacity
;
void
set
(
T
*
buf_data
,
std
::
size_t
buf_
capacity
)
FMT_NOEXCEPT
{
ptr_
=
buf_
data
;
capacity_
=
buf_
capacity
;
}
/** Increases the buffer capacity to hold at least *capacity* elements. */
...
...
@@ -369,9 +369,9 @@ class basic_buffer {
}
/** Reserves space to store at least *capacity* elements. */
void
reserve
(
std
::
size_t
capacity
)
{
if
(
capacity
>
capacity_
)
grow
(
capacity
);
void
reserve
(
std
::
size_t
new_
capacity
)
{
if
(
new_
capacity
>
capacity_
)
grow
(
new_
capacity
);
}
void
push_back
(
const
T
&
value
)
{
...
...
@@ -828,8 +828,8 @@ class context_base {
typedef
basic_format_arg
<
Context
>
format_arg
;
context_base
(
OutputIt
out
,
basic_string_view
<
char_type
>
format_str
,
basic_format_args
<
Context
>
args
)
:
parse_context_
(
format_str
),
out_
(
out
),
args_
(
args
)
{}
basic_format_args
<
Context
>
ctx_
args
)
:
parse_context_
(
format_str
),
out_
(
out
),
args_
(
ctx_
args
)
{}
// Returns the argument with specified index.
format_arg
do_get_arg
(
unsigned
arg_id
)
{
...
...
@@ -909,8 +909,8 @@ class basic_format_context :
stored in the object so make sure they have appropriate lifetimes.
*/
basic_format_context
(
OutputIt
out
,
basic_string_view
<
char_type
>
format_str
,
basic_format_args
<
basic_format_context
>
args
)
:
base
(
out
,
format_str
,
args
)
{}
basic_format_args
<
basic_format_context
>
ctx_
args
)
:
base
(
out
,
format_str
,
ctx_
args
)
{}
format_arg
next_arg
()
{
return
this
->
do_get_arg
(
this
->
parse_context
().
next_arg_id
());
...
...
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