Thread overview
Check if type is from specific template?
Jan 29, 2015
Tofu Ninja
Jan 29, 2015
bearophile
Jan 29, 2015
Tofu Ninja
Jan 29, 2015
H. S. Teoh
January 29, 2015
Basically what the title says, how do I check if a type T is an instantiation of a specific template?
January 29, 2015
Tofu Ninja:

> Basically what the title says, how do I check if a type T is an instantiation of a specific template?

If you have an updated Phobos std.traits.isInstanceOf could be what you look for.

Bye,
bearophile
January 29, 2015
On Thursday, 29 January 2015 at 12:10:41 UTC, bearophile wrote:
> Tofu Ninja:
>
>> Basically what the title says, how do I check if a type T is an instantiation of a specific template?
>
> If you have an updated Phobos std.traits.isInstanceOf could be what you look for.
>
> Bye,
> bearophile

Yep, exactly what I needed.

Incidentally, while trying to see how its used I found that a lot of the links on the std.traits doc page do not work and have no documentation. For instance http://dlang.org/phobos/std_traits.html#isInstanceOf does not actually appear on the page but has a link to it up in the navigation header.

Other links on that page that don't work...
isAssignable, isBoolean, isIntegral, isFloatingPoint, isNumeric, isScalarType, isBasicType, isUnsigned, isSigned, isSomeChar, isSomeString, isNarrowString, isStaticArray, isDynamicArray, isArray, isAssociativeArray, isBuiltinType, isPointer, isAggregateType, isIterable, isMutable, isInstanceOf, unsigned

It seems that all the variable template's docs are not getting generated...
January 29, 2015
On Thu, Jan 29, 2015 at 12:58:46PM +0000, Tofu Ninja via Digitalmars-d-learn wrote: [...]
> Incidentally, while trying to see how its used I found that a lot of the links on the std.traits doc page do not work and have no documentation.
[...]

Please file bugs for these. We need to fix the docs.


T

-- 
"I speak better English than this villain Bush" -- Mohammed Saeed al-Sahaf, Iraqi Minister of Information