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
1b452538
Commit
1b452538
authored
Feb 28, 2018
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix more compilation errors on gcc 4.6
parent
6090e51b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
3 deletions
+9
-3
include/fmt/format.h
include/fmt/format.h
+2
-1
include/fmt/ostream.h
include/fmt/ostream.h
+3
-1
include/fmt/printf.h
include/fmt/printf.h
+1
-1
test/format-test.cc
test/format-test.cc
+3
-0
No files found.
include/fmt/format.h
View file @
1b452538
...
@@ -2658,7 +2658,8 @@ void basic_writer<Range>::write_double(T value, const format_specs &spec) {
...
@@ -2658,7 +2658,8 @@ void basic_writer<Range>::write_double(T value, const format_specs &spec) {
}
}
auto
write_inf_or_nan
=
[
this
,
&
spec
,
sign
](
const
char
*
str
)
{
auto
write_inf_or_nan
=
[
this
,
&
spec
,
sign
](
const
char
*
str
)
{
write_padded
(
INF_SIZE
+
(
sign
?
1
:
0
),
spec
,
inf_or_nan_writer
{
sign
,
str
});
this
->
write_padded
(
INF_SIZE
+
(
sign
?
1
:
0
),
spec
,
inf_or_nan_writer
{
sign
,
str
});
};
};
// Format NaN and ininity ourselves because sprintf's output is not consistent
// Format NaN and ininity ourselves because sprintf's output is not consistent
...
...
include/fmt/ostream.h
View file @
1b452538
...
@@ -67,8 +67,10 @@ class convert_to_int<T, Char, true> {
...
@@ -67,8 +67,10 @@ class convert_to_int<T, Char, true> {
template
<
typename
>
template
<
typename
>
static
std
::
false_type
test
(...);
static
std
::
false_type
test
(...);
typedef
decltype
(
test
<
T
>
(
0
))
result
;
public:
public:
static
const
bool
value
=
!
decltype
(
test
<
T
>
(
0
))
::
value
;
static
const
bool
value
=
!
result
::
value
;
};
};
// Write the content of buf to os.
// Write the content of buf to os.
...
...
include/fmt/printf.h
View file @
1b452538
...
@@ -290,7 +290,7 @@ class printf_arg_formatter : public internal::arg_formatter_base<Range> {
...
@@ -290,7 +290,7 @@ class printf_arg_formatter : public internal::arg_formatter_base<Range> {
template
<
typename
T
>
template
<
typename
T
>
struct
printf_formatter
{
struct
printf_formatter
{
template
<
typename
ParseContext
>
template
<
typename
ParseContext
>
auto
parse
(
ParseContext
&
ctx
)
{
return
ctx
.
begin
();
}
auto
parse
(
ParseContext
&
ctx
)
->
decltype
(
ctx
.
begin
())
{
return
ctx
.
begin
();
}
template
<
typename
FormatContext
>
template
<
typename
FormatContext
>
auto
format
(
const
T
&
value
,
FormatContext
&
ctx
)
->
decltype
(
ctx
.
begin
())
{
auto
format
(
const
T
&
value
,
FormatContext
&
ctx
)
->
decltype
(
ctx
.
begin
())
{
...
...
test/format-test.cc
View file @
1b452538
...
@@ -137,6 +137,8 @@ TEST(StringViewTest, Ctor) {
...
@@ -137,6 +137,8 @@ TEST(StringViewTest, Ctor) {
EXPECT_EQ
(
4u
,
string_view
(
std
::
string
(
"defg"
)).
size
());
EXPECT_EQ
(
4u
,
string_view
(
std
::
string
(
"defg"
)).
size
());
}
}
// GCC 4.6 doesn't have std::is_copy_*.
#if FMT_GCC_VERSION && FMT_GCC_VERSION >= 407
TEST
(
WriterTest
,
NotCopyConstructible
)
{
TEST
(
WriterTest
,
NotCopyConstructible
)
{
EXPECT_FALSE
(
std
::
is_copy_constructible
<
fmt
::
writer
>::
value
);
EXPECT_FALSE
(
std
::
is_copy_constructible
<
fmt
::
writer
>::
value
);
}
}
...
@@ -144,6 +146,7 @@ TEST(WriterTest, NotCopyConstructible) {
...
@@ -144,6 +146,7 @@ TEST(WriterTest, NotCopyConstructible) {
TEST
(
WriterTest
,
NotCopyAssignable
)
{
TEST
(
WriterTest
,
NotCopyAssignable
)
{
EXPECT_FALSE
(
std
::
is_copy_assignable
<
fmt
::
writer
>::
value
);
EXPECT_FALSE
(
std
::
is_copy_assignable
<
fmt
::
writer
>::
value
);
}
}
#endif
TEST
(
WriterTest
,
Data
)
{
TEST
(
WriterTest
,
Data
)
{
memory_buffer
buf
;
memory_buffer
buf
;
...
...
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