#pragma once #include namespace util { template decltype(auto) get(Ts&&... ts) { return std::get(std::forward_as_tuple(ts...)); } template class Range { Iterator m_begin, m_end; public: Range(const Iterator _begin, const Iterator _end) : m_begin(_begin), m_end(_end) {} Range(const std::pair& t) { m_begin = t.first; m_end = t.second; } template Range(Args&&... args) : m_begin(get<0>(args...)), m_end(get<1>(args...)) {} auto begin() -> Iterator { return m_begin; } auto begin() const -> const Iterator { return m_begin; } auto end() -> Iterator { return m_end; } auto end() const -> const Iterator { return m_end; } }; } // namespace util