Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-01-24 19:03:29


"Joe Gottman" <jgottman_at_[hidden]> writes:

> "Robert Ramey" <ramey_at_[hidden]> wrote in message
> news:01C2C3B8.367B8A60_at_226-146.adsl2.netlojix.net...
>> Is there such a thing as is_abstract_base<T> similar to is_polymorphic<T>
> ?
>>
>> Is such a thing possible? I could use it but have been unable to figrure
>> out how to do it.
>>
>
> I assume that you expect is_abstract_base<T> to return true if and only
> if it is it is impossible to create an object of type T, and you must create
> an object of some subclass of T instead. One problem with this is that
> there are two very different ways of requiring the user to derive from T.
> The most common way is to declare type T with one or more pure virtual
> member functions. The other way is to declare T so that all its
> constructors are protected, as in boost::noncopyable.

And neither one is detectable without causing a compiler error, to my
knowledge.

-- 
                       David Abrahams
   dave_at_[hidden] * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution

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