     e.discard(9999);
 
     // get the 10Kth result
-    return e() == validation;
-  }
+    return e() == m_value_10000;
+  }
+
+  const typename Engine::result_type m_value_10000;
 }; // end ValidateEngine
 
 

#include <thrust/generate.h>
#include <sstream>

template<typename Engine, typename Engine::result_type validation>
  struct ValidateEngine
{
  __host__ __device__
  bool operator()(void) const
  {

{
  // test host
  thrust::host_vector<bool> h(1);
  thrust::generate(h.begin(), h.end(), ValidateEngine<Engine>(value_10000));

  ASSERT_EQUAL(true, h[0]);

  // test device
  thrust::device_vector<bool> d(1);
  thrust::generate(d.begin(), d.end(), ValidateEngine<Engine>(value_10000));

  ASSERT_EQUAL(true, d[0]);
}
