mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-02 14:30:10 +00:00
Add default value for None's template argument
This commit is contained in:
parent
d08c4ba84a
commit
4825fb4a0d
12
format.cc
12
format.cc
@ -103,11 +103,11 @@ using fmt::internal::Arg;
|
|||||||
|
|
||||||
// Dummy implementations of strerror_r and strerror_s called if corresponding
|
// Dummy implementations of strerror_r and strerror_s called if corresponding
|
||||||
// system functions are not available.
|
// system functions are not available.
|
||||||
static inline fmt::internal::None<void> strerror_r(int, char *, ...) {
|
static inline fmt::internal::None<> strerror_r(int, char *, ...) {
|
||||||
return fmt::internal::None<void>();
|
return fmt::internal::None<>();
|
||||||
}
|
}
|
||||||
static inline fmt::internal::None<void> strerror_s(char *, std::size_t, ...) {
|
static inline fmt::internal::None<> strerror_s(char *, std::size_t, ...) {
|
||||||
return fmt::internal::None<void>();
|
return fmt::internal::None<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -189,7 +189,7 @@ int safe_strerror(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Handle the case when strerror_r is not available.
|
// Handle the case when strerror_r is not available.
|
||||||
int handle(fmt::internal::None<void>) {
|
int handle(fmt::internal::None<>) {
|
||||||
return fallback(strerror_s(buffer_, buffer_size_, error_code_));
|
return fallback(strerror_s(buffer_, buffer_size_, error_code_));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,7 +201,7 @@ int safe_strerror(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Fallback to strerror if strerror_r and strerror_s are not available.
|
// Fallback to strerror if strerror_r and strerror_s are not available.
|
||||||
int fallback(fmt::internal::None<void>) {
|
int fallback(fmt::internal::None<>) {
|
||||||
errno = 0;
|
errno = 0;
|
||||||
buffer_ = strerror(error_code_);
|
buffer_ = strerror(error_code_);
|
||||||
return errno;
|
return errno;
|
||||||
|
2
format.h
2
format.h
@ -749,7 +749,7 @@ struct Arg : Value {
|
|||||||
Type type;
|
Type type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T = void>
|
||||||
struct None {};
|
struct None {};
|
||||||
|
|
||||||
// A helper class template to enable or disable overloads taking wide
|
// A helper class template to enable or disable overloads taking wide
|
||||||
|
Loading…
Reference in New Issue
Block a user