Add TimedDrivableExecutor to folly.
[folly.git] / folly / String.cpp
index 0fb3f32593f8583341521650614d4601d28cac4e..21b762ab5f966ba2b12f0c93eb0b70b499244e32 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2012-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 namespace folly {
 
+static_assert(IsConvertible<float>::value, "");
+static_assert(IsConvertible<int>::value, "");
+static_assert(IsConvertible<bool>::value, "");
+static_assert(IsConvertible<int>::value, "");
+static_assert(!IsConvertible<std::vector<int>>::value, "");
+
 static inline bool is_oddspace(char c) {
   return c == '\n' || c == '\t' || c == '\r';
 }
@@ -181,7 +187,7 @@ const PrettySuffix kPrettyTimeSuffixes[] = {
   { "ns", 1e-9L },
   { "ps", 1e-12L },
   { "s ", 0 },
-  { 0, 0 },
+  { nullptr, 0 },
 };
 
 const PrettySuffix kPrettyBytesMetricSuffixes[] = {
@@ -190,7 +196,7 @@ const PrettySuffix kPrettyBytesMetricSuffixes[] = {
   { "MB", 1e6L },
   { "kB", 1e3L },
   { "B ", 0L },
-  { 0, 0 },
+  { nullptr, 0 },
 };
 
 const PrettySuffix kPrettyBytesBinarySuffixes[] = {
@@ -199,7 +205,7 @@ const PrettySuffix kPrettyBytesBinarySuffixes[] = {
   { "MB", int64_t(1) << 20 },
   { "kB", int64_t(1) << 10 },
   { "B ", 0L },
-  { 0, 0 },
+  { nullptr, 0 },
 };
 
 const PrettySuffix kPrettyBytesBinaryIECSuffixes[] = {
@@ -208,7 +214,7 @@ const PrettySuffix kPrettyBytesBinaryIECSuffixes[] = {
   { "MiB", int64_t(1) << 20 },
   { "KiB", int64_t(1) << 10 },
   { "B  ", 0L },
-  { 0, 0 },
+  { nullptr, 0 },
 };
 
 const PrettySuffix kPrettyUnitsMetricSuffixes[] = {
@@ -217,7 +223,7 @@ const PrettySuffix kPrettyUnitsMetricSuffixes[] = {
   { "M",    1e6L },
   { "k",    1e3L },
   { " ",      0  },
-  { 0, 0 },
+  { nullptr, 0 },
 };
 
 const PrettySuffix kPrettyUnitsBinarySuffixes[] = {
@@ -226,7 +232,7 @@ const PrettySuffix kPrettyUnitsBinarySuffixes[] = {
   { "M", int64_t(1) << 20 },
   { "k", int64_t(1) << 10 },
   { " ", 0 },
-  { 0, 0 },
+  { nullptr, 0 },
 };
 
 const PrettySuffix kPrettyUnitsBinaryIECSuffixes[] = {
@@ -235,7 +241,7 @@ const PrettySuffix kPrettyUnitsBinaryIECSuffixes[] = {
   { "Mi", int64_t(1) << 20 },
   { "Ki", int64_t(1) << 10 },
   { "  ", 0 },
-  { 0, 0 },
+  { nullptr, 0 },
 };
 
 const PrettySuffix kPrettySISuffixes[] = {
@@ -260,7 +266,7 @@ const PrettySuffix kPrettySISuffixes[] = {
   { "z", 1e-21L },
   { "y", 1e-24L },
   { " ", 0 },
-  { 0, 0}
+  { nullptr, 0}
 };
 
 const PrettySuffix* const kPrettySuffixes[PRETTY_NUM_TYPES] = {