May 30, 2020 Re: First life-signs of type functions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stefan Koch | On Monday, 11 May 2020 at 21:58:57 UTC, Stefan Koch wrote:
> In a type function alias cannot bind to values at all.
> It can only bind to symbols or types.
> If you want to pass values in you have to use the appropriate parameter type.
Although it's called a 'type function', it should be able to make all template recursion unnecessary. If you can't have an alias parameter that might be a value or not, then that's a fundamental limitation to achieving this goal. A template alias parameter can take anything, as can a template sequence parameter.
We need type functions to be able to accept any compile-time sequence for processing, how can we do that if alias[] won't accept values? People will have to resort to template recursion to have a complete solution.
|
May 30, 2020 Re: First life-signs of type functions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick Treleaven | On Saturday, 30 May 2020 at 11:15:19 UTC, Nick Treleaven wrote:
> On Monday, 11 May 2020 at 21:58:57 UTC, Stefan Koch wrote:
>> In a type function alias cannot bind to values at all.
>> It can only bind to symbols or types.
>> If you want to pass values in you have to use the appropriate parameter type.
>
> Although it's called a 'type function', it should be able to make all template recursion unnecessary. If you can't have an alias parameter that might be a value or not, then that's a fundamental limitation to achieving this goal. A template alias parameter can take anything, as can a template sequence parameter.
>
> We need type functions to be able to accept any compile-time sequence for processing, how can we do that if alias[] won't accept values? People will have to resort to template recursion to have a complete solution.
so alias can and does accept values, BUT, you cannot really do anything with them inside
the type function.
since the only expose __traits, and a few bultin properties such as tupleof sizeof and stringof.
|
Copyright © 1999-2021 by the D Language Foundation