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
469a4bbd
Commit
469a4bbd
authored
Jun 04, 2019
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use enable_if_t
parent
d2ee5f24
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
18 deletions
+12
-18
include/fmt/chrono.h
include/fmt/chrono.h
+3
-4
include/fmt/format.h
include/fmt/format.h
+3
-3
include/fmt/ostream.h
include/fmt/ostream.h
+4
-6
include/fmt/ranges.h
include/fmt/ranges.h
+2
-5
No files found.
include/fmt/chrono.h
View file @
469a4bbd
...
...
@@ -413,16 +413,15 @@ template <typename T> struct make_unsigned_or_unchanged<T, true> {
};
template
<
typename
Rep
,
typename
Period
,
typename
std
::
enable_if
<
std
::
is_integral
<
Rep
>
::
value
,
int
>::
type
=
0
>
FMT_ENABLE_IF
(
std
::
is_integral
<
Rep
>
::
value
)
>
inline
std
::
chrono
::
duration
<
Rep
,
std
::
milli
>
get_milliseconds
(
std
::
chrono
::
duration
<
Rep
,
Period
>
d
)
{
auto
s
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
seconds
>
(
d
);
return
std
::
chrono
::
duration_cast
<
std
::
chrono
::
milliseconds
>
(
d
-
s
);
}
template
<
typename
Rep
,
typename
Period
,
typename
std
::
enable_if
<
std
::
is_floating_point
<
Rep
>
::
value
,
int
>::
type
=
0
>
template
<
typename
Rep
,
typename
Period
,
FMT_ENABLE_IF
(
std
::
is_floating_point
<
Rep
>
::
value
)
>
inline
std
::
chrono
::
duration
<
Rep
,
std
::
milli
>
get_milliseconds
(
std
::
chrono
::
duration
<
Rep
,
Period
>
d
)
{
return
std
::
chrono
::
duration
<
Rep
,
std
::
milli
>
(
...
...
include/fmt/format.h
View file @
469a4bbd
...
...
@@ -3047,9 +3047,9 @@ class format_int {
// Formatter of objects of type T.
template
<
typename
T
,
typename
Char
>
struct
formatter
<
T
,
Char
,
typename
std
::
enable_if
<
internal
::
format_type
<
buffer_context
<
Char
>
,
T
>::
value
>::
type
>
{
struct
formatter
<
T
,
Char
,
enable_if_t
<
internal
::
format_type
<
buffer_context
<
Char
>
,
T
>::
value
>
>
{
FMT_CONSTEXPR
formatter
()
:
format_str_
(
nullptr
)
{}
// Parses format specifiers stopping either at the end of the range or at the
...
...
include/fmt/ostream.h
View file @
469a4bbd
...
...
@@ -96,9 +96,8 @@ void format_value(buffer<Char>& buf, const T& value) {
// Formats an object of type T that has an overloaded ostream operator<<.
template
<
typename
T
,
typename
Char
>
struct
fallback_formatter
<
T
,
Char
,
typename
std
::
enable_if
<
internal
::
is_streamable
<
T
,
Char
>::
value
>::
type
>
struct
fallback_formatter
<
T
,
Char
,
enable_if_t
<
internal
::
is_streamable
<
T
,
Char
>::
value
>>
:
formatter
<
basic_string_view
<
Char
>
,
Char
>
{
template
<
typename
Context
>
auto
format
(
const
T
&
value
,
Context
&
ctx
)
->
decltype
(
ctx
.
out
())
{
...
...
@@ -113,9 +112,8 @@ struct fallback_formatter<
// Disable conversion to int if T has an overloaded operator<< which is a free
// function (not a member of std::ostream).
template
<
typename
T
,
typename
Char
>
struct
convert_to_int
<
T
,
Char
,
typename
std
::
enable_if
<
internal
::
is_streamable
<
T
,
Char
>::
value
>::
type
>
{
struct
convert_to_int
<
T
,
Char
,
enable_if_t
<
internal
::
is_streamable
<
T
,
Char
>::
value
>>
{
static
const
bool
value
=
false
;
};
...
...
include/fmt/ranges.h
View file @
469a4bbd
...
...
@@ -194,9 +194,7 @@ template <typename T> struct is_tuple_like {
};
template
<
typename
TupleT
,
typename
Char
>
struct
formatter
<
TupleT
,
Char
,
typename
std
::
enable_if
<
fmt
::
is_tuple_like
<
TupleT
>::
value
>::
type
>
{
struct
formatter
<
TupleT
,
Char
,
enable_if_t
<
fmt
::
is_tuple_like
<
TupleT
>::
value
>>
{
private:
// C++11 generic lambda for format()
template
<
typename
FormatContext
>
struct
format_each
{
...
...
@@ -250,8 +248,7 @@ template <typename T> struct is_range {
};
template
<
typename
RangeT
,
typename
Char
>
struct
formatter
<
RangeT
,
Char
,
typename
std
::
enable_if
<
fmt
::
is_range
<
RangeT
>::
value
>::
type
>
{
struct
formatter
<
RangeT
,
Char
,
enable_if_t
<
fmt
::
is_range
<
RangeT
>::
value
>>
{
formatting_range
<
Char
>
formatting
;
template
<
typename
ParseContext
>
...
...
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