1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 20:42:21 +02:00

Fixed some constraint lookups

This commit is contained in:
Brian Fiete 2022-01-11 12:02:23 -05:00
parent 3fcaa6b397
commit ed6959973a
3 changed files with 60 additions and 2 deletions

View file

@ -76,6 +76,40 @@ namespace Tests
ClassA<T>.DoAdd(val, val);
}
struct StringViewEnumerator<TS, C> : IEnumerator<StringView>
where C : const int
where TS : StringView[C]
{
private TS mStrings;
private int mIdx;
public this(TS strings)
{
mStrings = strings;
mIdx = -1;
}
public StringView Current
{
get
{
return mStrings[mIdx];
}
}
public bool MoveNext() mut
{
return ++mIdx != mStrings.Count;
}
public Result<StringView> GetNext() mut
{
if (!MoveNext())
return .Err;
return Current;
}
}
[Test]
public static void TestBasics()
{