FieldNameTuple!T and std.traits.Fields!T not empty for interfaces
    Steven Schveighoffer 
    schveiguy at gmail.com
       
    Thu Jun  6 20:43:37 UTC 2019
    
    
  
On 6/6/19 4:22 PM, Amex wrote:
> FieldNameTuple!T
> std.traits.Fields!T
> 
> are non-empty when T is an interface!
> 
> An interface cannot contain fields and yet these return non-zero and 
> screws up my code. While I can filter for interfaces it makes me wonder 
> what else may slip through?
> 
> Is it a bug or what is going on?
Can you provide code to demonstrate? I get no fields when I do this:
interface I
{
}
import std.traits;
pragma(msg, FieldNameTuple!I);
-Steve
    
    
More information about the Digitalmars-d-learn
mailing list