On 9/15/11 7:59 PM, Benjamin Thaut wrote:
I tried writing a template function that detects function pointer types but it
does not work for function marked wiht any extern qualifier.
I tried around but couldn't find a way to make it work.

---
template isFunctionPointer(T) {
  enum isFunctionPointer = false;
}

template isFunctionPointer(T : U*, U) if (is(U == function)) {
  enum isFunctionPointer = true;
}
---

Could also be implemented using static ifs, if you prefer that.

David

Reply via email to