Boost logo

Boost :

From: Daryle Walker (darylew_at_[hidden])
Date: 2001-04-30 22:10:33


Should we have a function to determine if a class is polymorphic? I guess
it would be in type_traits. Here's a sample implementation I saw in an
Usenet message:

> template<class T> bool is_polymorphic()
> {
> bool result = false;
> typeid(result = true, T());
> return result;
> }

I think this version is for compilers that need assistance from function
arguments for determining template parameters.

> template<class T> bool is_polymorphic( const T&r )
> {
> bool result = false;
> typeid(result = true, r);
> return result;
> }

-- 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com

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