mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
ensure optional returns are un-engaged upon none/nil -- nil does NOT count
This commit is contained in:
parent
4f366a17a9
commit
03f17d41eb
|
@ -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-14 17:21:18.007667 UTC
|
||||
// This header was generated with sol v2.20.0 (revision f8ee7ab)
|
||||
// Generated 2018-05-20 19:25:19.981188 UTC
|
||||
// This header was generated with sol v2.20.1 (revision 4f366a1)
|
||||
// https://github.com/ThePhD/sol2
|
||||
|
||||
#ifndef SOL_SINGLE_INCLUDE_HPP
|
||||
|
@ -9728,11 +9728,7 @@ 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));
|
||||
|
|
|
@ -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-14 17:21:18.351259 UTC
|
||||
// This header was generated with sol v2.20.0 (revision f8ee7ab)
|
||||
// Generated 2018-05-20 19:25:20.251908 UTC
|
||||
// This header was generated with sol v2.20.1 (revision 4f366a1)
|
||||
// https://github.com/ThePhD/sol2
|
||||
|
||||
#ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP
|
||||
|
|
|
@ -53,11 +53,7 @@ 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));
|
||||
|
|
Loading…
Reference in New Issue
Block a user