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
4c650057
Commit
4c650057
authored
Jun 01, 2019
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FMT_CHAR -> char_t
parent
2833c76f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
13 deletions
+16
-13
include/fmt/core.h
include/fmt/core.h
+16
-13
No files found.
include/fmt/core.h
View file @
4c650057
...
@@ -1352,9 +1352,10 @@ template <typename... Args, typename S,
...
@@ -1352,9 +1352,10 @@ template <typename... Args, typename S,
FMT_ENABLE_IF
(
is_compile_string
<
S
>
::
value
)
>
FMT_ENABLE_IF
(
is_compile_string
<
S
>
::
value
)
>
void
check_format_string
(
S
);
void
check_format_string
(
S
);
template
<
typename
S
,
typename
...
Args
,
template
<
FMT_ENABLE_IF
(
internal
::
is_string
<
S
>
::
value
)
>
typename
S
,
typename
...
Args
,
inline
format_arg_store
<
typename
buffer_context
<
FMT_CHAR
(
S
)
>::
type
,
Args
...
>
typename
Char
=
enable_if_t
<
internal
::
is_string
<
S
>
::
value
,
fmt
::
char_t
<
S
>>>
inline
format_arg_store
<
typename
buffer_context
<
Char
>::
type
,
Args
...
>
make_args_checked
(
const
S
&
format_str
,
const
Args
&
...
args
)
{
make_args_checked
(
const
S
&
format_str
,
const
Args
&
...
args
)
{
internal
::
check_format_string
<
Args
...
>
(
format_str
);
internal
::
check_format_string
<
Args
...
>
(
format_str
);
return
{
args
...};
return
{
args
...};
...
@@ -1386,8 +1387,8 @@ typename buffer_context<Char>::type::iterator vformat_to(
...
@@ -1386,8 +1387,8 @@ typename buffer_context<Char>::type::iterator vformat_to(
fmt::print("Elapsed time: {s:.2f} seconds", fmt::arg("s", 1.23));
fmt::print("Elapsed time: {s:.2f} seconds", fmt::arg("s", 1.23));
\endrst
\endrst
*/
*/
template
<
typename
S
,
typename
T
>
template
<
typename
S
,
typename
T
,
typename
Char
=
char_t
<
S
>
>
inline
internal
::
named_arg
<
T
,
FMT_CHAR
(
S
)
>
arg
(
const
S
&
name
,
const
T
&
arg
)
{
inline
internal
::
named_arg
<
T
,
Char
>
arg
(
const
S
&
name
,
const
T
&
arg
)
{
static_assert
(
internal
::
is_string
<
S
>::
value
,
""
);
static_assert
(
internal
::
is_string
<
S
>::
value
,
""
);
return
{
name
,
arg
};
return
{
name
,
arg
};
}
}
...
@@ -1405,11 +1406,12 @@ template <typename Char>
...
@@ -1405,11 +1406,12 @@ template <typename Char>
struct
is_contiguous
<
internal
::
buffer
<
Char
>>
:
std
::
true_type
{};
struct
is_contiguous
<
internal
::
buffer
<
Char
>>
:
std
::
true_type
{};
/** Formats a string and writes the output to ``out``. */
/** Formats a string and writes the output to ``out``. */
template
<
typename
Container
,
typename
S
>
template
<
typename
std
::
enable_if
<
is_contiguous
<
Container
>::
value
,
typename
Container
,
typename
S
,
std
::
back_insert_iterator
<
Container
>>::
type
typename
Char
=
enable_if_t
<
is_contiguous
<
Container
>
::
value
,
char_t
<
S
>>>
vformat_to
(
std
::
back_insert_iterator
<
Container
>
out
,
const
S
&
format_str
,
std
::
back_insert_iterator
<
Container
>
vformat_to
(
basic_format_args
<
typename
buffer_context
<
FMT_CHAR
(
S
)
>::
type
>
args
)
{
std
::
back_insert_iterator
<
Container
>
out
,
const
S
&
format_str
,
basic_format_args
<
typename
buffer_context
<
Char
>::
type
>
args
)
{
internal
::
container_buffer
<
Container
>
buf
(
internal
::
get_container
(
out
));
internal
::
container_buffer
<
Container
>
buf
(
internal
::
get_container
(
out
));
internal
::
vformat_to
(
buf
,
to_string_view
(
format_str
),
args
);
internal
::
vformat_to
(
buf
,
to_string_view
(
format_str
),
args
);
return
out
;
return
out
;
...
@@ -1425,8 +1427,8 @@ inline std::back_insert_iterator<Container> format_to(
...
@@ -1425,8 +1427,8 @@ inline std::back_insert_iterator<Container> format_to(
{
internal
::
make_args_checked
(
format_str
,
args
...)});
{
internal
::
make_args_checked
(
format_str
,
args
...)});
}
}
template
<
typename
S
,
typename
Char
=
FMT_CHAR
(
S
),
template
<
typename
S
,
FMT_ENABLE_IF
(
internal
::
is_string
<
S
>
::
value
)
>
typename
Char
=
enable_if_t
<
internal
::
is_string
<
S
>
::
value
,
char_t
<
S
>>
>
inline
std
::
basic_string
<
Char
>
vformat
(
inline
std
::
basic_string
<
Char
>
vformat
(
const
S
&
format_str
,
const
S
&
format_str
,
basic_format_args
<
typename
buffer_context
<
Char
>::
type
>
args
)
{
basic_format_args
<
typename
buffer_context
<
Char
>::
type
>
args
)
{
...
@@ -1447,7 +1449,8 @@ inline std::basic_string<Char> vformat(
...
@@ -1447,7 +1449,8 @@ inline std::basic_string<Char> vformat(
// std::basic_string<fmt::char_t<S>> to reduce the symbol size.
// std::basic_string<fmt::char_t<S>> to reduce the symbol size.
template
<
typename
S
,
typename
...
Args
,
template
<
typename
S
,
typename
...
Args
,
typename
Char
=
enable_if_t
<
internal
::
is_string
<
S
>
::
value
,
char_t
<
S
>>>
typename
Char
=
enable_if_t
<
internal
::
is_string
<
S
>
::
value
,
char_t
<
S
>>>
inline
std
::
basic_string
<
Char
>
format
(
const
S
&
format_str
,
const
Args
&
...
args
)
{
inline
std
::
basic_string
<
Char
>
format
(
const
S
&
format_str
,
const
Args
&
...
args
)
{
return
internal
::
vformat
(
to_string_view
(
format_str
),
return
internal
::
vformat
(
to_string_view
(
format_str
),
{
internal
::
make_args_checked
(
format_str
,
args
...)});
{
internal
::
make_args_checked
(
format_str
,
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