kaguya icon indicating copy to clipboard operation
kaguya copied to clipboard

Document lua_type_traits

Open Flamefire opened this issue 7 years ago • 1 comments

Please add documentation to lua_type_traits. I'm not really sure what the members mean, especially weakTypeTest and typeTest (their difference). Probably rename them (I guess weakTypeTest means: isConvertible and typeTest means isType)

Especially confusing is the implementation of template<> struct lua_type_traits<void> of which I assume is taken when a void* is pushed or retrieved. Is it actually possible to do state["value"] = (void*) 0xDEAD; and retrieve it? If so, can you outline what happens/which traits are used?

Flamefire avatar Aug 03 '16 12:08 Flamefire

I guess weakTypeTest means: isConvertible and typeTest means isType

Yes. that's right.

void, void* and const void* are distinguish, like a char and, char*. and void* is not specialized.

I want lua_type_traits<void>::push(L,void); , but it ill-formed at current C++(Maybe it allow since C++17) because push type used void pointer.

satoren avatar Aug 03 '16 14:08 satoren