mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
Index adjustments from derping around.
This commit is contained in:
parent
5301bc1d4c
commit
ba9507107b
|
@ -682,15 +682,15 @@ namespace sol {
|
|||
|
||||
static detail::error_result set_category(std::random_access_iterator_tag, lua_State* L, T& self, stack_object okey, stack_object value) {
|
||||
decltype(auto) key = okey.as<K>();
|
||||
if (key <= 0) {
|
||||
key += deferred_uc::index_adjustment(L, self);
|
||||
if (key < 0) {
|
||||
return detail::error_result("sol: out of bounds (too small) for set on '%s'", detail::demangle<T>().c_str());
|
||||
}
|
||||
key += deferred_uc::index_adjustment(L, self);
|
||||
std::ptrdiff_t len = static_cast<std::ptrdiff_t>(size_start(L, self));
|
||||
if (key == len) {
|
||||
return add_copyable(is_copyable(), L, self, std::move(value));
|
||||
}
|
||||
else if (key > len) {
|
||||
else if (key >= len) {
|
||||
return detail::error_result("sol: out of bounds (too big) for set on '%s'", detail::demangle<T>().c_str());
|
||||
}
|
||||
auto it = std::next(deferred_uc::begin(L, self), key);
|
||||
|
|
|
@ -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 2020-01-25 00:57:45.038692 UTC
|
||||
// This header was generated with sol v3.2.0 (revision c77b5b4)
|
||||
// Generated 2020-01-25 01:16:25.945664 UTC
|
||||
// This header was generated with sol v3.2.0 (revision 5301bc1)
|
||||
// https://github.com/ThePhD/sol2
|
||||
|
||||
#ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP
|
||||
|
|
|
@ -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 2020-01-25 00:57:44.490128 UTC
|
||||
// This header was generated with sol v3.2.0 (revision c77b5b4)
|
||||
// Generated 2020-01-25 01:16:25.151902 UTC
|
||||
// This header was generated with sol v3.2.0 (revision 5301bc1)
|
||||
// https://github.com/ThePhD/sol2
|
||||
|
||||
#ifndef SOL_SINGLE_INCLUDE_HPP
|
||||
|
@ -19854,15 +19854,15 @@ namespace sol {
|
|||
|
||||
static detail::error_result set_category(std::random_access_iterator_tag, lua_State* L, T& self, stack_object okey, stack_object value) {
|
||||
decltype(auto) key = okey.as<K>();
|
||||
if (key <= 0) {
|
||||
key += deferred_uc::index_adjustment(L, self);
|
||||
if (key < 0) {
|
||||
return detail::error_result("sol: out of bounds (too small) for set on '%s'", detail::demangle<T>().c_str());
|
||||
}
|
||||
key += deferred_uc::index_adjustment(L, self);
|
||||
std::ptrdiff_t len = static_cast<std::ptrdiff_t>(size_start(L, self));
|
||||
if (key == len) {
|
||||
return add_copyable(is_copyable(), L, self, std::move(value));
|
||||
}
|
||||
else if (key > len) {
|
||||
else if (key >= len) {
|
||||
return detail::error_result("sol: out of bounds (too big) for set on '%s'", detail::demangle<T>().c_str());
|
||||
}
|
||||
auto it = std::next(deferred_uc::begin(L, self), key);
|
||||
|
|
Loading…
Reference in New Issue
Block a user