0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 18:22:50 +01:00

ircd::buffer: Fix reverse iterations.

This commit is contained in:
Jason Volk 2018-01-20 04:11:37 -08:00
parent d108ec22f8
commit ba1a0530ff

View file

@ -74,8 +74,8 @@ namespace ircd::buffer
template<class it> const it &end(const buffer<it> &buffer);
template<class it> it &begin(buffer<it> &buffer);
template<class it> it &end(buffer<it> &buffer);
template<class it> it rbegin(const buffer<it> &buffer);
template<class it> it rend(const buffer<it> &buffer);
template<class it> std::reverse_iterator<it> rbegin(const buffer<it> &buffer);
template<class it> std::reverse_iterator<it> rend(const buffer<it> &buffer);
// Single buffer tools
template<class it> bool null(const buffer<it> &buffer);
@ -723,14 +723,14 @@ ircd::buffer::null(const buffer<it> &buffer)
}
template<class it>
it
std::reverse_iterator<it>
ircd::buffer::rend(const buffer<it> &buffer)
{
return std::reverse_iterator<it>(get<0>(buffer));
}
template<class it>
it
std::reverse_iterator<it>
ircd::buffer::rbegin(const buffer<it> &buffer)
{
return std::reverse_iterator<it>(get<0>(buffer) + size(buffer));