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
f9ceefb0
Commit
f9ceefb0
authored
Jul 19, 2019
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a warning and is_negative usage
parent
6bcc3fd2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
test/std-format-test.cc
test/std-format-test.cc
+2
-2
No files found.
test/std-format-test.cc
View file @
f9ceefb0
...
...
@@ -126,11 +126,11 @@ template <> struct std::formatter<S> {
if
constexpr
(
!
is_integral_v
<
decltype
(
value
)
>
)
throw
format_error
(
"width is not integral"
);
// else if (value < 0 || value > numeric_limits<int>::max())
else
if
(
fmt
::
internal
::
is_negative
(
value
)
<
0
||
else
if
(
fmt
::
internal
::
is_negative
(
value
)
||
value
>
numeric_limits
<
int
>::
max
())
throw
format_error
(
"invalid width"
);
else
return
value
;
return
static_cast
<
int
>
(
value
)
;
},
ctx
.
arg
(
width_arg_id
));
return
format_to
(
ctx
.
out
(),
"{0:{1}}"
,
s
.
value
,
width
);
...
...
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