The error that g++ 4.8.0 gives is basically:
decltype evaluates to
phx::actor<proto::expression>&
, which is not a class or enumeration type
In order to use ::
you need to have an unqualified type so you must remove the reference:
#include <type_traits>
typedef std::remove_reference<decltype(proto::child_c<0>(f))>::type::proto_tag td;
I believe you could also use:
typedef proto::result_of::child_c<decltype(f),0>::type::proto_tag td;
Using proto::tag_of
you don't need to worry about the possible reference since it is removed when it's necessary:
template<typename Expr>
struct tag_of
{
typedef typename Expr::proto_tag type;
};
template<typename Expr>
struct tag_of<Expr &>
{
typedef typename Expr::proto_tag type;
};