fixstr::basic_fixed_string::front
#1 |
| |
#2 |
|
Returns reference to the first 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 first element.
#
ComplexityConstant.
#
Example// clang-format off#include <fixed_string.hpp>#include <iostream>
int main(){ { fixstr::fixed_string s = "Exemplary"; char& f = s.front(); f = 'e'; std::cout << s << '\n'; // "exemplary" }
{ constexpr const fixstr::fixed_string c = "Exemplary"; char const& f = c.front(); std::cout << &f << '\n'; // "Exemplary" }}
exemplaryExemplary