function_traits with __device__-tagged lambdas

I’m trying to get the types of arguments for a lambda or functor. I tried using the function_traits proposal that is detailed here

It works by specializing function_traits over the type of the operator() class method pointer, from which a variadic args_t… can be extracted, and tuple_element can then give access to the types of any of that list. But this all breaks with a device-tagged lambda. Has anyone found a way around this?

#include <tuple>
#include <typeinfo>

template<typename func_t>
struct function_traits : 
  public function_traits<decltype(&func_t::operator())> { };

template<typename class_type, typename return_type_, typename... args_t>
struct function_traits<return_type_(class_type::*)(args_t...) const> {
  typedef return_type_ return_type;
  enum { arity = sizeof...(args_t) };

  template<size_t i>
  struct arg {
    using type = typename std::tuple_element<i, std::tuple<args_t...> >::type;

template<typename func_t>
using return_type = typename function_traits<func_t>::return_type;

template<typename func_t>
using arg0_type = typename function_traits<func_t>::template arg<0>::type;

template<typename func_t>
using arg1_type = typename function_traits<func_t>::template arg<1>::type;

template<typename func_t>
using arg2_type = typename function_traits<func_t>::template arg<2>::type;

int main(int argc, char** argv) {

  auto k = [](int value, double index) { 
    return (float)(value * index); 

  typedef return_type<decltype(k)> value_type;
  typedef arg0_type<decltype(k)> arg0;
  typedef arg1_type<decltype(k)> arg1; 

  printf("Types for return: %s  arg0: %s  arg1: %s\n",