[Issue 9065] Please consider adding these std.traits

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 26 20:15:04 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=9065



--- Comment #20 from Kenji Hara <k.hara.pg at gmail.com> 2012-11-26 20:14:55 PST ---
(In reply to comment #12)
> (In reply to comment #11)

OK. I understood that Manu says. And my yesterday comment was completely wrong.
Sorry for my misunderstanding.

Certainly, isFunction is an important template which lacks in std.traits.
Existing other function traits, isSomeFunction, isCallble, FunctionTypeOf,
return true even if given function pointer or delegate. I can agree with the
behavior is sometimes obstacle.

> Blending traits about type and symbol is not a purpose of std.traits.

And more, mixing symbol and type is *a design* of std.traits. I had
misunderstood at the point. isSomeFunction is an example.

  /**
  Detect whether >>symbol or type<< $(D T) is a function, a function pointer
  or a delegate.
   */
  template isSomeFunction(T...) { ... }

I challenged implementing proposed template isVariable. Is this what you want?

https://gist.github.com/4152297

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list