Mixing pass-by-reference and pass-by-value to variadic template function valid?
问题 I have a method which allocates memory for a object and then calls its constructor - a memory allocator. template <class T, typename... Arguments> inline T* AllocateObject(Arguments... args) { return new (InternalAllocate(sizeof(T))) T(args...); } Is it valid using this function to mix pass-by-value and pass-by-reference? For example allocating a class with a constructor with some by-value and some by-reference. It compiles, but I'm not sure if it has any nasty side-effects or not. 回答1: What