Skip to content

Static in header file

本章要讨论的问题是: 定义于header file中的static object和static function。

static function and static object in header file cause duplicate definition

如果添加namespace是否会避免?

如何查看function是否multiple definition?

compiler对internal linkage的实现方式。

static function in header

https://stackoverflow.com/questions/780730/c-c-static-function-in-header-file-what-does-it-mean

static inline function in header

https://stackoverflow.com/questions/47819719/static-inline-functions-in-a-header-file

https://stackoverflow.com/questions/22102919/static-vs-inline-for-functions-implemented-in-header-files?noredirect=1

https://stackoverflow.com/questions/12836171/difference-between-an-inline-function-and-static-inline-function