a c++ question# Programming - 葵花宝典
p*g
1 楼
Since std::set::iterator only support ++ and --, i write a piece of code to do
the + (and -) functionality.
the code is below:
set::const_iterator& operator+(set::const_iterator& it, const int& n
)
{
for (int i=0; i return it;
}
it works fine. But only for set. I want to write a generic function, the
code is
template
set::const_iterator& operator+(set::const_iterator& it, const int& n)
{
for (int i=0; i return it;
}
Even more gene
the + (and -) functionality.
the code is below:
set
)
{
for (int i=0; i
}
it works fine. But only for set
code is
template
set
{
for (int i=0; i
}
Even more gene