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
45518c3f
Commit
45518c3f
authored
Feb 28, 2018
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compilation errors on gcc 4.4
parent
698d9097
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
4 deletions
+25
-4
include/fmt/core.h
include/fmt/core.h
+23
-2
include/fmt/format.h
include/fmt/format.h
+2
-2
No files found.
include/fmt/core.h
View file @
45518c3f
...
@@ -72,16 +72,27 @@
...
@@ -72,16 +72,27 @@
# endif
# endif
#endif
#endif
#if FMT_HAS_FEATURE(cxx_explicit_conversions)
# define FMT_EXPLICIT explicit
#else
# define FMT_EXPLICIT
#endif
#ifndef FMT_NULL
#ifndef FMT_NULL
# if FMT_HAS_FEATURE(cxx_nullptr) || \
# if FMT_HAS_FEATURE(cxx_nullptr) || \
(FMT_GCC_VERSION >= 408 && FMT_HAS_GXX_CXX11) || \
(FMT_GCC_VERSION >= 408 && FMT_HAS_GXX_CXX11) || \
FMT_MSC_VER >= 1600
FMT_MSC_VER >= 1600
# define FMT_NULL nullptr
# define FMT_NULL nullptr
# define FMT_USE_NULLPTR 1
# else
# else
# define FMT_NULL NULL
# define FMT_NULL NULL
# endif
# endif
#endif
#endif
#ifndef FMT_USE_NULLPTR
# define FMT_USE_NULLPTR 0
#endif
// Check if exceptions are disabled.
// Check if exceptions are disabled.
#if defined(__GNUC__) && !defined(__EXCEPTIONS)
#if defined(__GNUC__) && !defined(__EXCEPTIONS)
# define FMT_EXCEPTIONS 0
# define FMT_EXCEPTIONS 0
...
@@ -157,6 +168,11 @@
...
@@ -157,6 +168,11 @@
#endif
#endif
namespace
fmt
{
namespace
fmt
{
// An implementation of declval for pre-C++11 compilers such as gcc 4.
template
<
typename
T
>
typename
std
::
add_rvalue_reference
<
T
>::
type
declval
()
FMT_NOEXCEPT
;
/**
/**
\rst
\rst
An implementation of ``std::basic_string_view`` for pre-C++17. It provides a
An implementation of ``std::basic_string_view`` for pre-C++17. It provides a
...
@@ -284,6 +300,8 @@ class basic_buffer {
...
@@ -284,6 +300,8 @@ class basic_buffer {
std
::
size_t
capacity_
;
std
::
size_t
capacity_
;
protected:
protected:
typedef
const
T
&
const_reference
;
basic_buffer
(
T
*
p
=
FMT_NULL
,
std
::
size_t
size
=
0
,
std
::
size_t
capacity
=
0
)
basic_buffer
(
T
*
p
=
FMT_NULL
,
std
::
size_t
size
=
0
,
std
::
size_t
capacity
=
0
)
FMT_NOEXCEPT:
ptr_
(
p
),
size_
(
size
),
capacity_
(
capacity
)
{}
FMT_NOEXCEPT:
ptr_
(
p
),
size_
(
size
),
capacity_
(
capacity
)
{}
...
@@ -594,7 +612,10 @@ FMT_MAKE_VALUE(string_type, const std::basic_string<typename C::char_type>&,
...
@@ -594,7 +612,10 @@ FMT_MAKE_VALUE(string_type, const std::basic_string<typename C::char_type>&,
basic_string_view
<
Char
>
)
basic_string_view
<
Char
>
)
FMT_MAKE_VALUE
(
pointer_type
,
void
*
,
const
void
*
)
FMT_MAKE_VALUE
(
pointer_type
,
void
*
,
const
void
*
)
FMT_MAKE_VALUE
(
pointer_type
,
const
void
*
,
const
void
*
)
FMT_MAKE_VALUE
(
pointer_type
,
const
void
*
,
const
void
*
)
#if FMT_USE_NULLPTR
FMT_MAKE_VALUE
(
pointer_type
,
std
::
nullptr_t
,
const
void
*
)
FMT_MAKE_VALUE
(
pointer_type
,
std
::
nullptr_t
,
const
void
*
)
#endif
// Formatting of arbitrary pointers is disallowed. If you want to output a
// Formatting of arbitrary pointers is disallowed. If you want to output a
// pointer cast it to "void *" or "const void *". In particular, this forbids
// pointer cast it to "void *" or "const void *". In particular, this forbids
...
@@ -667,7 +688,7 @@ class basic_arg {
...
@@ -667,7 +688,7 @@ class basic_arg {
FMT_CONSTEXPR
basic_arg
()
:
type_
(
internal
::
none_type
)
{}
FMT_CONSTEXPR
basic_arg
()
:
type_
(
internal
::
none_type
)
{}
explicit
operator
bool
()
const
FMT_NOEXCEPT
{
FMT_EXPLICIT
operator
bool
()
const
FMT_NOEXCEPT
{
return
type_
!=
internal
::
none_type
;
return
type_
!=
internal
::
none_type
;
}
}
...
@@ -891,7 +912,7 @@ template <typename Context, typename T>
...
@@ -891,7 +912,7 @@ template <typename Context, typename T>
class
get_type
{
class
get_type
{
public:
public:
typedef
decltype
(
make_value
<
Context
>
(
typedef
decltype
(
make_value
<
Context
>
(
std
::
declval
<
typename
std
::
decay
<
T
>::
type
&>
()))
value_type
;
declval
<
typename
std
::
decay
<
T
>::
type
&>
()))
value_type
;
static
const
type
value
=
value_type
::
type_tag
;
static
const
type
value
=
value_type
::
type_tag
;
};
};
...
...
include/fmt/format.h
View file @
45518c3f
...
@@ -2093,7 +2093,7 @@ template <typename Range>
...
@@ -2093,7 +2093,7 @@ template <typename Range>
class
arg_formatter
:
public
internal
::
arg_formatter_base
<
Range
>
{
class
arg_formatter
:
public
internal
::
arg_formatter_base
<
Range
>
{
private:
private:
typedef
typename
Range
::
value_type
char_type
;
typedef
typename
Range
::
value_type
char_type
;
typedef
decltype
(
std
::
declval
<
Range
>
().
begin
())
iterator
;
typedef
decltype
(
declval
<
Range
>
().
begin
())
iterator
;
typedef
internal
::
arg_formatter_base
<
Range
>
base
;
typedef
internal
::
arg_formatter_base
<
Range
>
base
;
typedef
basic_context
<
iterator
,
char_type
>
context_type
;
typedef
basic_context
<
iterator
,
char_type
>
context_type
;
...
@@ -2191,7 +2191,7 @@ template <typename Range>
...
@@ -2191,7 +2191,7 @@ template <typename Range>
class
basic_writer
{
class
basic_writer
{
public:
public:
typedef
typename
Range
::
value_type
char_type
;
typedef
typename
Range
::
value_type
char_type
;
typedef
decltype
(
std
::
declval
<
Range
>
().
begin
())
iterator
;
typedef
decltype
(
declval
<
Range
>
().
begin
())
iterator
;
typedef
basic_format_specs
<
char_type
>
format_specs
;
typedef
basic_format_specs
<
char_type
>
format_specs
;
private:
private:
...
...
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