Boost logo

Boost :

From: JOAQUIN LOPEZ MU?Z (joaquin_at_[hidden])
Date: 2003-09-09 14:17:47


I think I haven't made myself clear enough. enable_if
controls whether a given function enters (or not) into the overload
resolution set of a function name for a given type.
What I'm talking about is an utility that determines
if a certain member function of a type does exist. Something like

has_mem_fn<T,void (T::*)(T&), &T::swap>::type

evaluating to true iff T has such a swap method. As I'm writing this,
seems to me this could only be achieved with some macro
machinery.

Maybe I'm wong, but it is not clear to me how enable_if
could be used to such effect.

----- Mensaje Original -----
De: "David B. Held" <dheld_at_[hidden]>
Fecha: Martes, Septiembre 9, 2003 5:35 pm
Asunto: [boost] Re: Fw: An omnipotant swap?

> > "JOAQUIN LOPEZ MU?Z" <joaquin_at_[hidden]> wrote in message
> > news:622b45eb8b.5eb8b622b4_at_tid.es...
> > This crucial point of this technique is having an utility
> > to determine member function existence at compile-time.
> > A quick google on the Usenet reveals similar snippets
> > of code to do this, all of them more or less related and
> > with various degrees of success across a wide span of
> > compilers. Maybe some bold booster can have them
> > refactored in a metaprogramming utility with as many
> > compilers supported as possible. I see applications of
> > this outside the swap problem.
>
> I believe it's spelled "enable_if", and it's being discussed
> even as we speak.
>
> Dave
>
>
>
>
> _______________________________________________
> 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