diff options
-rw-r--r-- | include/llvm/ADT/StringRef.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/llvm/ADT/StringRef.h b/include/llvm/ADT/StringRef.h index 56848fb..6215d3f 100644 --- a/include/llvm/ADT/StringRef.h +++ b/include/llvm/ADT/StringRef.h @@ -90,10 +90,6 @@ namespace llvm { /*implicit*/ StringRef(const std::string &Str) : Data(Str.data()), Length(Str.length()) {} - /// Construct a string ref from a boolean. - explicit StringRef(bool B) - : Data(B ? "true" : "false"), Length(::strlen(Data)) {} - /// @} /// @name Iterators /// @{ @@ -552,6 +548,10 @@ namespace llvm { template <typename T> struct isPodLike; template <> struct isPodLike<StringRef> { static const bool value = true; }; + /// Construct a string ref from a boolean. + inline StringRef toStringRef(bool B) { + return StringRef(B ? "true" : "false"); + } } #endif |