Skip to content

Instantly share code, notes, and snippets.

@jorangreef
Created September 9, 2020 14:48
Show Gist options
  • Save jorangreef/77e7c609a15c6bea2ed749340c6ae9b3 to your computer and use it in GitHub Desktop.
Save jorangreef/77e7c609a15c6bea2ed749340c6ae9b3 to your computer and use it in GitHub Desktop.
stack or result location semantics
fn stack_or_result_location_semantics() custom_struct {
var custom_structs: [1]custom_struct = undefined;
fill_in_custom_struct(&custom_structs, 1);
return custom_structs[0];
}
fn boom_or_safe() void {
var custom_struct = stack_or_result_location_semantics();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment