"Is it possible to differentiate between prvalues and xvalues in function parameters" Not directly. You could pass
decltype
of the argument as a template parameter (using a macro to avoid typing the argument twice). "would require copy elision of the parameter into the return value" Even if possible (I'm not sure), it's not guaranteed, so will require the object to be movable.