mirror of https://github.com/deavmi/niknaks
Compare commits
5 Commits
df52dab72f
...
bfa7c6020f
Author | SHA1 | Date |
---|---|---|
Tristan B. Velloza Kildaire | bfa7c6020f | |
Tristan B. Velloza Kildaire | 2ecb371d9a | |
Tristan B. Velloza Kildaire | a2fc15aac1 | |
Tristan B. Velloza Kildaire | b6106883da | |
Tristan B. Velloza Kildaire | 29064908e7 |
|
@ -345,7 +345,6 @@ public struct ConfigEntry
|
|||
{
|
||||
return numeric();
|
||||
}
|
||||
|
||||
else static if(__traits(isSame, T, string[]))
|
||||
{
|
||||
return array();
|
||||
|
|
|
@ -754,6 +754,13 @@ if(isSector!(SectorType)())
|
|||
return buff;
|
||||
}
|
||||
|
||||
public T[] opSlice(size_t start, size_t end)
|
||||
{
|
||||
// FIXME: This is lazy, do a check for up to where
|
||||
// and actually make THIS the real implementation
|
||||
return this.opSlice()[start..end];
|
||||
}
|
||||
|
||||
private static bool isArrayAppend(P)()
|
||||
{
|
||||
return __traits(isSame, P, T[]);
|
||||
|
@ -887,6 +894,7 @@ unittest
|
|||
assert(view[1] == 3);
|
||||
assert(view[2] == 45);
|
||||
assert(view[3] == 2);
|
||||
assert(view[0..2] == [1,3]);
|
||||
|
||||
// Update elements
|
||||
view[0] = 71;
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
*/
|
||||
module niknaks.functional;
|
||||
|
||||
import std.traits : isAssignable;
|
||||
import std.traits : isAssignable, isFunction, isDelegate, ParameterTypeTuple, ReturnType;
|
||||
import std.functional : toDelegate;
|
||||
|
||||
/**
|
||||
* Predicate for testing an input type
|
||||
|
@ -25,9 +26,6 @@ template Predicate(T)
|
|||
alias Predicate = bool delegate(T);
|
||||
}
|
||||
|
||||
import std.traits : isFunction, isDelegate, ParameterTypeTuple, isFunction, ReturnType;
|
||||
import std.functional : toDelegate;
|
||||
|
||||
/**
|
||||
* Given the symbol of a function or
|
||||
* delegate this will return a new
|
||||
|
|
Loading…
Reference in New Issue