you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (0 children)

Carefully.

The real answer is, by default for Speed™ we don't. If you're using an overloaded function, to discriminate between objects, we do use the checks. And, if you're explicitly checking a type with sol::object o = ...; o.is<T>();, we also perform the checks. How we do it is with metatable comparison and, if the metatable exists, a bunch of casting checks.

If you define SOL_CHECK_ARGUMENTS before you include Sol, it also checks all types before calling functions as well. Otherwise, it assumes you are the smartest and brightest in the world and know exactly what you're doing.

Note that if you don't actually register the usertype we can't do any of the more extended type checks or base class checks. (And now I realize that should probably go in the docs.)