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
ef72b471
Unverified
Commit
ef72b471
authored
Dec 18, 2021
by
Alexey Ochapov
Committed by
GitHub
Dec 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable named arguments check in compile-time checks (#2649)
works only if all named arguments are UDL-based
parent
82246b87
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
include/fmt/core.h
include/fmt/core.h
+7
-1
No files found.
include/fmt/core.h
View file @
ef72b471
...
@@ -1109,6 +1109,11 @@ template <typename... Args> constexpr auto count_named_args() -> size_t {
...
@@ -1109,6 +1109,11 @@ template <typename... Args> constexpr auto count_named_args() -> size_t {
return
count
<
is_named_arg
<
Args
>::
value
...
>
();
return
count
<
is_named_arg
<
Args
>::
value
...
>
();
}
}
template
<
typename
...
Args
>
constexpr
auto
count_statically_named_args
()
->
size_t
{
return
count
<
is_statically_named_arg
<
Args
>::
value
...
>
();
}
enum
class
type
{
enum
class
type
{
none_type
,
none_type
,
// Integer types should go first,
// Integer types should go first,
...
@@ -3043,7 +3048,8 @@ template <typename Char, typename... Args> class basic_format_string {
...
@@ -3043,7 +3048,8 @@ template <typename Char, typename... Args> class basic_format_string {
std
::
is_reference
<
Args
>::
value
)...
>
()
==
0
,
std
::
is_reference
<
Args
>::
value
)...
>
()
==
0
,
"passing views as lvalues is disallowed"
);
"passing views as lvalues is disallowed"
);
#ifdef FMT_HAS_CONSTEVAL
#ifdef FMT_HAS_CONSTEVAL
if
constexpr
(
detail
::
count_named_args
<
Args
...
>
()
==
0
)
{
if
constexpr
(
detail
::
count_named_args
<
Args
...
>
()
==
detail
::
count_statically_named_args
<
Args
...
>
())
{
using
checker
=
detail
::
format_string_checker
<
Char
,
detail
::
error_handler
,
using
checker
=
detail
::
format_string_checker
<
Char
,
detail
::
error_handler
,
remove_cvref_t
<
Args
>
...
>
;
remove_cvref_t
<
Args
>
...
>
;
detail
::
parse_format_string
<
true
>
(
str_
,
checker
(
s
,
{}));
detail
::
parse_format_string
<
true
>
(
str_
,
checker
(
s
,
{}));
...
...
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