|
Boost : |
From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2002-04-22 03:25:50
> > 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
The exception handling mechanism can behave like a template and a virtual
function at the same time. See my post
http://lists.boost.org/MailArchives/boost/msg28257.php it provides a sample
'visitation' implementation though it is somewhat intrusive, i.e. this is
required:
class someclass {
virtual void self()
throw this;
}
};
Paul Mensonides
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk