c++ - What is the meaning of `typename` in this example? -
this question has answer here:
i looking @ example implementation of binder1st
, looks this:
template <class operation, class t> binder1st<operation> bind1st (const operation& op, const t& x) { return binder1st<operation>(op, typename operation::first_argument_type(x)); }
what meaning of typename operation::first_argument_type(x)
. understand first_argument_type
typename, belonging binary_function
base class. looks me function belonging namespace operation
- in case, why typename
used here?
it means qualified name follows typename
keyword (i.e. operation::first_argument_type
) interpreted name of (dependent) type.
you can read full explanation of keyword typename
(which has another, different usage) here.
Comments
Post a Comment