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
d66fa221
Commit
d66fa221
authored
Sep 23, 2018
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce syntactic noise
parent
48e6dcd0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
26 deletions
+14
-26
include/fmt/core.h
include/fmt/core.h
+7
-14
include/fmt/format.h
include/fmt/format.h
+7
-12
No files found.
include/fmt/core.h
View file @
d66fa221
...
...
@@ -861,7 +861,7 @@ class arg_map {
if
(
it
->
name
==
name
)
return
it
->
arg
;
}
return
basic_format_arg
<
Context
>
()
;
return
{}
;
}
};
...
...
@@ -899,9 +899,8 @@ class context_base {
}
public:
basic_parse_context
<
char_type
>
&
parse_context
()
{
return
parse_context_
;
}
basic_parse_context
<
char_type
>
&
parse_context
()
{
return
parse_context_
;
}
basic_format_args
<
Context
>
args
()
const
{
return
args_
;
}
internal
::
error_handler
error_handler
()
{
return
parse_context_
.
error_handler
();
...
...
@@ -915,8 +914,6 @@ class context_base {
// Advances the begin iterator to ``it``.
void
advance_to
(
iterator
it
)
{
out_
=
it
;
}
basic_format_args
<
Context
>
args
()
const
{
return
args_
;
}
};
// Extracts a reference to the container from back_insert_iterator.
...
...
@@ -1086,15 +1083,11 @@ const long long format_arg_store<Context, Args...>::TYPES = get_types();
*/
template
<
typename
Context
,
typename
...
Args
>
inline
format_arg_store
<
Context
,
Args
...
>
make_format_args
(
const
Args
&
...
args
)
{
return
format_arg_store
<
Context
,
Args
...
>
(
args
...);
}
make_format_args
(
const
Args
&
...
args
)
{
return
{
args
...};
}
template
<
typename
...
Args
>
inline
format_arg_store
<
format_context
,
Args
...
>
make_format_args
(
const
Args
&
...
args
)
{
return
format_arg_store
<
format_context
,
Args
...
>
(
args
...);
}
make_format_args
(
const
Args
&
...
args
)
{
return
{
args
...};
}
/** Formatting arguments. */
template
<
typename
Context
>
...
...
@@ -1240,12 +1233,12 @@ struct named_arg : named_arg_base<Char> {
*/
template
<
typename
T
>
inline
internal
::
named_arg
<
T
,
char
>
arg
(
string_view
name
,
const
T
&
arg
)
{
return
internal
::
named_arg
<
T
,
char
>
(
name
,
arg
)
;
return
{
name
,
arg
}
;
}
template
<
typename
T
>
inline
internal
::
named_arg
<
T
,
wchar_t
>
arg
(
wstring_view
name
,
const
T
&
arg
)
{
return
internal
::
named_arg
<
T
,
wchar_t
>
(
name
,
arg
)
;
return
{
name
,
arg
}
;
}
// This function template is deleted intentionally to disable nested named
...
...
include/fmt/format.h
View file @
d66fa221
...
...
@@ -434,31 +434,26 @@ void basic_buffer<T>::append(const U *begin, const U *end) {
// A UTF-8 code unit type.
struct
char8_t
{
char
value
;
FMT_CONSTEXPR
explicit
operator
bool
()
const
FMT_NOEXCEPT
{
FMT_CONSTEXPR
FMT_EXPLICIT
operator
bool
()
const
FMT_NOEXCEPT
{
return
value
!=
0
;
}
};
// A UTF-8 string view.
class
u8string_view
:
public
basic_string_view
<
char8_t
>
{
private:
typedef
basic_string_view
<
char8_t
>
base
;
public:
using
basic_string_view
::
basic_string_view
;
using
basic_string_view
::
char_type
;
u8string_view
(
const
char
*
s
)
:
base
(
reinterpret_cast
<
const
char8_t
*>
(
s
))
{}
typedef
char8_t
char_type
;
u8string_view
(
const
char
*
s
,
size_t
count
)
FMT_NOEXCEPT
:
base
(
reinterpret_cast
<
const
char8_t
*>
(
s
),
count
)
{}
u8string_view
(
const
char
*
s
)
:
basic_string_view
<
char8_t
>
(
reinterpret_cast
<
const
char8_t
*>
(
s
))
{}
u8string_view
(
const
char
*
s
,
size_t
count
)
FMT_NOEXCEPT
:
basic_string_view
<
char8_t
>
(
reinterpret_cast
<
const
char8_t
*>
(
s
),
count
)
{}
};
#if FMT_USE_USER_DEFINED_LITERALS
inline
namespace
literals
{
inline
u8string_view
operator
""
_u
(
const
char
*
s
,
std
::
size_t
n
)
{
return
u8string_view
(
s
,
n
)
;
return
{
s
,
n
}
;
}
}
#endif
...
...
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