#include <stdio.h>
static void test()
{
printf("is this function considered for inline?");
}
int main()
{
test(); // definition does not have inline keyword. But declaration at the bottom (which is never used) has a inline keyword.
}
inline static void test(); // definition WITH inline keyword
會編譯器視圖test()
好像inline
關鍵字被附加到它嗎?這個函數是否考慮過內聯?
編輯:對不起,我的意思是在最後的聲明有一個內聯關鍵字!
你編譯優化?在你的示例代碼中最後一行是什麼 - 甚至不能編譯 –
我不認爲它是可能知道的,也可能是爲了反彙編。是否有你需要它的理由,還是這只是出於好奇?只是出於好奇。 – Ryan
我很抱歉,但我的示例代碼中有一個巨大的錯誤。我的意思是在宣言結尾有一個內聯關鍵字! – SHH