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
229ee9b4
Commit
229ee9b4
authored
Jul 20, 2020
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workaround broken numeric_limits (#1725)
parent
2b7a146f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
include/fmt/format.h
include/fmt/format.h
+5
-2
No files found.
include/fmt/format.h
View file @
229ee9b4
...
...
@@ -283,6 +283,9 @@ template <typename T> constexpr T max_value() {
template
<
typename
T
>
constexpr
int
num_bits
()
{
return
std
::
numeric_limits
<
T
>::
digits
;
}
// std::numeric_limits<T>::digits may return 0 for 128-bit ints.
template
<
>
constexpr
int
num_bits
<
int128_t
>
()
{
return
128
;
}
template
<
>
constexpr
int
num_bits
<
uint128_t
>
()
{
return
128
;
}
template
<
>
constexpr
int
num_bits
<
fallback_uintptr
>
()
{
return
static_cast
<
int
>
(
sizeof
(
void
*
)
*
std
::
numeric_limits
<
unsigned
char
>::
digits
);
...
...
@@ -743,8 +746,8 @@ FMT_CONSTEXPR bool is_supported_floating_point(T) {
// represent all values of T.
template
<
typename
T
>
using
uint32_or_64_or_128_t
=
conditional_t
<
std
::
numeric_limits
<
T
>::
digits
<=
32
,
uint32_t
,
conditional_t
<
std
::
numeric_limits
<
T
>::
digits
<=
64
,
uint64_t
,
uint128_t
>>
;
num_bits
<
T
>
()
<=
32
,
uint32_t
,
conditional_t
<
num_bits
<
T
>
()
<=
64
,
uint64_t
,
uint128_t
>>
;
// Static data is placed in this class template for the header-only config.
template
<
typename
T
=
void
>
struct
FMT_EXTERN_TEMPLATE_API
basic_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