Provide a simpler & more general WAR (const & + const_cast) for the generate_functor problem.
Provide a simpler & more general WAR (const & + const_cast) for the generate_functor problem.

Reported by Andrew Corrigan

Fixes issue 275

thrust/thrust,mohamed-ali/thrust,xiongzhanblake/thrust_src,dachziegel/thrust,andrewcorrigan/thrust-multi-permutation-iterator,sdalton1/thrust,marksantos/thrust,marksantos/thrust,zhenglaizhang/thrust,GrimDerp/thrust,egaburov/thrust,GrimDerp/thrust,egaburov/thrust,Ricardo666666/thrust,sarvex/thrust,jaredhoberock/thrust,zeryx/thrust,zhenglaizhang/thrust,thvasilo/thrust,sarvex/thrust,jaredhoberock/thrust,zhenglaizhang/thrust,marksantos/thrust,xiongzhanblake/thrust,sdalton1/thrust,sdalton1/thrust,thrust/thrust,Ricardo666666/thrust,xiongzhanblake/thrust,zeryx/thrust,egaburov/thrust,xiongzhanblake/thrust_src,dachziegel/thrust,dachziegel/thrust,jaredhoberock/thrust,andrewcorrigan/thrust-multi-permutation-iterator,xiongzhanblake/thrust_src,arnabgho/thrust,raygit/thrust,mohamed-ali/thrust,thvasilo/thrust,xiongzhanblake/thrust,thvasilo/thrust,zeryx/thrust,raygit/thrust,thrust/thrust,thrust/thrust,raygit/thrust,andrewcorrigan/thrust-multi-permutation-iterator,thrust/thrust,jaredhoberock/thrust,arnabgho/thrust,sarvex/thrust,mohamed-ali/thrust,GrimDerp/thrust,arnabgho/thrust,Ricardo666666/thrust,jaredhoberock/thrust