I really ought to consolidate how I handle optional, but there's optimizations I miss if I do.... bwuh.

This commit is contained in:
ThePhD 2018-05-14 13:21:41 -04:00
parent f8ee7abe52
commit 9cf393abb0
3 changed files with 12 additions and 4 deletions

View File

@ -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-13 00:04:17.889207 UTC
// This header was generated with sol v2.20.0 (revision db5494e)
// Generated 2018-05-14 17:21:18.007667 UTC
// This header was generated with sol v2.20.0 (revision f8ee7ab)
// https://github.com/ThePhD/sol2
#ifndef SOL_SINGLE_INCLUDE_HPP
@ -9728,7 +9728,11 @@ namespace stack {
static optional<T> get(lua_State* L, int index, Handler&& handler, record& tracking) {
// actually check if it's none here, otherwise
// we'll have a none object inside an optional!
#if defined(SOL_SAFE_REFERENCES) && SOL_SAFE_REFERENCES
bool success = stack::check<T>(L, index, no_panic);
#else
bool success = !lua_isnone(L, index);
#endif
if (!success) {
// expected type, actual type
tracking.use(static_cast<int>(success));

View File

@ -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-13 00:04:18.118574 UTC
// This header was generated with sol v2.20.0 (revision db5494e)
// Generated 2018-05-14 17:21:18.351259 UTC
// This header was generated with sol v2.20.0 (revision f8ee7ab)
// https://github.com/ThePhD/sol2
#ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP

View File

@ -53,7 +53,11 @@ namespace stack {
static optional<T> get(lua_State* L, int index, Handler&& handler, record& tracking) {
// actually check if it's none here, otherwise
// we'll have a none object inside an optional!
#if defined(SOL_SAFE_REFERENCES) && SOL_SAFE_REFERENCES
bool success = stack::check<T>(L, index, no_panic);
#else
bool success = !lua_isnone(L, index);
#endif
if (!success) {
// expected type, actual type
tracking.use(static_cast<int>(success));