mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
special function used wrong resolve example
This commit is contained in:
parent
f5930bfa48
commit
b0612a5b68
|
@ -34,7 +34,7 @@ int main() {
|
||||||
"norm", [](const vec& self) { double len = std::sqrt(dot(self, self)); return vec(self.x / len, self.y / len); },
|
"norm", [](const vec& self) { double len = std::sqrt(dot(self, self)); return vec(self.x / len, self.y / len); },
|
||||||
// we use `sol::resolve` because other operator+ can exist
|
// we use `sol::resolve` because other operator+ can exist
|
||||||
// in the (global) namespace
|
// in the (global) namespace
|
||||||
sol::meta_function::addition, sol::resolve<const vec&, const vec&>(::operator+),
|
sol::meta_function::addition, sol::resolve<vec(const vec&, const vec&)>(::operator+),
|
||||||
sol::meta_function::subtraction, &vec::operator-
|
sol::meta_function::subtraction, &vec::operator-
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user