Add arbitrary method to foreign_method_t conversion helper
It might not work in every case, you still are restricted to types that set() and get() understand.
This commit is contained in:
parent
34d2317f11
commit
6a30725a62
3 changed files with 49 additions and 2 deletions
|
@ -54,6 +54,10 @@ namespace wren {
|
|||
return static_cast<int>(vm.slot_double(slot_num));
|
||||
}
|
||||
|
||||
template<> std::size_t get<std::size_t> (VM& vm, int slot_num) {
|
||||
return static_cast<std::size_t>(vm.slot_double(slot_num));
|
||||
}
|
||||
|
||||
template<> std::string get<std::string> (VM& vm, int slot_num) {
|
||||
return {vm.slot_string(slot_num)};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue