[Issue 11303] IsExpression can not return the correct result about function & delegate

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Oct 20 05:20:28 PDT 2013


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



--- Comment #2 from Xuchong <786325481 at QQ.com> 2013-10-20 05:20:26 PDT ---
(In reply to comment #1)
> is(T == function) tests for function object type, not function pointer type.
> Many consider that an inconsistency, but that's the state of things. Your tests
> should be:
> 
>    static assert(is(typeof(*fn1) == function));
>    static assert(is(typeof(*fn2) == function));
>    static assert(is(typeof(*fn3) == function));
>    static assert(is(typeof(*fn4) == function));
>    static assert(is(typeof(*fn5) == function));
>    static assert(is(typeof(*fn6) == function));

Ohhhhhhhh...
I got it. Thanks for your reply.
I am reading the TDPL.In the last paragraph of Chapter 5.6,there is a little
example code.It likes that:

auto f = (int i) {};
assert(is(f == function));

So I write the tests above.

-- 
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