65,176
社区成员




#include <list>
namespace std{
template <typename T, typename A=allocator<T> >
class ilist : public list<T,A>
{
public:
T& operator[](int idx){
iterator it=begin();
for(int i=0; i<idx; i++)
++it;
return *it;
}
const T& operator[](int idx)const{
const_iterator it=begin();
for(int i=0; i<idx; i++)
++it;
return *it;
}
};
}
#include <list>
namespace std{
template <typename T, typename A=allocator<T> >
class ilist : public list<T,A>
{
public:
T& operator[](int idx){
iterator it=begin();
for(int i=0; i<idx; i++)
++it;
return *it;
}
const T& operator[](int idx)const{
iterator it=begin();
for(int i=0; i<idx; i++)
++it;
return *it;
}
};
}