[PATCH v2] Provide a C++ version of iseqsig

Florian Weimer fweimer@redhat.com
Thu Nov 9 07:46:00 GMT 2017


On 11/08/2017 02:25 PM, Gabriel F. T. Gomes wrote:
> +template<typename _T1, typename _T2>
> +inline int
> +iseqsig(_T1 __x, _T2 __y) throw()
> +{
> +  typedef __typeof (__MATH_EVAL_FMT2 (__x, __y)) _T3;
> +  return __iseqsig_type<_T3>::__call(__x, __y);
> +}

__typeof is a GNU extension.  You could define iseqsig for C++11 and 
alter only and use decltype instead.

I'm not sure if there is a way to get the type of an expression without 
evaluating it in earlier C++ versions.  It would certainly compute the 
type in the way __MATH_EVAL_FMT2 does, but that's probably not worth the 
effort for such a fringe feature.

Thanks,
Florian



More information about the Libc-alpha mailing list