Hello! I do not really want to bother you all, but I have some issue, which I am not certain is possible to solve and this drives me crazy. I posted some similar question at this location: http://lists.boost.org/boost-users/2006/06/20309.php and got an interesting answer, but not really one which satisfies me. 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? Many thanks, Ovanes
"Ovanes Markarian"
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
participants (2)
-
David Abrahams
-
Ovanes Markarian