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
bae00aa8
Commit
bae00aa8
authored
Jun 05, 2019
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify is_string
parent
388bb389
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
include/fmt/core.h
include/fmt/core.h
+5
-9
No files found.
include/fmt/core.h
View file @
bae00aa8
...
@@ -392,19 +392,14 @@ FMT_CONSTEXPR basic_string_view<typename S::char_type> to_string_view(
...
@@ -392,19 +392,14 @@ FMT_CONSTEXPR basic_string_view<typename S::char_type> to_string_view(
}
}
namespace
internal
{
namespace
internal
{
struct
dummy_string_view
{
void
to_string_view
(...);
using
char_type
=
void
;
};
dummy_string_view
to_string_view
(...);
using
fmt
::
v5
::
to_string_view
;
using
fmt
::
v5
::
to_string_view
;
// Specifies whether S is a string type convertible to fmt::basic_string_view.
// Specifies whether S is a string type convertible to fmt::basic_string_view.
// It should be a constexpr function but MSVC 2017 fails to compile it in
// It should be a constexpr function but MSVC 2017 fails to compile it in
// enable_if
.
MSVC 2015 fails to compile it as an alias template.
// enable_if
and
MSVC 2015 fails to compile it as an alias template.
template
<
typename
S
>
template
<
typename
S
>
struct
is_string
struct
is_string
:
std
::
is_class
<
decltype
(
to_string_view
(
std
::
declval
<
S
>
()))
>
{
:
bool_constant
<
!
std
::
is_empty
<
decltype
(
to_string_view
(
std
::
declval
<
S
>
()))
>::
value
>
{
};
};
struct
error_handler
{
struct
error_handler
{
...
@@ -603,7 +598,8 @@ struct fallback_formatter {
...
@@ -603,7 +598,8 @@ struct fallback_formatter {
"an operator<< that should be used"
);
"an operator<< that should be used"
);
};
};
template
<
typename
S
>
struct
char_t_impl
{
template
<
typename
S
,
typename
=
void
>
struct
char_t_impl
{};
template
<
typename
S
>
struct
char_t_impl
<
S
,
enable_if_t
<
is_string
<
S
>::
value
>>
{
typedef
decltype
(
to_string_view
(
std
::
declval
<
S
>
()))
result
;
typedef
decltype
(
to_string_view
(
std
::
declval
<
S
>
()))
result
;
typedef
typename
result
::
char_type
type
;
typedef
typename
result
::
char_type
type
;
};
};
...
...
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