Files
MP-SPDZ/Tools/PointerVector.h
Marcel Keller 4ef6b6d873 Maintenance.
2020-05-08 21:43:05 +10:00

32 lines
511 B
C++

/*
* PointerVector.h
*
*/
#ifndef TOOLS_POINTERVECTOR_H_
#define TOOLS_POINTERVECTOR_H_
#include <vector>
using namespace std;
template<class T>
class PointerVector : public vector<T>
{
int i;
public:
PointerVector(size_t size = 0) : vector<T>(size), i(0) {}
PointerVector(const vector<T>& other) : vector<T>(other), i(0) {}
void clear()
{
vector<T>::clear();
i = 0;
}
T& next()
{
return (*this)[i++];
}
};
#endif /* TOOLS_POINTERVECTOR_H_ */