Skip to content

Instantly share code, notes, and snippets.

@Rhomboid
Created August 16, 2014 20:44
Show Gist options
  • Select an option

  • Save Rhomboid/e3ed1dfb894fbda53d8b to your computer and use it in GitHub Desktop.

Select an option

Save Rhomboid/e3ed1dfb894fbda53d8b to your computer and use it in GitHub Desktop.
ODR and inlining demonstration
#include "func.hpp"
void (*func_ref_func)(void) = &func;
void hidden() {
// stuff
}
#pragma once
void hidden();
inline void func() {
hidden();
// stuff
}
#include "func.hpp"
void (*func_ref_main)(void) = &func;
int main() {
func();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment