Skip to content

Instantly share code, notes, and snippets.

@bananu7
Created March 28, 2013 20:14
Show Gist options
  • Save bananu7/2c06bc9f7414e0385211 to your computer and use it in GitHub Desktop.
Save bananu7/2c06bc9f7414e0385211 to your computer and use it in GitHub Desktop.
//detail
template<typename T>
void callGlobal_detail (T const& t) {
push(t);
}
template<typename T, typename... Args>
void callGlobal_detail (T const& t, const Args&... rest) {
push(t);
callGlobal_detail(rest...);
}
// user interface
template<typename... Args>
void callGlobal (std::string const& name, Args const&... args) {
pushGlobal(name);
callGlobal_detail(args...);
DumpStack();
call(sizeof...(args));
pop(sizeof...(args));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment