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

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

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

private:
  const iterator first;


};

template <class Iterator, class Size>
range_view<Iterator>
__host__ __device__
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(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;
  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)
  {
  }
