You should add keyword "typename" before "std::remove_reference<TArg>::type(a)". At the moment I am not sure if you should put it instead of "new" or after "new".
https://stackoverflow.com/questions/4421306/use-of-typename-keyword-with-typedef-and-new