Re: Re: [Boost-users] function_traits inheritance
Peter Dimov wrote:
Victor Morilla wrote:
template <typename FnType, FnType* fn> struct Translator<FnType, fn, 0> : function_traits<FnType> { typedef result_type type;
typedef typename function_traits<FnType>::result_type type;
};
The question is, why result_type type definition is not inherited from function_traits ? ______________________________________________ Renovamos el Correo Yahoo!: ¡100 MB GRATIS! Nuevos servicios, más seguridad http://correo.yahoo.es
Victor Morilla wrote:
Peter Dimov wrote:
Victor Morilla wrote:
template <typename FnType, FnType* fn> struct Translator<FnType, fn, 0> : function_traits<FnType> { typedef result_type type;
typedef typename function_traits<FnType>::result_type type;
};
The question is, why result_type type definition is not inherited from function_traits ?
Members of dependent base classes are not visible in this context, because at the time the definition of Translator<FnType, fn, 0> is parsed, function_traits<FnType> is not instantiated (FnType isn't known until Translator<> is instantiated). When 'result_type' is encountered at definition time, the compiler does a normal lookup. If you add a global result_type definition, it will be found. The base class definition of result_type is inherited, though. Translator<int(), &f>::result_type will work.
participants (2)
-
Peter Dimov
-
Victor Morilla