如何为<&tgmath.h GT;实施? [英] How is <tgmath.h> implemented?

查看:140
本文介绍了如何为<&tgmath.h GT;实施?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

C没有(据我所知)超载或模板,对不对?那么,怎样才能具有相同名称的一组类型无关的功能纯醇'C存在吗?通常编译时弄虚作假将涉及一大堆宏,不是吗?

C doesn't have (to the best of my knowledge) overloading or templates, right? So how can a set of type-agnostic functions with the same name exist in plain ol' C? The usual compile-time trickery would involve a whole bunch of macros, wouldn't it?

推荐答案

有就是它是如何工作的GCC <一个很好的解释href=\"https://web.archive.org/web/20131205042841/http://carolina.mff.cuni.cz/~trmac/blog/2005/the-ugliest-c-feature-tgmathh/\"相对=nofollow>此处。

There's a great explanation of how it works in GCC here.

此外,如果任何人都可以解决中等难度的运动,我很想知道答案。

Also, if anyone can solve the medium-difficulty exercise, I'd love to know the answer.

这篇关于如何为&lt;&tgmath.h GT;实施?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆