On type functions

Stefan Koch uplink.coder at googlemail.com
Sun May 3 10:52:37 UTC 2020


On Sunday, 3 May 2020 at 09:37:19 UTC, Stefan Koch wrote:

>
> The previous post of send before I was finished ... I hit enter 
> by accident.
> anyways it should already give the gist of what I wanted to 
> convey.

Continuation:

Type functions supposed to be functions, which means they cannot 
introduce mutations to global state, such as the number of types 
known to the compiler.
Which automatically means they cannot introduce new types, which 
are visible outside of the type function itself.
If you do want to introduce a new type you can do that having 
your type function be wrapped in a template which can introduce 
new types.

If there are any other open questions about how this is supposed 
to work I am happy to answer them.


More information about the Digitalmars-d mailing list