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
1ec02723
Commit
1ec02723
authored
Oct 22, 2018
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of FMT_UNION
parent
2c81c851
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
13 deletions
+7
-13
include/fmt/format.h
include/fmt/format.h
+7
-13
No files found.
include/fmt/format.h
View file @
1ec02723
...
@@ -178,14 +178,6 @@ FMT_END_NAMESPACE
...
@@ -178,14 +178,6 @@ FMT_END_NAMESPACE
# endif
# endif
#endif
#endif
// A workaround for gcc 4.4 that doesn't support union members with ctors.
#if (FMT_GCC_VERSION && FMT_GCC_VERSION <= 404) || \
(FMT_MSC_VER && FMT_MSC_VER <= 1800)
# define FMT_UNION struct
#else
# define FMT_UNION union
#endif
// Some compilers masquerade as both MSVC and GCC-likes or otherwise support
// Some compilers masquerade as both MSVC and GCC-likes or otherwise support
// __builtin_clz and __builtin_clzll, so only define FMT_BUILTIN_CLZ using the
// __builtin_clz and __builtin_clzll, so only define FMT_BUILTIN_CLZ using the
// MSVC intrinsics if the clz and clzll builtins are not available.
// MSVC intrinsics if the clz and clzll builtins are not available.
...
@@ -1787,7 +1779,8 @@ struct arg_ref {
...
@@ -1787,7 +1779,8 @@ struct arg_ref {
FMT_CONSTEXPR
arg_ref
()
:
kind
(
NONE
),
index
(
0
)
{}
FMT_CONSTEXPR
arg_ref
()
:
kind
(
NONE
),
index
(
0
)
{}
FMT_CONSTEXPR
explicit
arg_ref
(
unsigned
index
)
:
kind
(
INDEX
),
index
(
index
)
{}
FMT_CONSTEXPR
explicit
arg_ref
(
unsigned
index
)
:
kind
(
INDEX
),
index
(
index
)
{}
explicit
arg_ref
(
basic_string_view
<
Char
>
name
)
:
kind
(
NAME
),
name
(
name
)
{}
explicit
arg_ref
(
basic_string_view
<
Char
>
name
)
:
kind
(
NAME
),
name
{
name
.
data
(),
name
.
size
()}
{}
FMT_CONSTEXPR
arg_ref
&
operator
=
(
unsigned
idx
)
{
FMT_CONSTEXPR
arg_ref
&
operator
=
(
unsigned
idx
)
{
kind
=
INDEX
;
kind
=
INDEX
;
...
@@ -1796,9 +1789,9 @@ struct arg_ref {
...
@@ -1796,9 +1789,9 @@ struct arg_ref {
}
}
Kind
kind
;
Kind
kind
;
FMT_UNION
{
union
{
unsigned
index
;
unsigned
index
;
basic_string_view
<
Char
>
name
;
string_value
<
Char
>
name
;
// This is not string_view because of gcc 4.4.
};
};
};
};
...
@@ -2239,7 +2232,8 @@ void handle_dynamic_spec(
...
@@ -2239,7 +2232,8 @@ void handle_dynamic_spec(
break
;
break
;
case
arg_ref
<
char_type
>
:
:
NAME
:
case
arg_ref
<
char_type
>
:
:
NAME
:
internal
::
set_dynamic_spec
<
Handler
>
(
internal
::
set_dynamic_spec
<
Handler
>
(
value
,
ctx
.
get_arg
(
ref
.
name
),
ctx
.
error_handler
());
value
,
ctx
.
get_arg
({
ref
.
name
.
value
,
ref
.
name
.
size
}),
ctx
.
error_handler
());
break
;
break
;
}
}
}
}
...
@@ -2270,7 +2264,7 @@ class arg_formatter:
...
@@ -2270,7 +2264,7 @@ class arg_formatter:
*spec* contains format specifier information for standard argument types.
*spec* contains format specifier information for standard argument types.
\endrst
\endrst
*/
*/
explicit
arg_formatter
(
context_type
&
ctx
,
format_specs
*
spec
=
{}
)
explicit
arg_formatter
(
context_type
&
ctx
,
format_specs
*
spec
=
FMT_NULL
)
:
base
(
Range
(
ctx
.
out
()),
spec
),
ctx_
(
ctx
)
{}
:
base
(
Range
(
ctx
.
out
()),
spec
),
ctx_
(
ctx
)
{}
// Deprecated.
// Deprecated.
...
...
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