www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Trick for teasing out static/constness of member in D1?

I'd like to do something like this:

static if (AType.length is a static constant ) {
      const  has_static_length = true;
}
else static if (AType.length exists but it's not a compile-time constant) {
      const  has_static_length = false;
}
else {
     // there is no .length at all
}


Anyone have a neat trick for this that works in D1?


--bb
Jan 26 2009