1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#pragma once #include <algorithm> #include "exist.hh" template <class T> bool Exist<T>::operator()(T x) { if (std::find(seen_.begin(), seen_.end(), x) == seen_.end()) { seen_.push_back(x); return false; } return true; }