templates - C++ get Index value in integer from iterator -
i trying index value iterator. keep getting error "indirection requires pointer operand ('long' invalid)" idea? need index. on following example, should output 2.
template<typename t> void practice(t begin, t end) { t = begin; it++; it++; auto index = - begin; cout << *index;
cout << index;
no need *
dereference.
Comments
Post a Comment