On 09/24/2012 09:41 AM, monarch_dodra wrote:
...

Regarding the ".init" issue, I hadn't thought of that, but it can
be worked around pretty easily with an is(R r):

--------
template Hello(R)
      if ( is(R r) &&
           is(typeof(takeExactly(r, 1))) &&
           is(R == typeof(takeExactly(r, 1)))
      )
{
      alias R Hello;
}
--------
After that, I guess it is indeed one implementation detail vs the
other.


I don't think this does what you think it does. The 'is(R r)' declares r to be an alias for R. So 'r' is a type in that code snippet.

Also, is(typeof(takeExactly(R, 1))) && is(R == typeof(takeExactly(R, 1)))

can be written in a more compact way as

is(typeof(takeExactly(R, 1)) == R)


IMO, it really depends on whether or not you'd want "int[]" to be
considered the return type of a takeExactly :/ Maybe it is, maybe
it ain't.

Reply via email to