[ Web Proxy ]
URL:
Viewing: http://ja.cppreference.com/cpp/string/basic_string/rbegin [Back]  [Original]

std::basic_string<CharT,Traits,Allocator>::rbegin, std::basic_string<CharT,Traits,Allocator>::crbegin - cppreference.com
cppreference.com

std::basic_string<CharT,Traits,Allocator>::rbegin, std::basic_string<CharT,Traits,Allocator>::crbegin

: cppreference.com
 
C++
(C++20)
(C++20)
(C++17)
(C++11)
(C++11)
(C++11)
 
 
std::basic_string
 
<tbody> </tbody> <tbody class="t-dcl-rev t-dcl-rev-num "> </tbody><tbody> </tbody> <tbody class="t-dcl-rev t-dcl-rev-num "> </tbody><tbody> </tbody> <tbody class="t-dcl-rev t-dcl-rev-num "> </tbody><tbody> </tbody>
(1)
reverse_iterator rbegin();
(C++11)
reverse_iterator rbegin() noexcept;
(C++11)
(C++20)
constexpr reverse_iterator rbegin() noexcept;
(C++20)
(2)
const_reverse_iterator rbegin() const;
(C++11)
const_reverse_iterator rbegin() const noexcept;
(C++11)
(C++20)
constexpr const_reverse_iterator rbegin() const noexcept;
(C++20)
(3)
const_reverse_iterator crbegin() const noexcept;
(C++11)
(C++20)
constexpr const_reverse_iterator crbegin() const noexcept;
(C++20)

()

#include <iostream>
#include <algorithm>
#include <iterator>
#include <string>

int main()
{
    std::string s("Exemplar!");
    *s.rbegin() = 'y';
    std::cout << s << '\n'; // "Exemplary"
 
    std::string c;
    std::copy(s.crbegin(), s.crend(), std::back_inserter(c));
    std::cout << c << '\n'; // "yralpmexE"
}

:

Exemplary
yralpmexE


() [edit]

Web Proxy Viewer  |  New URL  |  Original Page