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 (https://groups.google.com/forum/#!topic/thrust-users/TBeO2SI2zJc) and (https://stackoverflow.com/questions/25574364/how-to-pass-a-vector-to-the-constructor-of-a-thrust-based-odeint-observer-such), is it true that I can only store the raw pointer?

I think this is covered now in your cross posting:

https://stackoverflow.com/questions/51292290/storing-a-device-vector-inside-a-functor-through-the-constructor