* C++, use cEscape instead. This function is for display purposes
* only.
*/
-template <class String1, class String2>
-void backslashify(const String1& input, String2& output, bool hex_style=false);
+template <class OutputString>
+void backslashify(
+ folly::StringPiece input,
+ OutputString& output,
+ bool hex_style = false);
-template <class String>
-String backslashify(const String& input, bool hex_style=false) {
- String output;
+template <class OutputString = std::string>
+OutputString backslashify(StringPiece input, bool hex_style = false) {
+ OutputString output;
backslashify(input, output, hex_style);
return output;
}
* Note that this will likely not work if the last field's target is of numeric
* type, in which case folly::to<> will throw an exception.
*/
-template <class T, class Enable = void>
-struct IsSomeVector {
- enum { value = false };
-};
-
-template <class T>
-struct IsSomeVector<std::vector<T>, void> {
- enum { value = true };
-};
-
-template <class T>
-struct IsSomeVector<fbvector<T>, void> {
- enum { value = true };
-};
-
template <class T, class Enable = void>
struct IsConvertible {
enum { value = false };