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.
Synopsis
Declared in <bslstl_stringref.h>
template<class CHAR_TYPE>
class StringRefImp
: public StringRefData<CHAR_TYPE>
Description
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 STL‐compatible iterator to the first character of the string bound to this string reference or |
|
Compare this and the specified |
|
Return the address of the first character of the string bound to this string reference such that |
|
Return |
|
Return an STL‐compatible iterator one‐past‐the‐last character of the string bound to this string reference or |
|
Return |
|
Return the length of the string referred to by this object. Note that this call is equivalent to |
|
Return a reference providing a non‐modifiable access to the character at the specified |
|
Return an STL‐compatible reverse iterator to the last character of the string bound to this string reference or |
|
Return an STL‐compatible reverse iterator to the prior‐to‐the‐beginning character of the string bound to this string reference or |
|
Reset this string reference to the default‐constructed state having an empty |
|
Return the number of characters in the string referred to by this object. Note that this call is equivalent to |
|
Declare |
|
Nested trait declaration for |
|
Return an |
Static Member Functions
Name |
Description |
Return the number of |
Specializations
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. |
Created with MrDocs