add test for numeric -> string conversions
[folly.git] / folly / Traits.h
index e5f6b38cfcc024a42fd168858fd4f1e2a1e0af3e..47092973cc8c5d7d911b2f16cd736ffc8ffe7870 100644 (file)
@@ -402,6 +402,16 @@ constexpr bool is_negative(T x) {
 template <typename T>
 constexpr bool is_non_positive(T x) { return !x || folly::is_negative(x); }
 
+// same as `x > 0`
+template <typename T>
+constexpr bool is_positive(T x) { return !is_non_positive(x); }
+
+// same as `x >= 0`
+template <typename T>
+constexpr bool is_non_negative(T x) {
+  return !x || is_positive(x);
+}
+
 template <typename RHS, RHS rhs, typename LHS>
 bool less_than(LHS const lhs) {
   return detail::less_than_impl<
@@ -422,8 +432,6 @@ FOLLY_ASSUME_FBVECTOR_COMPATIBLE_3(std::basic_string);
 FOLLY_ASSUME_FBVECTOR_COMPATIBLE_2(std::vector);
 FOLLY_ASSUME_FBVECTOR_COMPATIBLE_2(std::list);
 FOLLY_ASSUME_FBVECTOR_COMPATIBLE_2(std::deque);
-FOLLY_ASSUME_FBVECTOR_COMPATIBLE_4(std::map);
-FOLLY_ASSUME_FBVECTOR_COMPATIBLE_3(std::set);
 FOLLY_ASSUME_FBVECTOR_COMPATIBLE_2(std::unique_ptr);
 FOLLY_ASSUME_FBVECTOR_COMPATIBLE_1(std::shared_ptr);
 FOLLY_ASSUME_FBVECTOR_COMPATIBLE_1(std::function);