Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2006-06-23 22:56:08


"Ovanes Markarian" <om_boost_at_[hidden]> writes:

> Does anyone know if it possible to determine if a class
> overloads a certain function _where_ the return type is unknown.
>
> An example is the -> operator. It can return any type. My question
> is: is it possible to determine at compile time if some type
> overloads the -> operator, without knowing the return type when this
> operator is overloaded?

That would only be possible if -> could be a free function, but IIRC
it is required to be a member function... so the answer is no.

You can do it for any function that can be implemented as a non-member
(see e.g. boost/detail/is_incrementable.hpp).

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net