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
9d2221b9
Commit
9d2221b9
authored
Sep 19, 2018
by
Jonathan Müller
Committed by
Victor Zverovich
Sep 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve error message when formatting unknown types
parent
70a6a4bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
include/fmt/core.h
include/fmt/core.h
+14
-1
No files found.
include/fmt/core.h
View file @
9d2221b9
...
...
@@ -340,9 +340,22 @@ class basic_format_arg;
template
<
typename
Context
>
class
basic_format_args
;
template
<
typename
T
>
struct
no_formatter_error
:
std
::
false_type
{};
// A formatter for objects of type T.
template
<
typename
T
,
typename
Char
=
char
,
typename
Enable
=
void
>
struct
formatter
;
struct
formatter
{
static_assert
(
no_formatter_error
<
T
>::
value
,
"don't know how to format the type, include fmt/ostream.h if it provides "
"an operator<< that should be used"
);
// The following functions are not defined intentionally.
template
<
typename
ParseContext
>
typename
ParseContext
::
iterator
parse
(
ParseContext
&
);
template
<
typename
FormatContext
>
auto
format
(
const
T
&
val
,
FormatContext
&
ctx
)
->
decltype
(
ctx
.
out
());
};
template
<
typename
T
,
typename
Char
,
typename
Enable
=
void
>
struct
convert_to_int
{
...
...
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