Skip to content

Commit

Permalink
niknaks.container
Browse files Browse the repository at this point in the history
- Renamed and made the basic `SectorType` implementation public
  • Loading branch information
deavmi committed Aug 25, 2024
1 parent 6ff1b84 commit 3a19196
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions source/niknaks/containers.d
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,10 @@ unittest
assert(linearized[1] == "root");
}

private struct Sector(T)
/**
* Basic implementation of a `SectorType`
*/
public struct BasicSector(T)
{
private T[] data;

Expand All @@ -1229,9 +1232,9 @@ private struct Sector(T)
}

// Contract: Factory function
public static Sector!(T) make(T[] data)
public static BasicSector!(T) make(T[] data)
{
return Sector!(T)(data);
return BasicSector!(T)(data);
}

// Contract: Obtain something at an index
Expand Down Expand Up @@ -1393,7 +1396,7 @@ public bool isSector(S)()
* updwards. This last constraint
* is why this is considered a "view".
*/
public struct View(T, SectorType = Sector!(T))
public struct View(T, SectorType = BasicSector!(T))
if(isSector!(SectorType)())
{
private SectorType[] sectors;
Expand Down

0 comments on commit 3a19196

Please sign in to comment.