In C++ parlance, the _TaskOfType_ContinuationTypeTraits
is a metafunction. It does type computations at compile-time.
A metafunction is in a way similar to a run-time function. The key difference is that the input arguments to a metafunction are type(s), and returns are also type(s).
Eg. The following metafunction takes a type, and returns a pointer of the type you supply to it.
template <typename T>
struct add_pointer
{
typedef T* type;
}
Now, if you did add_pointer<int>::type
, it returns int*
. You see, you gave it a type (int
in this case) and the compiler computed a new type (int*
in this case) and gave it back to you when you invoked the ::type
of the metafunction. When you do ::type
on a metafunction, that is when the template is instantiated. This is the run-time equivalent of calling a function. Also note that all of this happened at compile-time!
Now, going back to your _TaskOfType_ContinuationTypeTraits
. This is just like my add_pointer
. In add_pointer
, I just had one template argument, you have two. I just added a pointer to the type that was supplied, you have something much more complicated. But, at it's essence, it is only a type computation. My add_pointer
returns when I call ::type
on it, yours does when you call ::_TaskOfType
.