template <class T>
using IsSplitTargetType = std::integral_constant<bool,
std::is_arithmetic<T>::value ||
- std::is_same<T, StringPiece>::value>;
+ std::is_same<T, StringPiece>::value ||
+ IsSomeString<T>::value>;
template<bool exact = true,
class Delim,
*/
StringPiece skipWhitespace(StringPiece sp);
-} // namespace folly
-
-// Hash functions to make std::string usable with e.g. hash_map
-//
-// Handle interaction with different C++ standard libraries, which
-// expect these types to be in different namespaces.
-namespace std {
-
-template <class C>
-struct hash<std::basic_string<C> > : private hash<const C*> {
- size_t operator()(const std::basic_string<C> & s) const {
- return hash<const C*>::operator()(s.c_str());
- }
-};
+/**
+ * Fast, in-place lowercasing of ASCII alphabetic characters in strings.
+ * Leaves all other characters unchanged, including those with the 0x80
+ * bit set.
+ * @param str String to convert
+ * @param len Length of str, in bytes
+ */
+void toLowerAscii(char* str, size_t length);
+inline void toLowerAscii(MutableStringPiece str) {
+ toLowerAscii(str.begin(), str.size());
}
-#if FOLLY_HAVE_DEPRECATED_ASSOC
-#if defined(_GLIBCXX_SYMVER) && !defined(__BIONIC__)
-namespace __gnu_cxx {
-
-template <class C>
-struct hash<std::basic_string<C> > : private hash<const C*> {
- size_t operator()(const std::basic_string<C> & s) const {
- return hash<const C*>::operator()(s.c_str());
- }
-};
-
-}
-#endif
-#endif
+} // namespace folly
// Hook into boost's type traits
namespace boost {