From a7f43991eb3bf3dd9b3a56d0e32f27cf234ba1e8 Mon Sep 17 00:00:00 2001 From: ThePhD Date: Sun, 11 Sep 2016 04:49:05 -0400 Subject: [PATCH] [ci skip] be as ridiculously explicit as possible --- docs/source/api/simple_usertype.rst | 1 + docs/source/api/usertype.rst | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/source/api/simple_usertype.rst b/docs/source/api/simple_usertype.rst index dd61b5c6..7bb0ceaf 100644 --- a/docs/source/api/simple_usertype.rst +++ b/docs/source/api/simple_usertype.rst @@ -12,4 +12,5 @@ This type is no different from :doc:`regular usertype`, but with the f - ``sol::var`` takes the wrapped up type and pushes it directly into that named slot * Automatic "__index" and "__newindex" handling is not done - Overriding either of these properties leaves it entirely up to you to handle how you find variables + - This also means *no base class method lookup is done whatsoever*; please specify all base class variables/methods on the class itself - If you override "__index" or "__newindex", you must perform a raw get on the original table and return a valid function / value if you want it to find the members you already set on the ``simple_usertype`` diff --git a/docs/source/api/usertype.rst b/docs/source/api/usertype.rst index e54a9084..9bf50eea 100644 --- a/docs/source/api/usertype.rst +++ b/docs/source/api/usertype.rst @@ -210,7 +210,7 @@ Otherwise, the following is used to specify functions to bind on the specific us * ``"{name}", sol::overloaded( Func1, Func2, ... )`` - Creates an oveloaded member function that discriminates on number of arguments and types. * ``sol::base_classes, sol::bases`` - - Tells a usertype what its base classes are. If you have exceptions turned on, this need not be necessary: if you do not then you need this to have derived-to-base conversions work properly. See :ref:`inheritance` + - Tells a usertype what its base classes are. You need this to have derived-to-base conversions work properly. See :ref:`inheritance` usertype arguments - simple usertype @@ -279,7 +279,7 @@ Then, to register the base classes explicitly: .. warning:: - Sol currently attempts to link base class methods and variables with their derived classes with an undocumented, unsupported feature, provided you specify ``sol::base_classes<...>``. Unfortunately, this can come at the cost of prformance, depending on how "far" the base is from the derived class in the bases lookup list. If you do not want to suffer the performance degradation while we iron out the kinks in the implementation (and want it to stay performant forever), please specify all the base methods on the derived class in the method listing you write. In the future, we hope that with reflection we will not have to worry about this. + Specify all base class member variables and member functions to avoid current implementation caveats regarding automatic base member lookup. Sol currently attempts to link base class methods and variables with their derived classes with an undocumented, unsupported feature, provided you specify ``sol::base_classes<...>``. Unfortunately, this can come at the cost of performance, depending on how "far" the base is from the derived class in the bases lookup list. If you do not want to suffer the performance degradation while we iron out the kinks in the implementation (and want it to stay performant forever), please specify all the base methods on the derived class in the method listing you write. In the future, we hope that with reflection we will not have to worry about this. inheritance + overloading