llvm::StringRef::StringRef

Constructors

Synopses

Declared in <llvm/ADT/StringRef.h>

Construct an empty string ref.

constexpr
StringRef() = default;
» more...

Disable conversion from nullptr. This prevents things like if (S == nullptr)

StringRef(std::nullptr_t Null) = delete;
» more...

Construct a string ref from an std::string_view.

constexpr
StringRef(std::string_view Str);
» more...

Construct a string ref from an std::string.

StringRef(std::string const& Str);
» more...

Construct a string ref from a cstring.

constexpr
StringRef(char const* Str);
» more...

Construct a string ref from a pointer and length.

constexpr
StringRef(
    char const* data,
    size_t length);
» more...

Parameters

NameDescription
NullUnused; this overload is deleted.
StrView whose data and size are referenced.
dataPointer to the first character.
lengthNumber of characters.