/*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
/// @{
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