Skip to content

Instantly share code, notes, and snippets.

View anonymouss's full-sized avatar
🐱
meow~

meow1234 anonymouss

🐱
meow~
  • 家里蹲
  • Shanghai
View GitHub Profile
@htfy96
htfy96 / static_inline_example.md
Last active April 11, 2024 14:13
static inline vs inline vs static in C++

In this article we compared different behavior of static, inline and static inline free functions in compiled binary. All the following test was done under g++ 7.1.1 on Linux amd64, ELF64.

Test sources

header.hpp

#pragma once

inline int only_inline() { return 42; }
static int only_static() { return 42; }