Storing a device_vector inside a functor through the constructor?

Is it restrictive to do so? This is what I am trying to achieve:

struct StructOperator : public thrust::unary_function<float, int>  {
  int num_;
  thrust::device_vector<int> v_test;

  explicit StructOperator(thrust::device_vector<int> const& input_v) :
    v_test(input_v), num_(input_v.size()) {};

  __host__ __device__
   float operator()(int index) {
      // magic happens

Having done some Googling around (!topic/thrust-users/TBeO2SI2zJc) and (, is it true that I can only store the raw pointer?

I think this is covered now in your cross posting: