mirror of https://github.com/deavmi/niknaks
Compare commits
2 Commits
9003c59473
...
1c4a92982f
Author | SHA1 | Date |
---|---|---|
Tristan B. Velloza Kildaire | 1c4a92982f | |
Tristan B. Velloza Kildaire | 20cb74d5e8 |
|
@ -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)())
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue