Provide a non‐owning reference to a contiguous character sequence.
Synopsis
Declared in <bslstl_stringref.h>
template<class CHAR_TYPE>
class StringRefImp
: public StringRefData<CHAR_TYPE>
Description
This class provides a reference‐semantic‐like (see below) mechanism that allows const std::string values, which are represented externally as either an std::string or null‐terminated c‐style string (or parts thereof), to be treated both uniformly and efficiently when passed as an argument to a function in which the string's length will be needed. The interface of this class provides a subset of accessor methods found on std::string (but none of the manipulators) ‐‐ all of which apply to the referenced string. But, because only non‐modifiable access is afforded to the referenced string value, each of the manipulators on this type ‐‐ assignment in particular ‐‐ apply to this string‐reference object itself (as if it had pointer semantics). Hence, this class has a hybrid of reference‐ and pointer‐semantics.
This class: * supports a complete set of value‐semantic operations
-
except for
bdexserialization * is exception‐neutral (agnostic) * is alias‐safe * isconstthread‐safe For terminology seebsldoc_glossary.
Base Classes
Name |
Description |
This class is an intermediate link between |
Type Aliases
Name |
Description |
Alias for a constant iterator over the characters of this ref. |
|
This |
|
This |
|
This |
|
This |
|
This |
|
Standard Library general container requirements. |
|
Alias for a constant character type stored in this string ref. |
Member Functions
Name |
Description |
|
Constructors |
|
|
Return an iterator to the first character of the referenced string. |
|
Lexicographically compare this string with |
|
Return a pointer to the first character of the referenced string. |
|
Return |
|
Return an iterator past the last character of the referenced string. |
|
Return |
|
Return the length of the string referred to by this object. Note that this call is equivalent to |
|
Return a reference to the character at the specified |
|
Return a reverse iterator to the last character of the string. |
|
Return a reverse iterator before the first character of the string. |
|
Reset this string reference to the empty default‐constructed state. |
|
Return the number of characters in the string referred to by this object. Note that this call is equivalent to |
|
Nested trait declaration for |
|
Nested trait declaration for |
|
Return an |
Static Member Functions
Name |
Description |
Return the number of |
Non-Member Functions
Name |
Description |
Return the concatenation of the specified |
|
Return a |
|
Return the concatenation of the specified |
|
Return the concatenation of the specified string ref and C string. |
Template Parameters
Name |
Description |
CHAR_TYPE |
character type of the referenced character sequence. |
Created with MrDocs