digitalmars.D.learn - Check if type is from specific template?
- Tofu Ninja (2/2) Jan 29 2015 Basically what the title says, how do I check if a type T is an
- bearophile (5/7) Jan 29 2015 If you have an updated Phobos std.traits.isInstanceOf could be
- Tofu Ninja (16/23) Jan 29 2015 Yep, exactly what I needed.
- H. S. Teoh via Digitalmars-d-learn (7/10) Jan 29 2015 [...]
Basically what the title says, how do I check if a type T is an instantiation of a specific template?
Jan 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
Jan 29 2015
On Thursday, 29 January 2015 at 12:10:41 UTC, bearophile wrote:Tofu Ninja: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...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
Jan 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
Jan 29 2015