eris:
> class Rank(T, A...) : Ranker!(T) {
Better something like:
class Rank(TyItem, bool ascending=true) : Ranker!(TyItem) {
or something like that.
You have a single type, so the following too may be OK:
class Rank(T, bool ascending=true) : Ranker!(T) {
Using single upper case letters (as often done in C++) when you have more than
one type is bad practice for me (yes, this is true for Phobos too). It's better
the Pascal usage of giving them a meaningful name that starts with an upper
case letter.
> In other words, rather than having to create a separate alias for each type
> create an alias like this:
> alias Rank!(T,-1) MinRank(T);
> alias Rank!(T, 1) MaxRank(T);
> I tried using this form, but I don't think the syntax is valid.
I think this works in D1:
template MinRank(T) {
alias Rank!(T, true) MinRank;
}
template MaxRank(T) {
alias Rank!(T, true) MaxRank;
}
Bye,
bearophile