fixstr::basic_fixed_string::back
#1 |
| |
#2 |
|
Returns reference to the last character in the string.
The function is not provided for empty strings.
note
Note that requires
is used only in the documentation purposes.
In order to support C++17 the implementation uses SFINAE.
#
Return valueReference to the last element.
#
ComplexityConstant.
#
Example// clang-format off#include <fixed_string.hpp>#include <iostream> int main(){ { fixstr::fixed_string s = "Exemplary"; char& back = s.back(); back = 's'; std::cout << s << '\n'; // "Exemplars" } { constexpr const fixstr::fixed_string c = "Exemplary"; char const& back = c.back(); std::cout << back << '\n'; // 'y' }}
Exemplarsy