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

std::basic_string<CharT,Traits,Allocator>::rend, std::basic_string<CharT,Traits,Allocator>::crend cppreference.com
cppreference.com

std::basic_string<CharT,Traits,Allocator>::rend, std::basic_string<CharT,Traits,Allocator>::crend

cppreference.com
 
C++
(C++20)
(C++20)
(C++11)
(C++20)
/
(C++11)
(C++11)
(C++11)
(C++17)
 
 
std::basic_string
-
(C++17)
,
/
( C++20)( C++20)( C++20)( C++20)( C++20)(C++20)
(C++11)(C++11)(C++11)
(C++11)(C++11)
(C++11)(C++11)(C++11)
(C++11)
(C++11)
 
<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 rend();
( C++11)
reverse_iterator rend() noexcept;
( C++11)
( C++20)
constexpr reverse_iterator rend() noexcept;
( C++20)
(2)
const_reverse_iterator rend() const;
( C++11)
const_reverse_iterator rend() const noexcept;
( C++11)
( C++20)
constexpr const_reverse_iterator rend() const noexcept;
( C++20)
(3)
const_reverse_iterator crend() const;
( C++11)
const_reverse_iterator crend() const noexcept;
( C++11)
( C++20)
constexpr const_reverse_iterator crend() const noexcept;
( C++20)

, . , . , .

()

, .

.

libstdc++, crend() C++98.

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

int main()
{
    std::string p("[A man, a plan, a canal: Panama]");
    std::string q;
    
    std::copy(p.crbegin(), p.crend(), std::back_inserter(q));
    std::cout << "q = " << q << '\n';
    
    std::copy(q.crbegin(), q.crend(), p.rbegin());
    std::cout << "p = " << p << '\n';
}

:

q = ]amanaP :lanac a ,nalp a ,nam A[
p = ]amanaP :lanac a ,nalp a ,nam A[

C++:

LWG 1192 C++98 std::basic_string - crend()


(public -) []
(C++17)

(public - std::basic_string_view<CharT,Traits>) []

Web Proxy Viewer  |  New URL  |  Original Page