ranges.hpp 374 Bytes
Newer Older
Paul's avatar
Paul committed
1
2
#ifndef MIGRAPH_GUARD_MIGRAPHLIB_RANGES_HPP
#define MIGRAPH_GUARD_MIGRAPHLIB_RANGES_HPP
Paul's avatar
Paul committed
3

Paul's avatar
Paul committed
4
5
#include <algorithm>

Paul's avatar
Paul committed
6
namespace migraph {
Paul's avatar
Paul committed
7
8
9
10
11
12
13
14
15
16
17
18
19

template <class C, class T>
bool contains(C&& c, T&& x)
{
    return c.find(x) != c.end();
}

template <class Range, class Iterator>
void copy(Range&& r, Iterator it)
{
    std::copy(r.begin(), r.end(), it);
}

Paul's avatar
Paul committed
20
} // namespace migraph
Paul's avatar
Paul committed
21
22

#endif