Given a Task t, is there any semantic difference between
t.ContinueWith(ante => DoSomethingWith(ante));
and
t.ContinueWith(ante => DoSomethingWith(t));
, assuming that t is not mutated later?
Does the antecedent argument exist only to avoid the allocation of a closure as in the second variant?
Effectively, yes. It also lets you write this more succinctly as:
It also provides a similar API to using
TaskFactory.ContinueWhenAllorTaskFactory.ContinueWhenAny.