#define X(name, r, bit) \
FOLLY_ALWAYS_INLINE bool name() const { \
- return (r) & (1U << bit); \
+ return ((r) & (1U << bit)) != 0; \
}
// cpuid(1): Processor Info and Feature Bits.
if (e[-1] == ']') {
--e;
p = static_cast<const char*>(memchr(b, '[', size_t(e - b)));
- enforce(p, "unmatched ']'");
+ enforce(p != nullptr, "unmatched ']'");
} else {
p = static_cast<const char*>(memchr(b, '.', size_t(e - b)));
}
}
inline bool dynamic::isString() const {
- return get_nothrow<std::string>();
-}
-inline bool dynamic::isObject() const { return get_nothrow<ObjectImpl>(); }
-inline bool dynamic::isBool() const { return get_nothrow<bool>(); }
-inline bool dynamic::isArray() const { return get_nothrow<Array>(); }
-inline bool dynamic::isDouble() const { return get_nothrow<double>(); }
-inline bool dynamic::isInt() const { return get_nothrow<int64_t>(); }
-inline bool dynamic::isNull() const { return get_nothrow<void*>(); }
-inline bool dynamic::isNumber() const { return isInt() || isDouble(); }
+ return get_nothrow<std::string>() != nullptr;
+}
+inline bool dynamic::isObject() const {
+ return get_nothrow<ObjectImpl>() != nullptr;
+}
+inline bool dynamic::isBool() const {
+ return get_nothrow<bool>() != nullptr;
+}
+inline bool dynamic::isArray() const {
+ return get_nothrow<Array>() != nullptr;
+}
+inline bool dynamic::isDouble() const {
+ return get_nothrow<double>() != nullptr;
+}
+inline bool dynamic::isInt() const {
+ return get_nothrow<int64_t>() != nullptr;
+}
+inline bool dynamic::isNull() const {
+ return get_nothrow<void*>() != nullptr;
+}
+inline bool dynamic::isNumber() const {
+ return isInt() || isDouble();
+}
inline dynamic::Type dynamic::type() const {
return type_;