Check if template has been passed a reference type or value type?
1967 via Digitalmars-d-learn Sun, 07 Jun 2015 08:21:24 -0700
I've got a template that takes in a type. Sometimes the type is a
class, sometimes a struct, sometimes just an int. It doesn't much
matter what it is, but if it's a reference type I need to check
if it's null so I can make it not null before using it. I get an
error if I try to check if a value type is null so I'd like to
put a "static if" to check if the type passed to the template is
a nullable one so I can avoid checking the value types passed in.
What do I have to do to check for nullability?
- Check if template has been passed ... 1967 via Digitalmars-d-learn
- Re: Check if template has bee... via Digitalmars-d-learn
- Re: Check if template has... sigod via Digitalmars-d-learn
- Re: Check if template has bee... Gary Willoughby via Digitalmars-d-learn