Skip to content

Instantly share code, notes, and snippets.

@danlark1
Created October 4, 2020 22:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danlark1/546525c331c2427fb15a2592292c0a8c to your computer and use it in GitHub Desktop.
Save danlark1/546525c331c2427fb15a2592292c0a8c to your computer and use it in GitHub Desktop.
// 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