On Friday, 7 August 2015 at 11:45:22 UTC, Nordlöw wrote:
To implement a new trait
isSortedRange(R, pred)
needed for SortedRange specializations I need a variant of
I've put all my progress into
https://github.com/D-Programming-Language/phobos/pull/3534
On Friday, 7 August 2015 at 14:45:44 UTC, Nordlöw wrote:
On Friday, 7 August 2015 at 14:30:55 UTC, Nordlöw wrote:
Any suggestions on adding support for `binaryFun!pred` aswell?
I cracked it.
template isSortedRange(T, alias pred = "a < b")
{
import std.traits : TemplateArgsOf;
static
On Friday, 7 August 2015 at 14:30:55 UTC, Nordlöw wrote:
Any suggestions on adding support for `binaryFun!pred` aswell?
I cracked it.
template isSortedRange(T, alias pred = "a < b")
{
import std.traits : TemplateArgsOf;
static if (TemplateArgsOf!T.length == 2)
{
import std
On Friday, 7 August 2015 at 14:13:24 UTC, Nordlöw wrote:
How do check that the second template argument to the instance
of SortedRange matches `pred`?
Using TemplateArgsOf.
I found a solution:
template isSortedRange(T, alias pred = "a < b")
{
import std.traits : TemplateArgsOf;
enum i
On Friday, 7 August 2015 at 11:45:22 UTC, Nordlöw wrote:
Can somebody please explain and help out with variadic version
of `isInstanceOf`?
Here's a try at isSortedRange:
enum bool isSortedRange(T, alias pred = "a < b") = is(T ==
SortedRange!(Args[0], pred), Args...);
unittest
{
alias R
On Friday, 7 August 2015 at 11:45:22 UTC, Nordlöw wrote:
Can somebody please explain and help out with variadic version
of `isInstanceOf`?
Here's a step forward:
/**
Returns true if $(D T) is an instance of the template $(D T)
with template
parameters $(D Ps).
*/
enum bool isInstanceOf
On Friday, 7 August 2015 at 11:45:22 UTC, Nordlöw wrote:
To implement a new trait
isSortedRange(R, pred)
needed for SortedRange specializations I need a variant of
enum bool isInstanceOf(alias S, T) = is(T == S!Args,
Args...);
that takes the `pred` argument aswell.
But I have no cl
To implement a new trait
isSortedRange(R, pred)
needed for SortedRange specializations I need a variant of
enum bool isInstanceOf(alias S, T) = is(T == S!Args, Args...);
that takes the `pred` argument aswell.
But I have no clue what to do with
enum bool isInstanceOf(alias S, T, T
On Friday, 7 August 2015 at 11:45:22 UTC, Nordlöw wrote:
enum bool isInstanceOf(alias S, T, TParams)
Correction:
enum bool isInstanceOf(alias S, T, TParams...)