I want to able to pass two joined iterators as one to take advantage of some stl like algorithms (such as TBB) so I am making a custom iterator that joins them but am hitting some stumbling blocks.
I need to specialize iterator, however it won’t let me generically specify a template parameter.
Like so:
template<typename IT1, typename IT2>
struct multi_iter : public std::iterator<
std::output_iterator_tag,
std::pair<IT1::value_type&, IT2::value_type&> >
{
.
:
However it will let me do this, but this is not what I am after
template<typename IT1, typename IT2>
struct multi_iter : public std::iterator<
std::output_iterator_tag,
std::pair<int&, int&> >
{
.
:
I get this error
multi_iter.cpp:12:53: error: template argument 2 is invalid
multi_iter.cpp:12:55: error: template argument 2 is invalid
multi_iter.cpp:12:55: error: template argument 4 is invalid
multi_iter.cpp:12:55: error: template argument 5 is invalid
.
:
I do have the std::pair
Any help would be greatly appreciated.
Thanks
value_typeis a dependent type onIT1, so you have to specifytypenamethere