decltypeベースのboost::result_of

Boost 1.44.0で、decltypeベースでのboost::result_ofの実装が入ったので試してみました。

#define BOOST_RESULT_OF_USE_DECLTYPE

#include <type_traits>
#include <boost/utility/result_of.hpp>

struct plus_functor {
//  typedef int result_type;

    int operator()(int a, int b) const
        { return a + b; }
};

int main()
{
    static_assert(std::is_same<boost::result_of<plus_functor(int, int)>::type, int>::value,
                  "not same");
}

このコードは、GCC 4.5では動作しますが、VC10では動作しませんでした。
VC10のdecltypeはバグの多い実装のため、Boost 1.44.0ではdecltypeがないものとして扱われているようです。
(Boost 1.43.0までは、VC10未満でdecltypeなしと判定されていました)


【result_of】 decltype-based implementation breaking valid code on msvc-10