Template metaprogramming technique for operator overloading

I could not find this in type_traits, or any other Boost TMP library, but I am wondering if there is any TMP technique which can determine if a user-defined type supports a particular operator overload for that type ?

Edward Diener a écrit :
I could not find this in type_traits, or any other Boost TMP library, but I am wondering if there is any TMP technique which can determine if a user-defined type supports a particular operator overload for that type ?
I don't think you can do it without SFINAE extended to expressions. This is available in C++0x and certain C++03 compilers, such as GCC starting with version 4.4 (or is it 4.5?)

2009/12/15 Edward Diener
I could not find this in type_traits, or any other Boost TMP library, but I am wondering if there is any TMP technique which can determine if a user-defined type supports a particular operator overload for that type ?
Type Traits Extensions might help. It's not officially part of Boost, but
it's in the review queue.
--------------------------
:Author: Frédéric Bron
:Review Manager: Needed
:Download: https://svn.boost.org/trac/boost/browser/sandbox/type_traits
:Description:
The purpose of the addition is to add type traits to detect if types T and U
are comparable in the sens of <, <=, >, >=, == or != operators, i.e. if
t, >=, ==,
!=).
The following traits are added:
is_equal_to_comparable
participants (3)
-
Edward Diener
-
Mathias Gaunard
-
Roman Perepelitsa