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
5d487335
Commit
5d487335
authored
Jun 07, 2019
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up value construction
parent
0f0b4286
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
include/fmt/core.h
include/fmt/core.h
+8
-10
No files found.
include/fmt/core.h
View file @
5d487335
...
...
@@ -687,34 +687,32 @@ template <typename Context> class value {
long
double
long_double_value
;
const
void
*
pointer
;
string_value
<
char_type
>
string
;
string_value
<
signed
char
>
sstring
;
string_value
<
unsigned
char
>
ustring
;
custom_value
<
Context
>
custom
;
const
named_arg_base
<
char_type
>*
named_arg
;
};
FMT_CONSTEXPR
value
(
int
val
=
0
)
:
int_value
(
val
)
{}
FMT_CONSTEXPR
value
(
unsigned
val
)
:
uint_value
(
val
)
{}
value
(
long
long
val
)
{
long_long_value
=
val
;
}
value
(
unsigned
long
long
val
)
{
ulong_long_value
=
val
;
}
value
(
double
val
)
{
double_value
=
val
;
}
value
(
long
double
val
)
{
long_double_value
=
val
;
}
value
(
long
long
val
)
:
long_long_value
(
val
)
{
}
value
(
unsigned
long
long
val
)
:
ulong_long_value
(
val
)
{
}
value
(
double
val
)
:
double_value
(
val
)
{
}
value
(
long
double
val
)
:
long_double_value
(
val
)
{
}
value
(
const
char_type
*
val
)
{
string
.
value
=
val
;
}
value
(
const
signed
char
*
val
)
{
static_assert
(
std
::
is_same
<
char
,
char_type
>::
value
,
"incompatible string types"
);
s
string
.
value
=
val
;
s
tring
.
value
=
reinterpret_cast
<
const
char
*>
(
val
)
;
}
value
(
const
unsigned
char
*
val
)
{
static_assert
(
std
::
is_same
<
char
,
char_type
>::
value
,
"incompatible string types"
);
ustring
.
value
=
val
;
string
.
value
=
reinterpret_cast
<
const
char
*>
(
val
)
;
}
value
(
basic_string_view
<
char_type
>
val
)
{
string
.
value
=
val
.
data
();
string
.
size
=
val
.
size
();
}
value
(
const
void
*
val
)
{
pointer
=
val
;
}
value
(
const
void
*
val
)
:
pointer
(
val
)
{
}
template
<
typename
T
>
explicit
value
(
const
T
&
val
)
{
custom
.
value
=
&
val
;
...
...
@@ -727,7 +725,7 @@ template <typename Context> class value {
internal
::
fallback_formatter
<
T
,
char_type
>>>
;
}
value
(
const
named_arg_base
<
char_type
>&
arg
)
{
named_arg
=
&
arg
;
}
value
(
const
named_arg_base
<
char_type
>&
val
)
{
named_arg
=
&
val
;
}
private:
// Formats an argument of a custom type, such as a user-defined class.
...
...
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