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
89b0c71f
Commit
89b0c71f
authored
Sep 24, 2019
by
Daumantas Kavolis
Committed by
Victor Zverovich
Sep 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix name clash in header-only mode
parent
f6a783ad
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
include/fmt/compile.h
include/fmt/compile.h
+7
-6
No files found.
include/fmt/compile.h
View file @
89b0c71f
...
@@ -414,7 +414,7 @@ constexpr concat<L, R> make_concat(L lhs, R rhs) {
...
@@ -414,7 +414,7 @@ constexpr concat<L, R> make_concat(L lhs, R rhs) {
return
{
lhs
,
rhs
};
return
{
lhs
,
rhs
};
}
}
struct
unknown
{};
struct
unknown
_format
{};
template
<
typename
Char
>
template
<
typename
Char
>
constexpr
size_t
parse_text
(
basic_string_view
<
Char
>
str
,
size_t
pos
)
{
constexpr
size_t
parse_text
(
basic_string_view
<
Char
>
str
,
size_t
pos
)
{
...
@@ -431,7 +431,8 @@ template <typename Args, size_t POS, int ID, typename T, typename S>
...
@@ -431,7 +431,8 @@ template <typename Args, size_t POS, int ID, typename T, typename S>
constexpr
auto
parse_tail
(
T
head
,
S
format_str
)
{
constexpr
auto
parse_tail
(
T
head
,
S
format_str
)
{
if
constexpr
(
POS
!=
to_string_view
(
format_str
).
size
())
{
if
constexpr
(
POS
!=
to_string_view
(
format_str
).
size
())
{
constexpr
auto
tail
=
compile_format_string
<
Args
,
POS
,
ID
>
(
format_str
);
constexpr
auto
tail
=
compile_format_string
<
Args
,
POS
,
ID
>
(
format_str
);
if
constexpr
(
std
::
is_same
<
remove_cvref_t
<
decltype
(
tail
)
>
,
unknown
>
())
if
constexpr
(
std
::
is_same
<
remove_cvref_t
<
decltype
(
tail
)
>
,
unknown_format
>
())
return
tail
;
return
tail
;
else
else
return
make_concat
(
head
,
tail
);
return
make_concat
(
head
,
tail
);
...
@@ -441,7 +442,7 @@ constexpr auto parse_tail(T head, S format_str) {
...
@@ -441,7 +442,7 @@ constexpr auto parse_tail(T head, S format_str) {
}
}
// Compiles a non-empty format string and returns the compiled representation
// Compiles a non-empty format string and returns the compiled representation
// or unknown() on unrecognized input.
// or unknown
_format
() on unrecognized input.
template
<
typename
Args
,
size_t
POS
,
int
ID
,
typename
S
>
template
<
typename
Args
,
size_t
POS
,
int
ID
,
typename
S
>
constexpr
auto
compile_format_string
(
S
format_str
)
{
constexpr
auto
compile_format_string
(
S
format_str
)
{
using
char_type
=
typename
S
::
char_type
;
using
char_type
=
typename
S
::
char_type
;
...
@@ -457,10 +458,10 @@ constexpr auto compile_format_string(S format_str) {
...
@@ -457,10 +458,10 @@ constexpr auto compile_format_string(S format_str) {
return
parse_tail
<
Args
,
POS
+
2
,
ID
+
1
>
(
field
<
char_type
,
type
,
ID
>
(),
return
parse_tail
<
Args
,
POS
+
2
,
ID
+
1
>
(
field
<
char_type
,
type
,
ID
>
(),
format_str
);
format_str
);
}
else
{
}
else
{
return
unknown
();
return
unknown
_format
();
}
}
}
else
{
}
else
{
return
unknown
();
return
unknown
_format
();
}
}
}
else
if
constexpr
(
str
[
POS
]
==
'}'
)
{
}
else
if
constexpr
(
str
[
POS
]
==
'}'
)
{
if
(
POS
+
1
==
str
.
size
())
if
(
POS
+
1
==
str
.
size
())
...
@@ -488,7 +489,7 @@ constexpr auto compile(S format_str) {
...
@@ -488,7 +489,7 @@ constexpr auto compile(S format_str) {
internal
::
compile_format_string
<
internal
::
type_list
<
Args
...
>
,
0
,
0
>
(
internal
::
compile_format_string
<
internal
::
type_list
<
Args
...
>
,
0
,
0
>
(
format_str
);
format_str
);
if
constexpr
(
std
::
is_same
<
remove_cvref_t
<
decltype
(
result
)
>
,
if
constexpr
(
std
::
is_same
<
remove_cvref_t
<
decltype
(
result
)
>
,
internal
::
unknown
>
())
{
internal
::
unknown
_format
>
())
{
return
internal
::
compiled_format
<
S
,
Args
...
>
(
to_string_view
(
format_str
));
return
internal
::
compiled_format
<
S
,
Args
...
>
(
to_string_view
(
format_str
));
}
else
{
}
else
{
return
result
;
return
result
;
...
...
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