File indexing completed on 2024-12-15 04:01:21
0001 /* 0002 * SPDX-FileCopyrightText: 2019-2023 Mattia Basaglia <dev@dragon.best> 0003 * 0004 * SPDX-License-Identifier: GPL-3.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include <iterator> 0010 0011 namespace glaxnimate::utils { 0012 0013 0014 template<class Iterator, class Traits=Iterator> 0015 class Range 0016 { 0017 public: 0018 using iterator = Iterator; 0019 using value_type = typename Traits::value_type; 0020 0021 Range(iterator begin, iterator end) 0022 : begin_(begin), end_(end) 0023 {} 0024 0025 iterator begin() const { return begin_; } 0026 iterator end() const { return end_; } 0027 iterator cbegin() const { return begin_; } 0028 iterator cend() const { return end_; } 0029 0030 private: 0031 iterator begin_; 0032 iterator end_; 0033 }; 0034 0035 } // namespace glaxnimate::utils