Created
October 4, 2020 22:42
-
-
Save danlark1/546525c331c2427fb15a2592292c0a8c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// inline.h | |
// With inline everything compiles, without it is a linkage error failure | |
/* inline */ int f(int x) { | |
return x + 42; | |
} | |
// TU1.cpp | |
#include "inline.h" | |
int g1() { | |
return f(10); | |
} | |
// TU2.cpp | |
#include "inline.h" | |
int g2() { | |
return f(20); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment