mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-05 02:27:45 +00:00
Improve compatibility with bcc32
This commit is contained in:
parent
e5d599875c
commit
ee3e68dc16
12
format.h
12
format.h
@ -967,6 +967,13 @@ struct Conditional { typedef T type; };
|
|||||||
template<class T, class F>
|
template<class T, class F>
|
||||||
struct Conditional<false, T, F> { typedef F type; };
|
struct Conditional<false, T, F> { typedef F type; };
|
||||||
|
|
||||||
|
// For bcc32 which doesn't understand ! in template argumetns.
|
||||||
|
template<bool>
|
||||||
|
struct Not { enum { value = 0 }; };
|
||||||
|
|
||||||
|
template<>
|
||||||
|
struct Not<false> { enum { value = 1 }; };
|
||||||
|
|
||||||
// A helper function to suppress bogus "conditional expression is constant"
|
// A helper function to suppress bogus "conditional expression is constant"
|
||||||
// warnings.
|
// warnings.
|
||||||
template <typename T>
|
template <typename T>
|
||||||
@ -1100,7 +1107,8 @@ class MakeValue : public Arg {
|
|||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
MakeValue(const T &value,
|
MakeValue(const T &value,
|
||||||
typename EnableIf<IsConvertibleToInt<T>::value == 0, int>::type = 0) {
|
typename EnableIf<Not<
|
||||||
|
IsConvertibleToInt<T>::value>::value, int>::type = 0) {
|
||||||
custom.value = &value;
|
custom.value = &value;
|
||||||
custom.format = &format_custom_arg<T>;
|
custom.format = &format_custom_arg<T>;
|
||||||
}
|
}
|
||||||
@ -1428,7 +1436,7 @@ class BasicFormatter : private internal::FormatterBase {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
BasicFormatter(const ArgList &args, BasicWriter<Char> &w)
|
BasicFormatter(const ArgList &args, BasicWriter<Char> &w)
|
||||||
: FormatterBase(args), writer_(w) {}
|
: internal::FormatterBase(args), writer_(w) {}
|
||||||
|
|
||||||
BasicWriter<Char> &writer() { return writer_; }
|
BasicWriter<Char> &writer() { return writer_; }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user