SectorType

- Working on type definition
This commit is contained in:
Tristan B. Velloza Kildaire 2024-05-02 15:12:36 +02:00
parent f71286e85c
commit 20cb74d5e8
1 changed files with 11 additions and 1 deletions

View File

@ -654,13 +654,23 @@ private struct Sector(T)
}
// TODO: Make a bit better
import std.traits : hasMember, hasStaticMember, Parameters;
import std.meta : AliasSeq;
private bool isSector(S)()
{
return __traits(hasMember, S, "opIndex");
bool s = true;
s = hasMember!(S, "opSlice") && __traits(isSame, Parameters!(S.opSlice), AliasSeq!(size_t, size_t));
return s;
}
public struct View(T, SectorType = Sector!(T))
if(isSector!(SectorType)())
{