Is there any reason why we cant change the SetArgPointee definition so that it casts the pointer to a pointer toward the type of the param?
I tried and it works for me. I dont see what it can break.
My modified code:
template <size_t N, typename A, bool kIsProto>
class SetArgumentPointeeAction {
public:
// Constructs an action that sets the variable pointed to by the
// N-th function argument to 'value'.
explicit SetArgumentPointeeAction(const A& value) : value_(value) {}
template <typename Result, typename ArgumentTuple>
void Perform(const ArgumentTuple& args) const {
CompileAssertTypesEqual<void, Result>();
*reinterpret_cast<A*>(::std::tr1::get<N>(args)) = value_;