ranges.hpp 328 Bytes
Newer Older
Paul's avatar
Paul committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef RTG_GUARD_RTGLIB_RANGES_HPP
#define RTG_GUARD_RTGLIB_RANGES_HPP

namespace rtg {

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);
}

} // namespace rtg

#endif