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
f57227a1
Commit
f57227a1
authored
May 31, 2019
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FMT_ENABLE_IF -> enable_if_t
parent
634f707f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
include/fmt/core.h
include/fmt/core.h
+5
-5
include/fmt/format-inl.h
include/fmt/format-inl.h
+2
-2
include/fmt/format.h
include/fmt/format.h
+1
-1
No files found.
include/fmt/core.h
View file @
f57227a1
...
...
@@ -187,11 +187,6 @@
# define FMT_ASSERT(condition, message) assert((condition) && message)
#endif
// An enable_if helper to be used in template parameters. enable_if in template
// parameters results in much shorter symbols: https://godbolt.org/z/sWw4vP.
#define FMT_ENABLE_IF_T(...) typename std::enable_if<(__VA_ARGS__), int>::type
#define FMT_ENABLE_IF(...) FMT_ENABLE_IF_T(__VA_ARGS__) = 0
// libc++ supports string_view in pre-c++17.
#if (FMT_HAS_INCLUDE(<string_view>) && \
(__cplusplus > 201402L || defined(_LIBCPP_VERSION))) || \
...
...
@@ -215,6 +210,11 @@ using std_string_view = std::experimental::basic_string_view<Char>;
template
<
typename
T
>
struct
std_string_view
{};
#endif
// An enable_if helper to be used in template parameters. enable_if in template
// parameters results in much shorter symbols: https://godbolt.org/z/sWw4vP.
template
<
bool
B
>
using
enable_if_t
=
typename
std
::
enable_if
<
B
,
int
>::
type
;
#define FMT_ENABLE_IF(...) internal::enable_if_t<__VA_ARGS__> = 0
#if (__cplusplus >= 201703L || \
(defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)) && \
__cpp_lib_is_invocable >= 201703L
...
...
include/fmt/format-inl.h
View file @
f57227a1
...
...
@@ -223,7 +223,7 @@ template <typename Locale> Locale locale_ref::get() const {
}
template
<
typename
Char
>
FMT_FUNC
Char
thousands_sep_impl
(
locale_ref
loc
)
{
return
std
::
use_facet
<
std
::
numpunct
<
Char
>
>
(
loc
.
get
<
std
::
locale
>
())
return
std
::
use_facet
<
std
::
numpunct
<
Char
>>
(
loc
.
get
<
std
::
locale
>
())
.
thousands_sep
();
}
}
// namespace internal
...
...
@@ -683,7 +683,7 @@ template <int GRISU_VERSION> struct grisu_shortest_handler {
}
};
template
<
typename
Double
,
FMT_ENABLE_IF_T
(
sizeof
(
Double
)
==
sizeof
(
uint64_t
))
>
template
<
typename
Double
,
enable_if_t
<
sizeof
(
Double
)
==
sizeof
(
uint64_t
)>
>
FMT_API
bool
grisu_format
(
Double
value
,
buffer
<
char
>&
buf
,
int
precision
,
unsigned
options
,
int
&
exp
)
{
FMT_ASSERT
(
value
>=
0
,
"value is negative"
);
...
...
include/fmt/format.h
View file @
f57227a1
...
...
@@ -2238,7 +2238,7 @@ FMT_CONSTEXPR bool do_check_format_string(basic_string_view<Char> s,
}
template
<
typename
...
Args
,
typename
S
,
FMT_ENABLE_IF_T
(
is_compile_string
<
S
>
::
value
)
>
internal
::
enable_if_t
<
is_compile_string
<
S
>
::
value
>
>
void
check_format_string
(
S
format_str
)
{
typedef
typename
S
::
char_type
char_t
;
FMT_CONSTEXPR_DECL
bool
invalid_format
=
...
...
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