fixstr::basic_fixed_string::begin
fixstr::basic_fixed_string::cbegin
#1 |
| |
#2 |
| |
#3 |
|
Returns an iterator to the first character of the fixed string.
begin()
returns a mutable or constant iterator, depending on the constness of *this
.
cbegin()
always returns a constant iterator. It is equivalent to std::as_const(*this).begin()
#
Parameters(none)
#
Return valueIterator to the first character.
#
ComplexityConstant.
#
Example#include <fixed_string.hpp>#include <iostream>#include <string>#include <utility>
int main(){ fixstr::fixed_string s = "Exemplar"; *s.begin() = 'e'; std::cout << s << '\n';
auto i1 = s.cbegin(); std::cout << *i1 << '\n'; // *i1 = 'E'; // error: i1 is a constant iterator
auto i2 = std::as_const(s).begin(); std::cout << *i2 << '\n'; // *i2 = 'E'; // error: i2 is a constant iterator}
exemplaree