#include <string>
#include <utility>
-#include <folly/Hash.h>
-#include <folly/Malloc.h>
#include <folly/Traits.h>
+#include <folly/hash/Hash.h>
+#include <folly/memory/Malloc.h>
#include <folly/portability/BitsFunctexcept.h>
// When used in folly, assertions are not disabled.
}
basic_fbstring& assign(const basic_fbstring& str) {
- if (&str == this) return *this;
+ if (&str == this) {
+ return *this;
+ }
return assign(str.data(), str.size());
}
}
const_iterator i(begin() + pos), finish(end());
for (; i != finish; ++i) {
- if (traits_type::find(s, n, *i) != 0) {
+ if (traits_type::find(s, n, *i) != nullptr) {
return i - begin();
}
}
pos = std::min(pos, length() - 1);
const_iterator i(begin() + pos);
for (;; --i) {
- if (traits_type::find(s, n, *i) != 0) {
+ if (traits_type::find(s, n, *i) != nullptr) {
return i - begin();
}
if (i == begin()) {
if (pos < length()) {
const_iterator i(begin() + pos), finish(end());
for (; i != finish; ++i) {
- if (traits_type::find(s, n, *i) == 0) {
+ if (traits_type::find(s, n, *i) == nullptr) {
return i - begin();
}
}
pos = std::min(pos, size() - 1);
const_iterator i(begin() + pos);
for (;; --i) {
- if (traits_type::find(s, n, *i) == 0) {
+ if (traits_type::find(s, n, *i) == nullptr) {
return i - begin();
}
if (i == begin()) {
#undef FBSTRING_LIKELY
#undef FBSTRING_UNLIKELY
#undef FBSTRING_ASSERT
+
+#ifndef _LIBSTDCXX_FBSTRING
+namespace folly {
+template <class T>
+struct IsSomeString;
+
+template <>
+struct IsSomeString<fbstring> : std::true_type {};
+} // namespace folly
+#endif