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
e3f20d3e
Commit
e3f20d3e
authored
Jul 07, 2019
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove gcc 4.4 workaround and use proper alias templates (#940)
parent
b4388123
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
32 deletions
+19
-32
include/fmt/format.h
include/fmt/format.h
+14
-27
include/fmt/locale.h
include/fmt/locale.h
+2
-2
include/fmt/ostream.h
include/fmt/ostream.h
+2
-2
include/fmt/prepare.h
include/fmt/prepare.h
+1
-1
No files found.
include/fmt/format.h
View file @
e3f20d3e
...
...
@@ -3340,25 +3340,17 @@ inline typename buffer_context<Char>::iterator format_to(
}
template
<
typename
OutputIt
,
typename
Char
=
char
>
// using format_context_t = basic_format_context<OutputIt, Char>;
struct
format_context_t
{
typedef
basic_format_context
<
OutputIt
,
Char
>
type
;
};
using
format_context_t
=
basic_format_context
<
OutputIt
,
Char
>
;
template
<
typename
OutputIt
,
typename
Char
=
char
>
// using format_args_t = basic_format_args<format_context_t<OutputIt, Char>>;
struct
format_args_t
{
typedef
basic_format_args
<
typename
format_context_t
<
OutputIt
,
Char
>::
type
>
type
;
};
using
format_args_t
=
basic_format_args
<
format_context_t
<
OutputIt
,
Char
>>
;
template
<
typename
S
,
typename
OutputIt
,
typename
...
Args
,
FMT_ENABLE_IF
(
internal
::
is_output_iterator
<
OutputIt
>
::
value
&&
!
internal
::
is_contiguous_back_insert_iterator
<
OutputIt
>::
value
)
>
inline
OutputIt
vformat_to
(
OutputIt
out
,
const
S
&
format_str
,
typename
format_args_t
<
OutputIt
,
char_t
<
S
>>::
type
args
)
{
inline
OutputIt
vformat_to
(
OutputIt
out
,
const
S
&
format_str
,
format_args_t
<
OutputIt
,
char_t
<
S
>>
args
)
{
typedef
internal
::
output_range
<
OutputIt
,
char_t
<
S
>>
range
;
return
vformat_to
<
arg_formatter
<
range
>>
(
range
(
out
),
to_string_view
(
format_str
),
args
);
...
...
@@ -3382,7 +3374,7 @@ inline OutputIt format_to(OutputIt out, const S& format_str,
internal
::
is_string
<
S
>::
value
,
""
);
internal
::
check_format_string
<
Args
...
>
(
format_str
);
typedef
typename
format_context_t
<
OutputIt
,
char_t
<
S
>>::
type
context
;
typedef
format_context_t
<
OutputIt
,
char_t
<
S
>>
context
;
format_arg_store
<
context
,
Args
...
>
as
{
args
...};
return
vformat_to
(
out
,
to_string_view
(
format_str
),
basic_format_args
<
context
>
(
as
));
...
...
@@ -3396,28 +3388,24 @@ template <typename OutputIt> struct format_to_n_result {
};
template
<
typename
OutputIt
,
typename
Char
=
typename
OutputIt
::
value_type
>
struct
format_to_n_context
:
format_context_t
<
fmt
::
internal
::
truncating_iterator
<
OutputIt
>
,
Char
>
{}
;
using
format_to_n_context
=
format_context_t
<
fmt
::
internal
::
truncating_iterator
<
OutputIt
>
,
Char
>
;
template
<
typename
OutputIt
,
typename
Char
=
typename
OutputIt
::
value_type
>
struct
format_to_n_args
{
typedef
basic_format_args
<
typename
format_to_n_context
<
OutputIt
,
Char
>::
type
>
type
;
};
using
format_to_n_args
=
basic_format_args
<
format_to_n_context
<
OutputIt
,
Char
>>
;
template
<
typename
OutputIt
,
typename
Char
,
typename
...
Args
>
inline
format_arg_store
<
typename
format_to_n_context
<
OutputIt
,
Char
>::
type
,
Args
...
>
inline
format_arg_store
<
format_to_n_context
<
OutputIt
,
Char
>
,
Args
...
>
make_format_to_n_args
(
const
Args
&
...
args
)
{
return
format_arg_store
<
typename
format_to_n_context
<
OutputIt
,
Char
>::
type
,
Args
...
>
(
args
...);
return
format_arg_store
<
format_to_n_context
<
OutputIt
,
Char
>
,
Args
...
>
(
args
...);
}
template
<
typename
OutputIt
,
typename
Char
,
typename
...
Args
,
FMT_ENABLE_IF
(
internal
::
is_output_iterator
<
OutputIt
>
::
value
)
>
inline
format_to_n_result
<
OutputIt
>
vformat_to_n
(
OutputIt
out
,
std
::
size_t
n
,
basic_string_view
<
Char
>
format_str
,
typename
format_to_n_args
<
OutputIt
,
Char
>::
type
args
)
{
format_to_n_args
<
OutputIt
,
Char
>
args
)
{
typedef
internal
::
truncating_iterator
<
OutputIt
>
It
;
auto
it
=
vformat_to
(
It
(
out
,
n
),
format_str
,
args
);
return
{
it
.
base
(),
it
.
count
()};
...
...
@@ -3438,10 +3426,9 @@ inline format_to_n_result<OutputIt> format_to_n(OutputIt out, std::size_t n,
const
Args
&
...
args
)
{
internal
::
check_format_string
<
Args
...
>
(
format_str
);
using
Char
=
char_t
<
S
>
;
format_arg_store
<
typename
format_to_n_context
<
OutputIt
,
Char
>::
type
,
Args
...
>
as
(
args
...);
format_arg_store
<
format_to_n_context
<
OutputIt
,
Char
>
,
Args
...
>
as
(
args
...);
return
vformat_to_n
(
out
,
n
,
to_string_view
(
format_str
),
typename
format_to_n_args
<
OutputIt
,
Char
>::
type
(
as
));
format_to_n_args
<
OutputIt
,
Char
>
(
as
));
}
template
<
typename
Char
>
...
...
include/fmt/locale.h
View file @
e3f20d3e
...
...
@@ -54,7 +54,7 @@ template <typename S, typename OutputIt, typename... Args,
internal
::
is_output_iterator
<
OutputIt
>
::
value
,
char_t
<
S
>>>
inline
OutputIt
vformat_to
(
OutputIt
out
,
const
std
::
locale
&
loc
,
const
S
&
format_str
,
typename
format_args_t
<
OutputIt
,
Char
>::
type
args
)
{
format_args_t
<
OutputIt
,
Char
>
args
)
{
using
range
=
internal
::
output_range
<
OutputIt
,
Char
>
;
return
vformat_to
<
arg_formatter
<
range
>>
(
range
(
out
),
to_string_view
(
format_str
),
args
,
internal
::
locale_ref
(
loc
));
...
...
@@ -66,7 +66,7 @@ template <typename OutputIt, typename S, typename... Args,
inline
OutputIt
format_to
(
OutputIt
out
,
const
std
::
locale
&
loc
,
const
S
&
format_str
,
const
Args
&
...
args
)
{
internal
::
check_format_string
<
Args
...
>
(
format_str
);
using
context
=
typename
format_context_t
<
OutputIt
,
char_t
<
S
>>::
type
;
using
context
=
format_context_t
<
OutputIt
,
char_t
<
S
>>
;
format_arg_store
<
context
,
Args
...
>
as
{
args
...};
return
vformat_to
(
out
,
loc
,
to_string_view
(
format_str
),
basic_format_args
<
context
>
(
as
));
...
...
include/fmt/ostream.h
View file @
e3f20d3e
...
...
@@ -127,7 +127,7 @@ void vprint(std::basic_ostream<Char>& os, basic_string_view<Char> format_str,
*/
template
<
typename
S
,
typename
...
Args
,
typename
Char
=
enable_if_t
<
internal
::
is_string
<
S
>
::
value
,
char_t
<
S
>>>
inline
void
print
(
std
::
basic_ostream
<
Char
>&
os
,
const
S
&
format_str
,
void
print
(
std
::
basic_ostream
<
Char
>&
os
,
const
S
&
format_str
,
const
Args
&
...
args
)
{
vprint
(
os
,
to_string_view
(
format_str
),
{
internal
::
make_args_checked
(
format_str
,
args
...)});
...
...
include/fmt/prepare.h
View file @
e3f20d3e
...
...
@@ -232,7 +232,7 @@ class prepared_format {
template
<
typename
OutputIt
>
inline
OutputIt
format_to
(
OutputIt
out
,
const
Args
&
...
args
)
const
{
typedef
typename
format_context_t
<
OutputIt
,
char_type
>::
type
context
;
typedef
format_context_t
<
OutputIt
,
char_type
>
context
;
typedef
output_range
<
OutputIt
,
char_type
>
range
;
format_arg_store
<
context
,
Args
...
>
as
(
args
...);
return
this
->
vformat_to
(
range
(
out
),
basic_format_args
<
context
>
(
as
));
...
...
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