is expression for template structs/classes instances?
d coder
dlang.coder at gmail.com
Mon Dec 20 21:40:05 PST 2010
> For instance, given your definiton of S, you could use
> _traits/std.traits to check that the type that you're testing has a member
> variable t. You could then check that S!(typeof(t)) was the same as the type
> that you were testing. So, if you get particularly cunning about it, I believe
> that it can be tested for in specific cases, but I don't believe that it can be
> done in any general way.
>
Thanks Jonathan
That is exactly what I had thought of doing. I was conscious that it
may not be the cleanest way.
Now that you are saying a cleaner way may not exist, I will go ahead
and write the code.
Regards
- Cherry
More information about the Digitalmars-d-learn
mailing list