Boost logo

Boost :

Subject: Re: [boost] [mpl] has_function
From: Ingo Loehken (Ingo.Loehken_at_[hidden])
Date: 2010-03-21 14:43:06


The only thing you can determine, is, if the type (class) of the last
declaration is the
one you expected. That means if you know that the first declaration of
your function
comes in from baseT, you can determine if a deriving class overwrites that
decl,
and that is exactly what a deriving class needs to do to overload a
virtual function.

I myself use this pattern to determine, if a type is an XPCOM Interface or
not. Perhaps
you'd like to check for something similiar.

If interested in details, let me know.

Mathias Gaunard <mathias.gaunard_at_[hidden]>
Sent by: boost-bounces_at_[hidden]
21.03.2010 19:31
Please respond to
boost_at_[hidden]

To
boost_at_[hidden]
cc

Subject
Re: [boost] [mpl] has_function

Lorenzo Caminiti wrote:

> Is there a way I can check if a class has a given member function
> using metaprogramming?

Yes.

>
> What I need is to check at compile-time if a function is overriding a
> virtual function or not.

This is not the same, and there is no way to do that as far as I know.

_______________________________________________
Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost


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