summaryrefslogtreecommitdiff
path: root/graphs/cpp/exist_functor/exist.hxx
blob: 638c4e388be04269cd6d40fbcc22eebfcc286ff2 (plain)
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;
}