 struct is_even
 {
     __host__ __device__
-    bool operator()(T x) { return (x & 1) == 0; }
+    bool operator()(T x) { return (static_cast<unsigned int>(x) & 1) == 0; }
 };
 
 template<typename T>

template <typename T>
void TestCopyIf(const size_t n)
{
    thrust::host_vector<T> h_data = unittest::random_samples<T>(n);
    thrust::device_vector<T> d_data = h_data;

    thrust::host_vector<T> h_result(n);
    thrust::device_vector<T> d_result(n);

    is_true<T> pred;

    typename thrust::host_vector<T>::iterator h_new_end = thrust::copy_if(h_data.begin(), h_data.end(), h_result.begin(), pred);
    typename thrust::device_vector<T>::iterator d_new_end = thrust::copy_if(d_data.begin(), d_data.end(), d_result.begin(), pred);

    h_result.resize(h_new_end - h_result.begin());
    d_result.resize(d_new_end - d_result.begin());

    ASSERT_EQUAL(h_result, d_result);
}
DECLARE_VARIABLE_UNITTEST(TestCopyIf);



#include <list>
#include <iterator>
#include <thrust/sequence.h>
#include <thrust/iterator/counting_iterator.h>

void TestCopyFromConstIterator(void)
