Torarin <> changed:

           What    |Removed                     |Added
                 CC|                            |

--- Comment #1 from Torarin <> 2010-08-20 17:26:26 PDT ---
I ran into trouble with this example as well, but this time because what should
work, doesn't:

import std.stdio;

template isNumeric(T)
  enum bool test1 = is(T : long);
  enum bool test2 = is(T : real);
  enum bool isNumeric = test1 || test2;

void main()
  bool a = isNumeric!int;

Fails with:
test.d(12): Error: expression isNumeric!(int) is void and has no value.

I was surprised to find that the language reference actually contradicts TDPL

"Implicit Template Properties
If a template has exactly one member in it, and the name of that member is the
same as the template name, that member is assumed to be referred to in a
template instantiation."

(In reply to comment #0)
> According to TDPL, calling isNumeric!(T) is rewritten by the compiler to
> isNumeric!(T).isNumeric, therefore hiding access to any other names.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to