Add default value for None's template argument

This commit is contained in:
vitaut 2015-03-16 08:43:33 -07:00
parent d08c4ba84a
commit 4825fb4a0d
2 changed files with 7 additions and 7 deletions

View File

@ -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;

View File

@ -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