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
ac1b5f3d
Commit
ac1b5f3d
authored
Dec 09, 2021
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor problematic trailing returns in arg_mapper
parent
fd62fba9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
include/fmt/core.h
include/fmt/core.h
+12
-12
No files found.
include/fmt/core.h
View file @
ac1b5f3d
...
@@ -8,8 +8,8 @@
...
@@ -8,8 +8,8 @@
#ifndef FMT_CORE_H_
#ifndef FMT_CORE_H_
#define FMT_CORE_H_
#define FMT_CORE_H_
#include <cstddef> // std::byte
#include <cstddef>
// std::byte
#include <cstdio> // std::FILE
#include <cstdio>
// std::FILE
#include <cstring>
#include <cstring>
#include <iterator>
#include <iterator>
#include <limits>
#include <limits>
...
@@ -1364,20 +1364,21 @@ template <typename Context> struct arg_mapper {
...
@@ -1364,20 +1364,21 @@ template <typename Context> struct arg_mapper {
->
basic_string_view
<
char_type
>
{
->
basic_string_view
<
char_type
>
{
return
std_string_view
<
char_type
>
(
val
);
return
std_string_view
<
char_type
>
(
val
);
}
}
FMT_CONSTEXPR
FMT_INLINE
auto
map
(
const
signed
char
*
val
)
->
decltype
(
this
->
map
(
""
))
{
using
cstring_result
=
conditional_t
<
std
::
is_same
<
char_type
,
char
>::
value
,
const
char
*
,
unformattable_pointer
>
;
FMT_CONSTEXPR
FMT_INLINE
auto
map
(
const
signed
char
*
val
)
->
cstring_result
{
return
map
(
reinterpret_cast
<
const
char
*>
(
val
));
return
map
(
reinterpret_cast
<
const
char
*>
(
val
));
}
}
FMT_CONSTEXPR
FMT_INLINE
auto
map
(
const
unsigned
char
*
val
)
FMT_CONSTEXPR
FMT_INLINE
auto
map
(
const
unsigned
char
*
val
)
->
decltype
(
this
->
map
(
""
))
{
->
cstring_result
{
return
map
(
reinterpret_cast
<
const
char
*>
(
val
));
return
map
(
reinterpret_cast
<
const
char
*>
(
val
));
}
}
FMT_CONSTEXPR
FMT_INLINE
auto
map
(
signed
char
*
val
)
FMT_CONSTEXPR
FMT_INLINE
auto
map
(
signed
char
*
val
)
->
cstring_result
{
->
decltype
(
this
->
map
(
""
))
{
return
map
(
reinterpret_cast
<
const
char
*>
(
val
));
return
map
(
reinterpret_cast
<
const
char
*>
(
val
));
}
}
FMT_CONSTEXPR
FMT_INLINE
auto
map
(
unsigned
char
*
val
)
FMT_CONSTEXPR
FMT_INLINE
auto
map
(
unsigned
char
*
val
)
->
cstring_result
{
->
decltype
(
this
->
map
(
""
))
{
return
map
(
reinterpret_cast
<
const
char
*>
(
val
));
return
map
(
reinterpret_cast
<
const
char
*>
(
val
));
}
}
...
@@ -1410,9 +1411,8 @@ template <typename Context> struct arg_mapper {
...
@@ -1410,9 +1411,8 @@ template <typename Context> struct arg_mapper {
template
<
typename
T
,
template
<
typename
T
,
FMT_ENABLE_IF
(
std
::
is_enum
<
T
>
::
value
&&
FMT_ENABLE_IF
(
std
::
is_enum
<
T
>
::
value
&&
(
std
::
is_convertible
<
T
,
int
>::
value
(
std
::
is_convertible
<
T
,
int
>::
value
||
||
std
::
is_same
<
T
,
detail
::
byte
>::
value
std
::
is_same
<
T
,
detail
::
byte
>::
value
)
&&
)
&&
!
has_formatter
<
T
,
Context
>::
value
&&
!
has_formatter
<
T
,
Context
>::
value
&&
!
has_fallback_formatter
<
T
,
char_type
>::
value
)
>
!
has_fallback_formatter
<
T
,
char_type
>::
value
)
>
FMT_CONSTEXPR
FMT_INLINE
auto
map
(
const
T
&
val
)
FMT_CONSTEXPR
FMT_INLINE
auto
map
(
const
T
&
val
)
...
...
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