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

Popular posts from this blog

mod rewrite - Using "?" when rewriting the URL -

.htaccess: Transfer name to index.php if not directory public -

Admob integration with pygame in android -