[ create a new paste ] login | about

Link: http://codepad.org/Ka4WqcdC    [ raw code | output | fork ]

C, pasted on Aug 23:
1
2
3
4
5
6
7
8
9
template<typename T>
T* ModApiBase::checkobject(lua_State *L, int narg)
{
	luaL_checktype(L, narg, LUA_TUSERDATA);
	void *ud = luaL_checkudata(L, narg, typeid(T).name());
	if (ud == nullptr)
		luaL_typerror(L, narg, typeid(T).name());
	return *(T **)ud;  // unbox pointer
}


Output:
1
Line 1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token


Create a new paste based on this one


Comments: