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
7f7504b3
Commit
7f7504b3
authored
Dec 12, 2018
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up docs
parent
37f599b1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
18 deletions
+11
-18
include/fmt/core.h
include/fmt/core.h
+6
-12
include/fmt/format.h
include/fmt/format.h
+0
-2
include/fmt/printf.h
include/fmt/printf.h
+5
-4
No files found.
include/fmt/core.h
View file @
7f7504b3
...
...
@@ -1301,28 +1301,22 @@ struct wformat_args : basic_format_args<wformat_context> {
:
basic_format_args
<
wformat_context
>
(
std
::
forward
<
Args
>
(
arg
)...)
{}
};
#define FMT_ENABLE_IF_T(B, T) typename std::enable_if<B, T>::type
#ifndef FMT_USE_ALIAS_TEMPLATES
# define FMT_USE_ALIAS_TEMPLATES FMT_HAS_FEATURE(cxx_alias_templates)
#endif
#if FMT_USE_ALIAS_TEMPLATES
/** String's character type. */
template
<
typename
S
>
using
char_t
=
typename
std
::
enable_if
<
internal
::
is_string
<
S
>::
value
,
typename
internal
::
char_t
<
S
>::
type
>::
type
;
using
char_t
=
FMT_ENABLE_IF_T
(
internal
::
is_string
<
S
>::
value
,
typename
internal
::
char_t
<
S
>::
type
)
;
#define FMT_CHAR(S) fmt::char_t<S>
template
<
typename
S
,
typename
T
>
using
enable_if_string_t
=
typename
std
::
enable_if
<
internal
::
is_string
<
S
>::
value
,
T
>::
type
;
#define FMT_ENABLE_IF_STRING(S, T) enable_if_string_t<S, T>
#else
template
<
typename
S
>
struct
char_t
:
std
::
enable_if
<
internal
::
is_string
<
S
>::
value
,
typename
internal
::
char_t
<
S
>::
type
>
{};
#define FMT_CHAR(S) typename char_t<S>::type
#define FMT_ENABLE_IF_STRING(S, T) \
typename std::enable_if<internal::is_string<S>::value, T>::type
#endif
namespace
internal
{
...
...
@@ -1478,7 +1472,7 @@ FMT_API void vprint(std::FILE *f, wstring_view format_str, wformat_args args);
\endrst
*/
template
<
typename
S
,
typename
...
Args
>
inline
FMT_ENABLE_IF_
STRING
(
S
,
void
)
inline
FMT_ENABLE_IF_
T
(
internal
::
is_string
<
S
>::
value
,
void
)
print
(
std
::
FILE
*
f
,
const
S
&
format_str
,
const
Args
&
...
args
)
{
vprint
(
f
,
to_string_view
(
format_str
),
internal
::
checked_args
<
S
,
Args
...
>
(
format_str
,
args
...));
...
...
@@ -1497,7 +1491,7 @@ FMT_API void vprint(wstring_view format_str, wformat_args args);
\endrst
*/
template
<
typename
S
,
typename
...
Args
>
inline
FMT_ENABLE_IF_
STRING
(
S
,
void
)
inline
FMT_ENABLE_IF_
T
(
internal
::
is_string
<
S
>::
value
,
void
)
print
(
const
S
&
format_str
,
const
Args
&
...
args
)
{
vprint
(
to_string_view
(
format_str
),
internal
::
checked_args
<
S
,
Args
...
>
(
format_str
,
args
...));
...
...
include/fmt/format.h
View file @
7f7504b3
...
...
@@ -165,8 +165,6 @@ FMT_END_NAMESPACE
# define FMT_USE_TRAILING_RETURN 0
#endif
#define FMT_ENABLE_IF_T(B, T) typename std::enable_if<B, T>::type
#ifndef FMT_USE_GRISU
# define FMT_USE_GRISU 0
//# define FMT_USE_GRISU std::numeric_limits<double>::is_iec559
...
...
include/fmt/printf.h
View file @
7f7504b3
...
...
@@ -626,7 +626,8 @@ vsprintf(const S &format,
\endrst
*/
template
<
typename
S
,
typename
...
Args
>
inline
FMT_ENABLE_IF_STRING
(
S
,
std
::
basic_string
<
FMT_CHAR
(
S
)
>
)
inline
FMT_ENABLE_IF_T
(
internal
::
is_string
<
S
>::
value
,
std
::
basic_string
<
FMT_CHAR
(
S
)
>
)
sprintf
(
const
S
&
format
,
const
Args
&
...
args
)
{
internal
::
check_format_string
<
Args
...
>
(
format
);
typedef
internal
::
basic_buffer
<
FMT_CHAR
(
S
)
>
buffer
;
...
...
@@ -657,7 +658,7 @@ inline int vfprintf(std::FILE *f, const S &format,
\endrst
*/
template
<
typename
S
,
typename
...
Args
>
inline
FMT_ENABLE_IF_
STRING
(
S
,
int
)
inline
FMT_ENABLE_IF_
T
(
internal
::
is_string
<
S
>::
value
,
int
)
fprintf
(
std
::
FILE
*
f
,
const
S
&
format
,
const
Args
&
...
args
)
{
internal
::
check_format_string
<
Args
...
>
(
format
);
typedef
internal
::
basic_buffer
<
FMT_CHAR
(
S
)
>
buffer
;
...
...
@@ -684,7 +685,7 @@ inline int vprintf(const S &format,
\endrst
*/
template
<
typename
S
,
typename
...
Args
>
inline
FMT_ENABLE_IF_
STRING
(
S
,
int
)
inline
FMT_ENABLE_IF_
T
(
internal
::
is_string
<
S
>::
value
,
int
)
printf
(
const
S
&
format_str
,
const
Args
&
...
args
)
{
internal
::
check_format_string
<
Args
...
>
(
format_str
);
typedef
internal
::
basic_buffer
<
FMT_CHAR
(
S
)
>
buffer
;
...
...
@@ -715,7 +716,7 @@ inline int vfprintf(std::basic_ostream<Char> &os,
\endrst
*/
template
<
typename
S
,
typename
...
Args
>
inline
FMT_ENABLE_IF_
STRING
(
S
,
int
)
inline
FMT_ENABLE_IF_
T
(
internal
::
is_string
<
S
>::
value
,
int
)
fprintf
(
std
::
basic_ostream
<
FMT_CHAR
(
S
)
>
&
os
,
const
S
&
format_str
,
const
Args
&
...
args
)
{
internal
::
check_format_string
<
Args
...
>
(
format_str
);
...
...
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