asherliu / thrust

Automatically exported from code.google.com/p/thrust
Apache License 2.0
0 stars 0 forks source link

implement reverse() without a temporary buffer #295

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Is this as simple as swap_ranges + reverse_iterator?

difference_type N = distance(first, last);
BidirectionalIterator half(first); advance(half, N / 2);
swap_ranges(first, half, make_reverse_iterator(last));

http://code.google.com/p/thrust/source/browse/thrust/detail/reverse.inl

Original issue reported on code.google.com by wnbell on 24 Jan 2011 at 7:34

GoogleCodeExporter commented 8 years ago
This issue was closed by revision 42513665ef.

Original comment by wnbell on 31 Jan 2011 at 12:56