Implementation of thrust::bind similar to std::bind