Boost logo

Boost :

From: Jaakko Jarvi (jajarvi_at_[hidden])
Date: 2002-01-03 14:40:46


> >
> > The usage is as:
> >
> > is_instance_of_2<std::istream, basic_stream>::value // true
> >
> > is_instance_of_2<int, basic_stream>::value // false
> >
> > There are separate templates (is_instance_of_1, is_instance_of_2, ...)
> > for different numbers of template parameters of the second argument.
>
> Sounds useful to me.
> (Note that the "static From*" data members must be defined outside of
> the class. If you want to avoid that (because it's ugly), it's
> better to have a "From* something()" inline function.)
>
> John M., Jeremy S., how about adding is_instance_of to the type traits
> library?

I just noticed, that the current implementation does not work with
gcc3.0.2 (it does work with gcc2.96 and KCC something)

gcc 3.0.2 complains that is_instance_of_N<...>::value is not a constant
???

Does anyone have a clue? I can see that there are different versions of
is_convertible for almost all compilers, so was this issue encountered
with is_convertible implementation?

Cheers, Jaakko

-- 
-- Jaakko Järvi, jajarvi_at_[hidden] 

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk