Std

Mainly a port of Rust's std.
git clone https://git.philomathiclife.com/repos/Std
Log | Files | Refs | README

IExactSizeIterator.cs (923B)


      1 #region Namespaces
      2 namespace Std.Iter {
      3     #region Types
      4     public interface IExactSizeIterator<T>: IIterator<T> where T: notnull {
      5 
      6         #region Type-level Constructors
      7         #endregion
      8 
      9         #region Instance Constructors
     10         #endregion
     11 
     12         #region Type-level Fields
     13         #endregion
     14 
     15         #region Instance Fields
     16         #endregion
     17 
     18         #region Type-level Properties
     19         #endregion
     20 
     21         #region Instance Properties
     22         #endregion
     23 
     24         #region Type-level Functions
     25         #endregion
     26 
     27         #region Instance Functions
     28         public virtual bool IsEmpty() => Len() == ulong.MinValue;
     29         public virtual ulong Len() {
     30 
     31             var (min, max) = SizeHint();
     32             return min;
     33         }
     34         #endregion
     35 
     36         #region Operators
     37         #endregion
     38 
     39         #region Types
     40         #endregion
     41     }
     42     #endregion
     43 
     44     #region Namespaces
     45     #endregion
     46 }
     47 #endregion