I am a very new D user and I almost always try to mirror the "official" style guide if one is available.

http://dlang.org/dstyle.html

I have written the following function

template Contains(C...){
  template Any(T...){
    import std.meta: anySatisfy;
    static if(T.length == 0){
      enum Any = false;
    }
    else{
      enum Any = ContainsImpl!T;
    }
    template ContainsImpl(T...){
      enum bool isSameComponent(Comp) = is(Comp == T[0]);
      static if(T.length == 1){
        enum ContainsImpl = anySatisfy!(isSameComponent,C);
      }
      else{
enum ContainsImpl = anySatisfy!(isSameComponent,C) && ContainsImpl!(T[1..$]);
      }
    }
  }
}


No idea how I should type it contains!c.any!T or contains!c.Any!T

Which lead me to have a look at phobos

For example

template Filter(alias pred, TList...)

vs

template anySatisfy(alias F, T...)

Are aliases now written in upper or lower camelCase? Should I use T... or TList... for variadics if I can't name them better?

or

private template GenericReplace(args...)

Why are the variadics written in lower case?

Reply via email to