How to retrieve value type from iterator in C++?

后端 未结 3 2004
甜味超标
甜味超标 2020-12-30 19:59

My question is sure a simple one for anybody familiar with C++ syntax. I\'m just learning c++ and this is some sort of homework.

template

        
3条回答
  •  [愿得一人]
    2020-12-30 20:06

    This will also work starting c++ 11:

    typename Iter::value_type
    

    So you do not have to type the whole std::iterator_traits thing.

提交回复
热议问题