Always use noexcept for gcc >= 4.8 because dtors are implicitly noexcept there. Remove binu and 'B' specifier.
This commit is contained in:
parent
43fa564e9b
commit
52b55e1791
23
format.h
23
format.h
@ -49,7 +49,8 @@
|
|||||||
|
|
||||||
// Define FMT_USE_NOEXCEPT to make format use noexcept (C++11 feature).
|
// Define FMT_USE_NOEXCEPT to make format use noexcept (C++11 feature).
|
||||||
#if FMT_USE_NOEXCEPT || \
|
#if FMT_USE_NOEXCEPT || \
|
||||||
(defined(__has_feature) && __has_feature(cxx_noexcept))
|
(defined(__has_feature) && __has_feature(cxx_noexcept)) || \
|
||||||
|
(__GNUC__ >= 4 && __GNUC_MINOR__ >= 8)
|
||||||
# define FMT_NOEXCEPT(expr) noexcept(expr)
|
# define FMT_NOEXCEPT(expr) noexcept(expr)
|
||||||
#else
|
#else
|
||||||
# define FMT_NOEXCEPT(expr)
|
# define FMT_NOEXCEPT(expr)
|
||||||
@ -374,11 +375,6 @@ class IntFormatter : public SpecT {
|
|||||||
*/
|
*/
|
||||||
IntFormatter<int, TypeSpec<'b'> > bin(int value);
|
IntFormatter<int, TypeSpec<'b'> > bin(int value);
|
||||||
|
|
||||||
/**
|
|
||||||
Returns an integer formatter that formats the value in base 2.
|
|
||||||
*/
|
|
||||||
IntFormatter<int, TypeSpec<'B'> > binu(int value);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns an integer formatter that formats the value in base 8.
|
Returns an integer formatter that formats the value in base 8.
|
||||||
*/
|
*/
|
||||||
@ -416,9 +412,7 @@ IntFormatter<int, AlignTypeSpec<TYPE_CODE> > pad(
|
|||||||
inline IntFormatter<TYPE, TypeSpec<'b'> > bin(TYPE value) { \
|
inline IntFormatter<TYPE, TypeSpec<'b'> > bin(TYPE value) { \
|
||||||
return IntFormatter<TYPE, TypeSpec<'b'> >(value, TypeSpec<'b'>()); \
|
return IntFormatter<TYPE, TypeSpec<'b'> >(value, TypeSpec<'b'>()); \
|
||||||
} \
|
} \
|
||||||
inline IntFormatter<TYPE, TypeSpec<'B'> > binu(TYPE value) { \
|
\
|
||||||
return IntFormatter<TYPE, TypeSpec<'B'> >(value, TypeSpec<'B'>()); \
|
|
||||||
} \
|
|
||||||
inline IntFormatter<TYPE, TypeSpec<'o'> > oct(TYPE value) { \
|
inline IntFormatter<TYPE, TypeSpec<'o'> > oct(TYPE value) { \
|
||||||
return IntFormatter<TYPE, TypeSpec<'o'> >(value, TypeSpec<'o'>()); \
|
return IntFormatter<TYPE, TypeSpec<'o'> >(value, TypeSpec<'o'>()); \
|
||||||
} \
|
} \
|
||||||
@ -734,7 +728,7 @@ BasicWriter<Char> &BasicWriter<Char>::operator<<(
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'b': case 'B': {
|
case 'b': {
|
||||||
UnsignedType n = abs_value;
|
UnsignedType n = abs_value;
|
||||||
bool print_prefix = f.hash_flag();
|
bool print_prefix = f.hash_flag();
|
||||||
if (print_prefix) size += 2;
|
if (print_prefix) size += 2;
|
||||||
@ -743,12 +737,11 @@ BasicWriter<Char> &BasicWriter<Char>::operator<<(
|
|||||||
} while ((n >>= 1) != 0);
|
} while ((n >>= 1) != 0);
|
||||||
Char *p = GetBase(PrepareFilledBuffer(size, f, sign));
|
Char *p = GetBase(PrepareFilledBuffer(size, f, sign));
|
||||||
n = abs_value;
|
n = abs_value;
|
||||||
const char *digits = "01";
|
|
||||||
do {
|
do {
|
||||||
*p-- = digits[n & 0x1];
|
*p-- = '0' + (n & 1);
|
||||||
} while ((n >>= 1) != 0);
|
} while ((n >>= 1) != 0);
|
||||||
if (print_prefix) {
|
if (print_prefix) {
|
||||||
*p-- = f.type();
|
*p-- = 'b';
|
||||||
*p = '0';
|
*p = '0';
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1190,8 +1183,8 @@ class FormatInt {
|
|||||||
}
|
}
|
||||||
explicit FormatInt(unsigned value) : str_(FormatDecimal(value)) {}
|
explicit FormatInt(unsigned value) : str_(FormatDecimal(value)) {}
|
||||||
|
|
||||||
inline const char *c_str() const { return str_; }
|
const char *c_str() const { return str_; }
|
||||||
inline std::string str() const { return str_; }
|
std::string str() const { return str_; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user