 
 };
 
-template <class RandomAccessIterator, class Size>
-range_view<RandomAccessIterator>
+template <class Iterator, class Size>
+range_view<Iterator>
 __host__ __device__
-make_range_view(RandomAccessIterator first, Size n)
-{
-  return range_view<RandomAccessIterator>(first, first+n);
-}
-
-template <class RandomAccessIterator>
-range_view<RandomAccessIterator>
+make_range_view(Iterator first, Size n)
+{
+  return range_view<Iterator>(first, first+n);
+}
+
+template <class Iterator>
+range_view<Iterator>
 __host__ __device__
-make_range_view(RandomAccessIterator first, RandomAccessIterator last)
-{
-  return range_view<RandomAccessIterator>(first, last);
-}
-
-template<class ArrayView1, class ArrayView2, class ArrayView3>
+make_range_view(Iterator first, Iterator last)
+{
+  return range_view<Iterator>(first, last);
+}
+
+template<class View1, class View2, class View3>
 struct saxpy_functor : public thrust::unary_function<int,void>
 {
   const float a;
-  ArrayView1 x;
-  ArrayView2 y;
-  ArrayView3 z;
-
-  __host__ __device__
-  saxpy_functor(float _a, ArrayView1 _x, ArrayView2 _y, ArrayView3 _z)
+  View1 x;
+  View2 y;
+  View3 z;
+
+  __host__ __device__
+  saxpy_functor(float _a, View1 _x, View2 _y, View3 _z)
       : a(_a), x(_x), y(_y), z(_z)
   {
   }


public:
  __host__ __device__
  range_view(RandomAccessIterator first, RandomAccessIterator last)
      : first(first), last(last) {}
  __host__ __device__
  ~range_view() {}

#include <thrust/execution_policy.h>
#include <iostream>

template<class Iterator>
class range_view
{
public:
  typedef Iterator iterator;

private:
  const iterator first;
