mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
ensure index_adjustment is applied everywhere
add safety config everywhere
This commit is contained in:
parent
d67c5b7849
commit
ac709111e8
|
@ -84,6 +84,11 @@ Feature Config
|
|||
* Includes ``<iostream>`` and prints all exceptions and errors to ``std::cerr``, for you to see
|
||||
* **Not** turned on by default under any settings: *this MUST be turned on manually*
|
||||
|
||||
``SOL_CONTAINERS_START`` triggers the following change:
|
||||
* If defined and **is an integral value**, is used to adjust the container start value
|
||||
* Applies to C++ containers **only** (not Lua tables or algorithms)
|
||||
* Defaults to 1 (containers in Lua count from 1)
|
||||
|
||||
``SOL_ENABLE_INTEROP`` triggers the following change:
|
||||
* Allows the use of ``extensible<T>`` to be used with ``userdata_checker`` and ``userdata_getter`` to retrieve non-sol usertypes
|
||||
- Particularly enables non-sol usertypes to be used in overloads
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// This file was generated with a script.
|
||||
// Generated 2018-05-20 19:25:19.981188 UTC
|
||||
// This header was generated with sol v2.20.1 (revision 4f366a1)
|
||||
// Generated 2018-05-22 19:42:19.603781 UTC
|
||||
// This header was generated with sol v2.20.2 (revision d67c5b7)
|
||||
// https://github.com/ThePhD/sol2
|
||||
|
||||
#ifndef SOL_SINGLE_INCLUDE_HPP
|
||||
|
@ -16949,7 +16949,11 @@ namespace sol {
|
|||
}
|
||||
|
||||
static std::ptrdiff_t index_adjustment(lua_State*, T&) {
|
||||
#if defined(SOL_CONTAINERS_START_INDEX)
|
||||
return static_cast<std::ptrdiff_t>((SOL_CONTAINERS_START) == 0 ? 0 : -(SOL_CONTAINERS_START));
|
||||
#else
|
||||
return static_cast<std::ptrdiff_t>(-1);
|
||||
#endif
|
||||
}
|
||||
|
||||
static int pairs(lua_State* L) {
|
||||
|
|
|
@ -20,8 +20,8 @@
|
|||
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// This file was generated with a script.
|
||||
// Generated 2018-05-20 19:25:20.251908 UTC
|
||||
// This header was generated with sol v2.20.1 (revision 4f366a1)
|
||||
// Generated 2018-05-22 19:42:19.843589 UTC
|
||||
// This header was generated with sol v2.20.2 (revision d67c5b7)
|
||||
// https://github.com/ThePhD/sol2
|
||||
|
||||
#ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP
|
||||
|
|
|
@ -1273,7 +1273,11 @@ namespace sol {
|
|||
}
|
||||
|
||||
static std::ptrdiff_t index_adjustment(lua_State*, T&) {
|
||||
#if defined(SOL_CONTAINERS_START_INDEX)
|
||||
return static_cast<std::ptrdiff_t>((SOL_CONTAINERS_START) == 0 ? 0 : -(SOL_CONTAINERS_START));
|
||||
#else
|
||||
return static_cast<std::ptrdiff_t>(-1);
|
||||
#endif
|
||||
}
|
||||
|
||||
static int pairs(lua_State* L) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user