- iterator[meta header]
- std[meta namespace]
- function template[meta id-type]
- cpp14[meta cpp]
namespace std {
template <class Iterator>
reverse_iterator<Iterator>
make_reverse_iterator(Iterator i); // C++03
template <class Iterator>
constexpr reverse_iterator<Iterator>
make_reverse_iterator(Iterator i); // C++17
}
- reverse_iterator[link reverse_iterator.md]
reverse_iterator
オブジェクトを作るヘルパ関数
reverse_iterator<Iterator>(i)
- reverse_iterator[link reverse_iterator.md]
#include <iostream>
#include <iterator>
#include <algorithm>
int main()
{
int ar[] = {1, 2, 3};
std::for_each(
std::make_reverse_iterator(ar + 3),
std::make_reverse_iterator(ar),
[](int x) {
std::cout << x << std::endl;
}
);
}
- std::make_reverse_iterator[color ff0000]
3
2
1
- C++14
- Clang, C++14 mode: 3.5
- GCC, C++14 mode: 5.0
- ICC: ??
- Visual C++: ??