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
8a06ca84
Commit
8a06ca84
authored
Mar 05, 2020
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ambiguous overloads of format & format_to
parent
153f753b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
7 deletions
+18
-7
include/fmt/compile.h
include/fmt/compile.h
+18
-7
No files found.
include/fmt/compile.h
View file @
8a06ca84
...
...
@@ -351,6 +351,8 @@ template <int N, typename... Args> struct get_type_impl<N, type_list<Args...>> {
template
<
int
N
,
typename
T
>
using
get_type
=
typename
get_type_impl
<
N
,
T
>::
type
;
template
<
typename
T
>
struct
is_static_compiled_format
:
std
::
false_type
{};
template
<
typename
Char
>
struct
text
{
basic_string_view
<
Char
>
data
;
using
char_type
=
Char
;
...
...
@@ -362,6 +364,9 @@ template <typename Char> struct text {
}
};
template
<
typename
Char
>
struct
is_static_compiled_format
<
text
<
Char
>>
:
std
::
true_type
{};
template
<
typename
Char
>
constexpr
text
<
Char
>
make_text
(
basic_string_view
<
Char
>
s
,
size_t
pos
,
size_t
size
)
{
...
...
@@ -407,6 +412,9 @@ template <typename Char, typename T, int N> struct field {
}
};
template
<
typename
Char
,
typename
T
,
int
N
>
struct
is_static_compiled_format
<
field
<
Char
,
T
,
N
>>
:
std
::
true_type
{};
template
<
typename
L
,
typename
R
>
struct
concat
{
L
lhs
;
R
rhs
;
...
...
@@ -419,6 +427,9 @@ template <typename L, typename R> struct concat {
}
};
template
<
typename
L
,
typename
R
>
struct
is_static_compiled_format
<
concat
<
L
,
R
>>
:
std
::
true_type
{};
template
<
typename
L
,
typename
R
>
constexpr
concat
<
L
,
R
>
make_concat
(
L
lhs
,
R
rhs
)
{
return
{
lhs
,
rhs
};
...
...
@@ -507,19 +518,19 @@ constexpr auto compile(S format_str) {
}
}
template
<
typename
CompiledFormat
,
typename
...
Args
,
typename
Char
=
typename
CompiledFormat
::
char_type
,
FMT_ENABLE_IF
(
!
std
::
is_base_of
<
internal
::
basic_compiled_format
,
CompiledFormat
>
::
value
)
>
template
<
typename
CompiledFormat
,
typename
...
Args
,
typename
Char
=
typename
CompiledFormat
::
char_type
,
FMT_ENABLE_IF
(
internal
::
is_static_compiled_format
<
CompiledFormat
>
::
value
)
>
std
::
basic_string
<
Char
>
format
(
const
CompiledFormat
&
cf
,
const
Args
&
...
args
)
{
basic_memory_buffer
<
Char
>
buffer
;
cf
.
format
(
std
::
back_inserter
(
buffer
),
args
...);
return
to_string
(
buffer
);
}
template
<
typename
OutputIt
,
typename
CompiledFormat
,
typename
...
Args
,
FMT_ENABLE_IF
(
!
std
::
is_base_of
<
internal
::
basic_compiled_format
,
CompiledFormat
>
::
value
)
>
template
<
typename
OutputIt
,
typename
CompiledFormat
,
typename
...
Args
,
FMT_ENABLE_IF
(
internal
::
is_static_compiled_format
<
CompiledFormat
>
::
value
)
>
OutputIt
format_to
(
OutputIt
out
,
const
CompiledFormat
&
cf
,
const
Args
&
...
args
)
{
return
cf
.
format
(
out
,
args
...);
...
...
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