Skip to content

Dit05/DitoDisco.Core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DitoDisco.Core

Useful high-level constructs.

Features

IGenericEnumerable - Interface for implementing System.Collections.Generic.IEnumerable<T> without the burden of System.Collections.IEnumerable.

Example:

using System.Collections.Generic;
using DitoDisco.Core;

// Without:
class MyEnumerable : IEnumerable<int> {
    public IEnumerator<int> GetEnumerator() {
        for(int i = 1; i <= 10; i++) yield return i;
    }

    System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() => GetEnumerator(); // Totally arcane and unnecessary bloat in every type that implements IEnumerable<T>
}

// With:
class MyGenericEnumerable : IGenericEnumerable<int> { // Implements from IEnumerable<T> just the same, without non-generic bloat.
    public IEnumerator<int> GetEnumerator() {
        for(int i = 1; i <= 10; i++) yield return i;
    }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages