BloombergLP::bslstl::StringRefImp::StringRefImp

Create a string-reference object having a valid std::string value, whose external representation begins at the specified data address and extends for the specified length. The external representation must remain valid as long as it is bound to this string reference. Passing 0 has the same effect as default construction. The behavior is undefined unless 0 <= length and, if 0 == data, then 0 == length. Note that, like an std::string, the data need not be null-terminated and may contain embedded null characters. Note that the template and non-template versions combine to allow various integral and enumeration types to be used for length while preventing (char *, 0) initializer arguments from matching the two-iterator constructor below.

Synopsis

Declared in <bslstl_stringref.h>

template<class INT_TYPE>
StringRefImp(
    CHAR_TYPE const* data,
    INT_TYPE length,
    bslmf::Nil = bslmf::Nil())
requires bsl::is_integral<INT_TYPE>::value;