Skip to content

Instantly share code, notes, and snippets.

@brianosman
Created July 15, 2021 20:50
Show Gist options
  • Save brianosman/e2a37f5a9b5f8a47fd42a80fe35fc36e to your computer and use it in GitHub Desktop.
Save brianosman/e2a37f5a9b5f8a47fd42a80fe35fc36e to your computer and use it in GitHub Desktop.
#include <cstdio>
#include "other.h"
int main() {
Foo f = Foo::Make(1);
f.print_me();
return 0;
}
#include "other.h"
#include <cstdio>
Foo Foo::Make(int v) {
return { v };
}
void Foo::print_me() {
printf("Hello, I'm #%d\n", val);
}
struct Foo {
static Foo Make(int);
void print_me();
int val;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment