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
d384cdd3
Commit
d384cdd3
authored
Jun 11, 2019
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make is_contiguous_back_insert_iterator internal
parent
32544b61
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
18 deletions
+22
-18
include/fmt/core.h
include/fmt/core.h
+19
-16
include/fmt/format.h
include/fmt/format.h
+3
-2
No files found.
include/fmt/core.h
View file @
d384cdd3
...
...
@@ -1216,7 +1216,24 @@ struct wformat_args : basic_format_args<wformat_context> {
:
basic_format_args
<
wformat_context
>
(
std
::
forward
<
Args
>
(
args
)...)
{}
};
template
<
typename
Container
>
struct
is_contiguous
:
std
::
false_type
{};
template
<
typename
Char
>
struct
is_contiguous
<
std
::
basic_string
<
Char
>>
:
std
::
true_type
{};
template
<
typename
Char
>
struct
is_contiguous
<
internal
::
buffer
<
Char
>>
:
std
::
true_type
{};
namespace
internal
{
// Workaround for a SFINAE issue in gcc < 9:
// https://stackoverflow.com/q/56436995/471164
template
<
typename
OutputIt
>
struct
is_contiguous_back_insert_iterator
:
std
::
false_type
{};
template
<
typename
Container
>
struct
is_contiguous_back_insert_iterator
<
std
::
back_insert_iterator
<
Container
>>
:
is_contiguous
<
Container
>
{};
template
<
typename
Char
>
struct
named_arg_base
{
basic_string_view
<
Char
>
name
;
...
...
@@ -1286,26 +1303,12 @@ inline internal::named_arg<T, Char> arg(const S& name, const T& arg) {
template
<
typename
S
,
typename
T
,
typename
Char
>
void
arg
(
S
,
internal
::
named_arg
<
T
,
Char
>
)
=
delete
;
template
<
typename
Container
>
struct
is_contiguous
:
std
::
false_type
{};
template
<
typename
Char
>
struct
is_contiguous
<
std
::
basic_string
<
Char
>>
:
std
::
true_type
{};
template
<
typename
Char
>
struct
is_contiguous
<
internal
::
buffer
<
Char
>>
:
std
::
true_type
{};
template
<
typename
OutputIt
>
struct
is_contiguous_back_insert_iterator
:
std
::
false_type
{};
template
<
typename
Container
>
struct
is_contiguous_back_insert_iterator
<
std
::
back_insert_iterator
<
Container
>>
:
is_contiguous
<
Container
>
{};
/** Formats a string and writes the output to ``out``. */
// GCC 8 and earlier cannot handle std::back_insert_iterator<Container> with
// vformat_to<ArgFormatter>(...) overload, so SFINAE on iterator type instead.
template
<
typename
OutputIt
,
typename
S
,
typename
Char
=
char_t
<
S
>,
FMT_ENABLE_IF
(
is_contiguous_back_insert_iterator
<
OutputIt
>::
value
)
>
FMT_ENABLE_IF
(
internal
::
is_contiguous_back_insert_iterator
<
OutputIt
>::
value
)
>
OutputIt
vformat_to
(
OutputIt
out
,
const
S
&
format_str
,
basic_format_args
<
buffer_context
<
Char
>>
args
)
{
using
container
=
typename
std
::
remove_reference
<
decltype
(
...
...
include/fmt/format.h
View file @
d384cdd3
...
...
@@ -3481,8 +3481,9 @@ struct format_args_t {
};
template
<
typename
S
,
typename
OutputIt
,
typename
...
Args
,
FMT_ENABLE_IF
(
internal
::
is_output_iterator
<
OutputIt
>
::
value
&&
!
is_contiguous_back_insert_iterator
<
OutputIt
>::
value
)
>
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
)
{
...
...
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