C has the _Generic keyword that enables compile-time selection of an expression based on the type of its argument. The motivation is the ability for library authors to provide a veneer of C++ function overloading in C. This chapter covers the _Generic keyword and gives many examples of its use.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

_Generic

  • Paul J. Lucas

摘要

C has the _Generic keyword that enables compile-time selection of an expression based on the type of its argument. The motivation is the ability for library authors to provide a veneer of C++ function overloading in C. This chapter covers the _Generic keyword and gives many examples of its use.