"temporary" templates

Steven Schveighoffer schveiguy at gmail.com
Mon Dec 2 01:10:26 UTC 2019


On 12/1/19 4:04 PM, Suleyman wrote:
> Perhaps this is the opportunity to make a good runtime reflection 
> system. We have typeid() for types, for an alias sequence which contains 
> only types an no declarations we can implement NoDuplicates as a 
> function that takes a TypeInfo[] and return the array with no duplicates 
> in it, but we need a way to get a compile-time type from a TypeInfo, 
> sort of a reversed typeid()
I actually figured out a Type-only mechanism to CTFE a NoDuplicates 
list. Translate each type into a string name, then no-dup the string 
array, creating a string of AliasSeq references, then mixin the result.

But having CTFE actually give me the types to translate back into an 
AliasSeq list would be so much better.

-Steve


More information about the Digitalmars-d mailing list