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:
parent
3fcaa6b397
commit
ed6959973a
3 changed files with 60 additions and 2 deletions
|
@ -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()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue