LCOV - code coverage report
Current view: top level - dtwc/types - Range.hpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 4 4 100.0 %
Date: 2024-09-07 20:53:22 Functions: 4 4 100.0 %

          Line data    Source code
       1             : /**
       2             :  * @file Range.hpp
       3             :  * @brief A basic Range class not to create vector for Iota
       4             :  * @author Volkan Kumtepeli
       5             :  * @date 18 Aug 2022
       6             :  */
       7             : 
       8             : #pragma once
       9             : 
      10             : #include "Index.hpp"
      11             : 
      12             : #include <iterator>
      13             : 
      14             : namespace dtwc {
      15             : 
      16             : class Range
      17             : {
      18             :   size_t x0{}, xN{};
      19             : 
      20             : public:
      21             :   Range() = default; // Default constructor 0,0;
      22           1 :   explicit Range(size_t xN) : xN{ xN } {}
      23           2 :   Range(size_t x0, size_t xN) : x0{ x0 }, xN{ xN } {}
      24             : 
      25           4 :   auto begin() { return Index(x0); }
      26           4 :   auto end() { return Index(xN); }
      27             : };
      28             : 
      29             : } // namespace dtwc

Generated by: LCOV version 1.14