Boost logo

Boost :

From: Alexander Nasonov (alnsn_at_[hidden])
Date: 2002-04-22 02:59:33


"Andrei Alexandrescu" <andrewalex_at_[hidden]> wrote in message
news:a9pq3m$633$1_at_main.gmane.org...
> That is correct. MC++D explains why. The closest you can get is by using
> acyclic visitation. This is because the only thing that behaves like a
> template and a virtual function at the same time is dynamic_cast.
>

The dynamic_cast behaves like template because it is defined on a set of
types:
   dynamic_cast<T>(v) is valid if T belongs to D(v),
   where D(v) is set of types defined according to 5.2.7 of C++ standard

You can emulate dynamic_cast once you defined this set by hand. Easiest way
to do so is enumerate those types in typelist. For more information, view my
post:
http://lists.boost.org/MailArchives/boost/msg27859.php
or:
http://lists.boost.org/MailArchives/boost/msg28007.php

--
Alexander Nasonov

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