Skip to content

Instantly share code, notes, and snippets.

@rohlem
rohlem / result-loc-aliasing.zig
Last active January 28, 2020 21:58
example cases of aliasing via result location
const expectEqual = @import("std").testing.expectEqual;
const V = struct{
a: i32,
b: i32,
pub fn sum(self: V) i32 {
// Note: in a more complex use case, we may depend on the result location within this function ( see issue #2765 ).
// (necessary for e.g. self-referential result types)
return self.a + self.b;
}
@rohlem
rohlem / test_function_arg_matching.cpp
Last active June 26, 2017 13:39
test program for sol2 function argument checking/matching
#define SOL_CHECK_ARGUMENTS
#include <sol.hpp>
#include <iostream>
#include <memory>
sol::protected_function print_bool_match_table(const sol::state_view& lua);
int main(){