It's somewhat unclear what you are after. Why do you want to swap the pointer held by temp with the return value of a function, if you could just use assignment to the same effect?
But the technical reason is that swap takes the argument by non-const reference (as it is going to modify it), and temporaries (such as return values of function calls) cannot be bound to non-const references.
However, you can call methods on temporaries returned from functions, so the following should work:
GetCCDcallback(*otherptr, lastx, lasty, newx, newy).swap(temp);