Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document lua_type_traits #41

Open
Flamefire opened this issue Aug 3, 2016 · 1 comment
Open

Document lua_type_traits #41

Flamefire opened this issue Aug 3, 2016 · 1 comment

Comments

@Flamefire
Copy link
Contributor

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?

@satoren
Copy link
Owner

satoren commented Aug 3, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants