mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
parent
83f4b4aaa0
commit
143c98450a
230
.gitignore
vendored
230
.gitignore
vendored
@ -1,115 +1,115 @@
|
|||||||
# # # # sol2
|
# # # # sol2
|
||||||
# The MIT License (MIT)
|
# The MIT License (MIT)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2017 Rapptz, ThePhD, and contributors
|
# Copyright (c) 2013-2017 Rapptz, ThePhD, and contributors
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
# this software and associated documentation files (the "Software"), to deal in
|
# this software and associated documentation files (the "Software"), to deal in
|
||||||
# the Software without restriction, including without limitation the rights to
|
# the Software without restriction, including without limitation the rights to
|
||||||
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
# the Software, and to permit persons to whom the Software is furnished to do so,
|
# the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
# subject to the following conditions:
|
# subject to the following conditions:
|
||||||
#
|
#
|
||||||
# The above copyright notice and this permission notice shall be included in all
|
# The above copyright notice and this permission notice shall be included in all
|
||||||
# copies or substantial portions of the Software.
|
# copies or substantial portions of the Software.
|
||||||
#
|
#
|
||||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
# Python (Bytecode)
|
# Python (Bytecode)
|
||||||
*.pyc
|
*.pyc
|
||||||
|
|
||||||
# ninja files
|
# ninja files
|
||||||
*.ninja
|
*.ninja
|
||||||
|
|
||||||
# Visual Studio
|
# Visual Studio
|
||||||
*.props
|
*.props
|
||||||
*.user
|
*.user
|
||||||
.vs/
|
.vs/
|
||||||
Debug/
|
Debug/
|
||||||
Release/
|
Release/
|
||||||
x64/
|
x64/
|
||||||
x86/
|
x86/
|
||||||
*.pyproj
|
*.pyproj
|
||||||
*.vcxproj
|
*.vcxproj
|
||||||
*.vcxproj.filters
|
*.vcxproj.filters
|
||||||
*.tlog
|
*.tlog
|
||||||
*.lastbuildstate
|
*.lastbuildstate
|
||||||
*.idb
|
*.idb
|
||||||
*.sln
|
*.sln
|
||||||
*.gitattributes
|
*.gitattributes
|
||||||
|
|
||||||
# VSCode
|
# VSCode
|
||||||
.vscode/
|
.vscode/
|
||||||
|
|
||||||
# CMake
|
# CMake
|
||||||
build/
|
build/
|
||||||
build-sol2/
|
build-sol2/
|
||||||
CMakeCache.txt
|
CMakeCache.txt
|
||||||
CMakeFiles/
|
CMakeFiles/
|
||||||
|
|
||||||
# Compiler outputs
|
# Compiler outputs
|
||||||
obj/*
|
obj/*
|
||||||
bin/*
|
bin/*
|
||||||
main.exe
|
main.exe
|
||||||
main.o
|
main.o
|
||||||
lua53.dll
|
lua53.dll
|
||||||
lua-5.3.4.dll
|
lua-5.3.4.dll
|
||||||
main.ilk
|
main.ilk
|
||||||
main.pdb
|
main.pdb
|
||||||
|
|
||||||
# Dropbox interference
|
# Dropbox interference
|
||||||
.dropbox*
|
.dropbox*
|
||||||
|
|
||||||
# QtCreator
|
# QtCreator
|
||||||
*.creator.user.*
|
*.creator.user.*
|
||||||
*.config
|
*.config
|
||||||
*.creator
|
*.creator
|
||||||
*.files
|
*.files
|
||||||
*.includes
|
*.includes
|
||||||
|
|
||||||
# Scratchpad Files
|
# Scratchpad Files
|
||||||
m.lua
|
m.lua
|
||||||
main.lua
|
main.lua
|
||||||
catch_mock.hpp
|
catch_mock.hpp
|
||||||
main_aux.cpp
|
main_aux.cpp
|
||||||
main.hpp
|
main.hpp
|
||||||
main2.cpp
|
main2.cpp
|
||||||
main.cpp
|
main.cpp
|
||||||
|
|
||||||
# Local Lua Testbeds
|
# Local Lua Testbeds
|
||||||
lua-5.3.4-cxx/
|
lua-5.3.4-cxx/
|
||||||
lua-5.3.4/
|
lua-5.3.4/
|
||||||
lua-5.3.2/
|
lua-5.3.2/
|
||||||
lua-5.3.1/
|
lua-5.3.1/
|
||||||
lua-5.3.0/
|
lua-5.3.0/
|
||||||
lua-5.2.4/
|
lua-5.2.4/
|
||||||
lua-5.2.2/
|
lua-5.2.2/
|
||||||
lua-5.2.3/
|
lua-5.2.3/
|
||||||
lua-5.1.5/
|
lua-5.1.5/
|
||||||
LuaJIT-2.1.0/
|
LuaJIT-2.1.0/
|
||||||
luajit-2.0.5/
|
luajit-2.0.5/
|
||||||
luajit-2.0.3/
|
luajit-2.0.3/
|
||||||
include/
|
include/
|
||||||
liblua.a
|
liblua.a
|
||||||
lib/liblua5.2.a
|
lib/liblua5.2.a
|
||||||
|
|
||||||
# Docs Artefacts
|
# Docs Artefacts
|
||||||
docs/build/
|
docs/build/
|
||||||
|
|
||||||
# Sublime Text
|
# Sublime Text
|
||||||
*.sublime-workspace
|
*.sublime-workspace
|
||||||
*.sublime-project
|
*.sublime-project
|
||||||
|
|
||||||
|
|
||||||
# Windows Crap
|
# Windows Crap
|
||||||
desktop.ini
|
desktop.ini
|
||||||
*.db
|
*.db
|
||||||
|
|
||||||
# Miscellaneous
|
# Miscellaneous
|
||||||
external/
|
external/
|
||||||
scratch/
|
scratch/
|
||||||
|
@ -1,112 +1,120 @@
|
|||||||
# # # # sol2
|
# # # # sol2
|
||||||
# The MIT License (MIT)
|
# The MIT License (MIT)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2017 Rapptz, ThePhD, and contributors
|
# Copyright (c) 2013-2017 Rapptz, ThePhD, and contributors
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
# this software and associated documentation files (the "Software"), to deal in
|
# this software and associated documentation files (the "Software"), to deal in
|
||||||
# the Software without restriction, including without limitation the rights to
|
# the Software without restriction, including without limitation the rights to
|
||||||
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
# the Software, and to permit persons to whom the Software is furnished to do so,
|
# the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
# subject to the following conditions:
|
# subject to the following conditions:
|
||||||
#
|
#
|
||||||
# The above copyright notice and this permission notice shall be included in all
|
# The above copyright notice and this permission notice shall be included in all
|
||||||
# copies or substantial portions of the Software.
|
# copies or substantial portions of the Software.
|
||||||
#
|
#
|
||||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
# # Standard CMake Libraries
|
# # Standard CMake Libraries
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
# Contain literally everything inside of this function to prevent spillage
|
# Contain literally everything inside of this function to prevent spillage
|
||||||
function(find_lua_build LUA_VERSION)
|
function(find_lua_build LUA_VERSION)
|
||||||
# # # Variables
|
# # # Variables
|
||||||
# # Core Paths
|
# # Core Paths
|
||||||
string(TOLOWER ${LUA_VERSION} LUA_BUILD_NORMALIZED_LUA_VERSION)
|
string(TOLOWER ${LUA_VERSION} LUA_BUILD_NORMALIZED_LUA_VERSION)
|
||||||
if (LUA_BUILD_NORMALIZED_LUA_VERSION MATCHES "luajit")
|
if (LUA_BUILD_NORMALIZED_LUA_VERSION MATCHES "luajit")
|
||||||
set(LUA_BUILD_LIBNAME ${LUA_VERSION})
|
set(LUA_BUILD_LIBNAME ${LUA_VERSION})
|
||||||
elseif (BUILD_LUAJIT)
|
elseif (BUILD_LUAJIT)
|
||||||
set(LUA_BUILD_LIBNAME luajit-${LUA_VERSION})
|
set(LUA_BUILD_LIBNAME luajit-${LUA_VERSION})
|
||||||
elseif (LUA_BUILD_NORMALIZED_LUA_VERSION MATCHES "lua")
|
elseif (LUA_BUILD_NORMALIZED_LUA_VERSION MATCHES "lua")
|
||||||
set(LUA_BUILD_LIBNAME ${LUA_VERSION})
|
set(LUA_BUILD_LIBNAME ${LUA_VERSION})
|
||||||
elseif (BUILD_LUA)
|
elseif (BUILD_LUA)
|
||||||
set(LUA_BUILD_LIBNAME lua-${LUA_VERSION})
|
set(LUA_BUILD_LIBNAME lua-${LUA_VERSION})
|
||||||
else()
|
else()
|
||||||
set(LUA_BUILD_LIBNAME lua-${LUA_VERSION})
|
set(LUA_BUILD_LIBNAME lua-${LUA_VERSION})
|
||||||
endif()
|
endif()
|
||||||
set(LUA_BUILD_TOPLEVEL "${CMAKE_BINARY_DIR}/vendor/${LUA_BUILD_LIBNAME}")
|
set(LUA_BUILD_TOPLEVEL "${CMAKE_BINARY_DIR}/vendor/${LUA_BUILD_LIBNAME}")
|
||||||
set(LUA_BUILD_INSTALL_DIR "${LUA_BUILD_TOPLEVEL}")
|
set(LUA_BUILD_INSTALL_DIR "${LUA_BUILD_TOPLEVEL}")
|
||||||
# # Misc needed variables
|
# # Misc needed variables
|
||||||
set(LUA_BUILD_LIBRARY_DESCRIPTION "The base name of the library to build either the static or the dynamic library")
|
set(LUA_BUILD_LIBRARY_DESCRIPTION "The base name of the library to build either the static or the dynamic library")
|
||||||
|
|
||||||
# Object file suffixes
|
# Object file suffixes
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
set(LUA_BUILD_BUILD_DLL_DEFAULT ON)
|
set(LUA_BUILD_BUILD_DLL_DEFAULT ON)
|
||||||
set(LUA_BUILD_OBJECT_FILE_SUFFIX .obj)
|
set(LUA_BUILD_OBJECT_FILE_SUFFIX .obj)
|
||||||
else()
|
else()
|
||||||
set(LUA_BUILD_BUILD_DLL_DEFAULT OFF)
|
set(LUA_BUILD_BUILD_DLL_DEFAULT OFF)
|
||||||
set(LUA_BUILD_OBJECT_FILE_SUFFIX .o)
|
set(LUA_BUILD_OBJECT_FILE_SUFFIX .o)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# # # Options
|
# # # Options
|
||||||
option(BUILD_LUA_AS_DLL ${LUA_BUILD_BUILD_DLL_DEFAULT} "Build Lua or LuaJIT as a Shared/Dynamic Link Library")
|
option(BUILD_LUA_AS_DLL ${LUA_BUILD_BUILD_DLL_DEFAULT} "Build Lua or LuaJIT as a Shared/Dynamic Link Library")
|
||||||
|
|
||||||
STRING(TOLOWER ${LUA_BUILD_LIBNAME} LUA_BUILD_NORMALIZED_LIBNAME)
|
STRING(TOLOWER ${LUA_BUILD_LIBNAME} LUA_BUILD_NORMALIZED_LIBNAME)
|
||||||
if (NOT LUA_LIBRARY_NAME)
|
if (NOT LUA_LIBRARY_NAME)
|
||||||
if (LUA_BUILD_NORMALIZED_LIBNAME MATCHES "luajit")
|
if (LUA_BUILD_NORMALIZED_LIBNAME MATCHES "luajit")
|
||||||
set(LUA_LIBRARY luajit)
|
set(LUA_LIBRARY luajit)
|
||||||
else()
|
else()
|
||||||
set(LUA_LIBRARY ${LUA_BUILD_LIBNAME})
|
set(LUA_LIBRARY ${LUA_BUILD_LIBNAME})
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
set(LUA_LIBRARY_NAME ${LUA_LIBRARY_NAME}
|
set(LUA_LIBRARY_NAME ${LUA_LIBRARY_NAME}
|
||||||
CACHE STRING
|
CACHE STRING
|
||||||
${LUA_BUILD_LIBRARY_DESCRIPTION})
|
${LUA_BUILD_LIBRARY_DESCRIPTION})
|
||||||
endif()
|
endif()
|
||||||
# # Dependent Variables
|
# # Dependent Variables
|
||||||
# If we're building a DLL, then set the library type to SHARED
|
# If we're building a DLL, then set the library type to SHARED
|
||||||
if (BUILD_LUA_AS_DLL)
|
if (BUILD_LUA_AS_DLL)
|
||||||
set(LUA_BUILD_LIBRARY_TYPE SHARED)
|
set(LUA_BUILD_LIBRARY_TYPE SHARED)
|
||||||
else()
|
else()
|
||||||
set(LUA_BUILD_LIBRARY_TYPE STATIC)
|
set(LUA_BUILD_LIBRARY_TYPE STATIC)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# # # Build Lua
|
# # # Build Lua
|
||||||
# # Select either LuaJIT or Vanilla Lua here, based on what we discover
|
# # Select either LuaJIT or Vanilla Lua here, based on what we discover
|
||||||
if (BUILD_LUAJIT OR LUA_BUILD_NORMALIZED_LUA_VERSION MATCHES "luajit")
|
if (BUILD_LUAJIT OR LUA_BUILD_NORMALIZED_LUA_VERSION MATCHES "luajit")
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/FindLuaBuild/LuaJIT.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/FindLuaBuild/LuaJIT.cmake)
|
||||||
set(LUA_VERSION_STRING ${LUA_JIT_VERSION})
|
set(LUA_VERSION_STRING ${LUA_JIT_VERSION})
|
||||||
else()
|
else()
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/FindLuaBuild/LuaVanilla.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/FindLuaBuild/LuaVanilla.cmake)
|
||||||
set(LUA_VERSION_STRING ${LUA_VANILLA_VERSION})
|
set(LUA_VERSION_STRING ${LUA_VANILLA_VERSION})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# # Export variables to the parent scope
|
# # Export variables to the parent scope
|
||||||
set(LUA_LIBRARIES ${LUA_LIBRARIES} PARENT_SCOPE)
|
set(LUA_LIBRARIES ${LUA_LIBRARIES} PARENT_SCOPE)
|
||||||
set(LUA_INTERPRETER ${LUA_INTERPRETER} PARENT_SCOPE)
|
set(LUA_INTERPRETER ${LUA_INTERPRETER} PARENT_SCOPE)
|
||||||
set(LUA_VERSION_STRING ${LUA_VERSION_STRING} PARENT_SCOPE)
|
set(LUA_VERSION_STRING ${LUA_VERSION_STRING} PARENT_SCOPE)
|
||||||
set(LUABUILD_FOUND TRUE PARENT_SCOPE)
|
set(LUABUILD_FOUND TRUE PARENT_SCOPE)
|
||||||
endfunction(find_lua_build)
|
endfunction(find_lua_build)
|
||||||
|
|
||||||
# Call and then immediately undefine to avoid polluting the global scope
|
# Call and then immediately undefine to avoid polluting the global scope
|
||||||
if (LuaBuild_FIND_COMPONENTS)
|
if (LuaBuild_FIND_COMPONENTS)
|
||||||
list(GET LuaBuild_FIND_COMPONENTS 0 LUA_VERSION)
|
list(GET LuaBuild_FIND_COMPONENTS 0 LUA_VERSION)
|
||||||
else()
|
endif()
|
||||||
set(LUA_VERSION 5.3.4)
|
if (LuaBuild_VERSION)
|
||||||
endif()
|
if (LUA_VERSION)
|
||||||
find_lua_build(${LUA_VERSION})
|
set(LUA_VERSION "${LUA_VERSION}-${LuaBuild_VERSION}")
|
||||||
unset(find_lua_build)
|
else()
|
||||||
|
set(LUA_VERSION "${LuaBuild_VERSION}")
|
||||||
# handle the QUIETLY and REQUIRED arguments and set LUABUILD_FOUND to TRUE if
|
endif()
|
||||||
# all listed variables are TRUE
|
endif()
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LuaBuild
|
if (NOT LUA_VERSION)
|
||||||
FOUND_VAR LUABUILD_FOUND
|
set(LUA_VERSION 5.3.4)
|
||||||
REQUIRED_VARS LUA_LIBRARIES LUA_INTERPRETER
|
endif()
|
||||||
VERSION_VAR LUA_VERSION_STRING)
|
find_lua_build(${LUA_VERSION})
|
||||||
|
unset(find_lua_build)
|
||||||
|
|
||||||
|
# handle the QUIETLY and REQUIRED arguments and set LUABUILD_FOUND to TRUE if
|
||||||
|
# all listed variables are TRUE
|
||||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LuaBuild
|
||||||
|
FOUND_VAR LUABUILD_FOUND
|
||||||
|
REQUIRED_VARS LUA_LIBRARIES LUA_INTERPRETER
|
||||||
|
VERSION_VAR LUA_VERSION_STRING)
|
||||||
|
40511
single/sol/sol.hpp
40511
single/sol/sol.hpp
File diff suppressed because it is too large
Load Diff
@ -1,292 +1,292 @@
|
|||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
// the Software without restriction, including without limitation the rights to
|
// the Software without restriction, including without limitation the rights to
|
||||||
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
// the Software, and to permit persons to whom the Software is furnished to do so,
|
// the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
// subject to the following conditions:
|
// subject to the following conditions:
|
||||||
|
|
||||||
// The above copyright notice and this permission notice shall be included in all
|
// The above copyright notice and this permission notice shall be included in all
|
||||||
// copies or substantial portions of the Software.
|
// copies or substantial portions of the Software.
|
||||||
|
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// This file was generated with a script.
|
// This file was generated with a script.
|
||||||
// Generated 2018-01-24 00:50:30.920977 UTC
|
// Generated 2018-01-24 05:51:14.129707 UTC
|
||||||
// This header was generated with sol v2.19.0 (revision db9c5d6)
|
// This header was generated with sol v2.19.0 (revision 83f4b4a)
|
||||||
// https://github.com/ThePhD/sol2
|
// https://github.com/ThePhD/sol2
|
||||||
|
|
||||||
#ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP
|
#ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP
|
||||||
#define SOL_SINGLE_INCLUDE_FORWARD_HPP
|
#define SOL_SINGLE_INCLUDE_FORWARD_HPP
|
||||||
|
|
||||||
// beginning of sol/forward.hpp
|
// beginning of sol/forward.hpp
|
||||||
|
|
||||||
// beginning of sol/feature_test.hpp
|
// beginning of sol/feature_test.hpp
|
||||||
|
|
||||||
#if (defined(__cplusplus) && __cplusplus == 201703L) || (defined(_MSC_VER) && _MSC_VER > 1900 && ((defined(_HAS_CXX17) && _HAS_CXX17 == 1) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201402L))))
|
#if (defined(__cplusplus) && __cplusplus == 201703L) || (defined(_MSC_VER) && _MSC_VER > 1900 && ((defined(_HAS_CXX17) && _HAS_CXX17 == 1) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201402L))))
|
||||||
#ifndef SOL_CXX17_FEATURES
|
#ifndef SOL_CXX17_FEATURES
|
||||||
#define SOL_CXX17_FEATURES 1
|
#define SOL_CXX17_FEATURES 1
|
||||||
#endif // C++17 features macro
|
#endif // C++17 features macro
|
||||||
#endif // C++17 features check
|
#endif // C++17 features check
|
||||||
|
|
||||||
#ifdef SOL_CXX17_FEATURES
|
#ifdef SOL_CXX17_FEATURES
|
||||||
#if defined(__cpp_noexcept_function_type) || ((defined(_MSC_VER) && _MSC_VER > 1911) && (defined(_MSVC_LANG) && ((_MSVC_LANG >= 201703L) && defined(_WIN64))))
|
#if defined(__cpp_noexcept_function_type) || ((defined(_MSC_VER) && _MSC_VER > 1911) && (defined(_MSVC_LANG) && ((_MSVC_LANG >= 201703L) && defined(_WIN64))))
|
||||||
#ifndef SOL_NOEXCEPT_FUNCTION_TYPE
|
#ifndef SOL_NOEXCEPT_FUNCTION_TYPE
|
||||||
#define SOL_NOEXCEPT_FUNCTION_TYPE 1
|
#define SOL_NOEXCEPT_FUNCTION_TYPE 1
|
||||||
#endif // noexcept is part of a function's type
|
#endif // noexcept is part of a function's type
|
||||||
#endif // compiler-specific checks
|
#endif // compiler-specific checks
|
||||||
#endif // C++17 only
|
#endif // C++17 only
|
||||||
|
|
||||||
#if defined(_WIN32) || defined(_MSC_VER)
|
#if defined(_WIN32) || defined(_MSC_VER)
|
||||||
#ifndef SOL_CODECVT_SUPPORT
|
#ifndef SOL_CODECVT_SUPPORT
|
||||||
#define SOL_CODECVT_SUPPORT 1
|
#define SOL_CODECVT_SUPPORT 1
|
||||||
#endif // sol codecvt support
|
#endif // sol codecvt support
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
#if __GNUC__ >= 5
|
#if __GNUC__ >= 5
|
||||||
#ifndef SOL_CODECVT_SUPPORT
|
#ifndef SOL_CODECVT_SUPPORT
|
||||||
#define SOL_CODECVT_SUPPORT 1
|
#define SOL_CODECVT_SUPPORT 1
|
||||||
#endif // codecvt support
|
#endif // codecvt support
|
||||||
#endif // g++ 5.x.x (MinGW too)
|
#endif // g++ 5.x.x (MinGW too)
|
||||||
#else
|
#else
|
||||||
#endif // Windows/VC++ vs. g++ vs Others
|
#endif // Windows/VC++ vs. g++ vs Others
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#if defined(_DEBUG) && !defined(NDEBUG)
|
#if defined(_DEBUG) && !defined(NDEBUG)
|
||||||
|
|
||||||
#ifndef SOL_IN_DEBUG_DETECTED
|
#ifndef SOL_IN_DEBUG_DETECTED
|
||||||
#define SOL_IN_DEBUG_DETECTED 1
|
#define SOL_IN_DEBUG_DETECTED 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // VC++ Debug macros
|
#endif // VC++ Debug macros
|
||||||
|
|
||||||
#ifndef _CPPUNWIND
|
#ifndef _CPPUNWIND
|
||||||
#ifndef SOL_NO_EXCEPTIONS
|
#ifndef SOL_NO_EXCEPTIONS
|
||||||
#define SOL_NO_EXCEPTIONS 1
|
#define SOL_NO_EXCEPTIONS 1
|
||||||
#endif
|
#endif
|
||||||
#endif // Automatic Exceptions
|
#endif // Automatic Exceptions
|
||||||
|
|
||||||
#ifndef _CPPRTTI
|
#ifndef _CPPRTTI
|
||||||
#ifndef SOL_NO_RTTI
|
#ifndef SOL_NO_RTTI
|
||||||
#define SOL_NO_RTTI 1
|
#define SOL_NO_RTTI 1
|
||||||
#endif
|
#endif
|
||||||
#endif // Automatic RTTI
|
#endif // Automatic RTTI
|
||||||
#elif defined(__GNUC__) || defined(__clang__)
|
#elif defined(__GNUC__) || defined(__clang__)
|
||||||
|
|
||||||
#if !defined(NDEBUG) && !defined(__OPTIMIZE__)
|
#if !defined(NDEBUG) && !defined(__OPTIMIZE__)
|
||||||
|
|
||||||
#ifndef SOL_IN_DEBUG_DETECTED
|
#ifndef SOL_IN_DEBUG_DETECTED
|
||||||
#define SOL_IN_DEBUG_DETECTED 1
|
#define SOL_IN_DEBUG_DETECTED 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // Not Debug && g++ optimizer flag
|
#endif // Not Debug && g++ optimizer flag
|
||||||
|
|
||||||
#ifndef __EXCEPTIONS
|
#ifndef __EXCEPTIONS
|
||||||
#ifndef SOL_NO_EXCEPTIONS
|
#ifndef SOL_NO_EXCEPTIONS
|
||||||
#define SOL_NO_EXCEPTIONS 1
|
#define SOL_NO_EXCEPTIONS 1
|
||||||
#endif
|
#endif
|
||||||
#endif // No Exceptions
|
#endif // No Exceptions
|
||||||
|
|
||||||
#ifndef __GXX_RTTI
|
#ifndef __GXX_RTTI
|
||||||
#ifndef SOL_NO_RTII
|
#ifndef SOL_NO_RTII
|
||||||
#define SOL_NO_RTTI 1
|
#define SOL_NO_RTTI 1
|
||||||
#endif
|
#endif
|
||||||
#endif // No RTTI
|
#endif // No RTTI
|
||||||
|
|
||||||
#endif // vc++ || clang++/g++
|
#endif // vc++ || clang++/g++
|
||||||
|
|
||||||
#if defined(SOL_CHECK_ARGUMENTS)
|
#if defined(SOL_CHECK_ARGUMENTS)
|
||||||
|
|
||||||
#if !defined(SOL_SAFE_GETTER)
|
#if !defined(SOL_SAFE_GETTER)
|
||||||
#define SOL_SAFE_GETTER 1
|
#define SOL_SAFE_GETTER 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(SOL_SAFE_USERTYPE)
|
#if !defined(SOL_SAFE_USERTYPE)
|
||||||
#define SOL_SAFE_USERTYPE 1
|
#define SOL_SAFE_USERTYPE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(SOL_SAFE_REFERENCES)
|
#if !defined(SOL_SAFE_REFERENCES)
|
||||||
#define SOL_SAFE_REFERENCES 1
|
#define SOL_SAFE_REFERENCES 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(SOL_SAFE_FUNCTION)
|
#if !defined(SOL_SAFE_FUNCTION)
|
||||||
#define SOL_SAFE_FUNCTION 1
|
#define SOL_SAFE_FUNCTION 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(SOL_SAFE_FUNCTION_CALLS)
|
#if !defined(SOL_SAFE_FUNCTION_CALLS)
|
||||||
#define SOL_SAFE_FUNCTION_CALLS 1
|
#define SOL_SAFE_FUNCTION_CALLS 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(SOL_SAFE_PROXIES)
|
#if !defined(SOL_SAFE_PROXIES)
|
||||||
#define SOL_SAFE_PROXIES 1
|
#define SOL_SAFE_PROXIES 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(SOL_SAFE_NUMERICS)
|
#if !defined(SOL_SAFE_NUMERICS)
|
||||||
#define SOL_SAFE_NUMERICS 1
|
#define SOL_SAFE_NUMERICS 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // Turn on Safety for all if top-level macro is defined
|
#endif // Turn on Safety for all if top-level macro is defined
|
||||||
|
|
||||||
#ifdef SOL_IN_DEBUG_DETECTED
|
#ifdef SOL_IN_DEBUG_DETECTED
|
||||||
|
|
||||||
#if !defined(SOL_SAFE_REFERENCES)
|
#if !defined(SOL_SAFE_REFERENCES)
|
||||||
#define SOL_SAFE_REFERENCES 1
|
#define SOL_SAFE_REFERENCES 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(SOL_SAFE_USERTYPE)
|
#if !defined(SOL_SAFE_USERTYPE)
|
||||||
#define SOL_SAFE_USERTYPE 1
|
#define SOL_SAFE_USERTYPE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(SOL_SAFE_FUNCTION_CALLS)
|
#if !defined(SOL_SAFE_FUNCTION_CALLS)
|
||||||
#define SOL_SAFE_FUNCTION_CALLS 1
|
#define SOL_SAFE_FUNCTION_CALLS 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // Turn on all debug safety features for VC++ / g++ / clang++ and similar
|
#endif // Turn on all debug safety features for VC++ / g++ / clang++ and similar
|
||||||
|
|
||||||
#if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) || defined(__OBJC__) || defined(nil)
|
#if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) || defined(__OBJC__) || defined(nil)
|
||||||
#if !defined(SOL_NO_NIL)
|
#if !defined(SOL_NO_NIL)
|
||||||
#define SOL_NO_NIL 1
|
#define SOL_NO_NIL 1
|
||||||
#endif
|
#endif
|
||||||
#endif // avoiding nil defines / keywords
|
#endif // avoiding nil defines / keywords
|
||||||
|
|
||||||
// end of sol/feature_test.hpp
|
// end of sol/feature_test.hpp
|
||||||
|
|
||||||
namespace sol {
|
namespace sol {
|
||||||
|
|
||||||
template <bool b>
|
template <bool b>
|
||||||
class basic_reference;
|
class basic_reference;
|
||||||
using reference = basic_reference<false>;
|
using reference = basic_reference<false>;
|
||||||
using main_reference = basic_reference<true>;
|
using main_reference = basic_reference<true>;
|
||||||
class stack_reference;
|
class stack_reference;
|
||||||
|
|
||||||
struct proxy_base_tag;
|
struct proxy_base_tag;
|
||||||
template <typename Super>
|
template <typename Super>
|
||||||
struct proxy_base;
|
struct proxy_base;
|
||||||
template <typename Table, typename Key>
|
template <typename Table, typename Key>
|
||||||
struct proxy;
|
struct proxy;
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class usertype;
|
class usertype;
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class simple_usertype;
|
class simple_usertype;
|
||||||
template <bool, typename T>
|
template <bool, typename T>
|
||||||
class basic_table_core;
|
class basic_table_core;
|
||||||
template <bool b>
|
template <bool b>
|
||||||
using table_core = basic_table_core<b, reference>;
|
using table_core = basic_table_core<b, reference>;
|
||||||
template <bool b>
|
template <bool b>
|
||||||
using main_table_core = basic_table_core<b, main_reference>;
|
using main_table_core = basic_table_core<b, main_reference>;
|
||||||
template <bool b>
|
template <bool b>
|
||||||
using stack_table_core = basic_table_core<b, stack_reference>;
|
using stack_table_core = basic_table_core<b, stack_reference>;
|
||||||
template <typename T>
|
template <typename T>
|
||||||
using basic_table = basic_table_core<false, T>;
|
using basic_table = basic_table_core<false, T>;
|
||||||
typedef table_core<false> table;
|
typedef table_core<false> table;
|
||||||
typedef table_core<true> global_table;
|
typedef table_core<true> global_table;
|
||||||
typedef main_table_core<false> main_table;
|
typedef main_table_core<false> main_table;
|
||||||
typedef main_table_core<true> main_global_table;
|
typedef main_table_core<true> main_global_table;
|
||||||
typedef stack_table_core<false> stack_table;
|
typedef stack_table_core<false> stack_table;
|
||||||
typedef stack_table_core<true> stack_global_table;
|
typedef stack_table_core<true> stack_global_table;
|
||||||
template <typename base_t>
|
template <typename base_t>
|
||||||
struct basic_environment;
|
struct basic_environment;
|
||||||
using environment = basic_environment<reference>;
|
using environment = basic_environment<reference>;
|
||||||
using main_environment = basic_environment<main_reference>;
|
using main_environment = basic_environment<main_reference>;
|
||||||
using stack_environment = basic_environment<stack_reference>;
|
using stack_environment = basic_environment<stack_reference>;
|
||||||
template <typename T, bool>
|
template <typename T, bool>
|
||||||
class basic_function;
|
class basic_function;
|
||||||
template <typename T, bool, typename H>
|
template <typename T, bool, typename H>
|
||||||
class basic_protected_function;
|
class basic_protected_function;
|
||||||
using unsafe_function = basic_function<reference, false>;
|
using unsafe_function = basic_function<reference, false>;
|
||||||
using safe_function = basic_protected_function<reference, false, reference>;
|
using safe_function = basic_protected_function<reference, false, reference>;
|
||||||
using main_unsafe_function = basic_function<main_reference, false>;
|
using main_unsafe_function = basic_function<main_reference, false>;
|
||||||
using main_safe_function = basic_protected_function<main_reference, false, reference>;
|
using main_safe_function = basic_protected_function<main_reference, false, reference>;
|
||||||
using stack_unsafe_function = basic_function<stack_reference, false>;
|
using stack_unsafe_function = basic_function<stack_reference, false>;
|
||||||
using stack_safe_function = basic_protected_function<stack_reference, false, reference>;
|
using stack_safe_function = basic_protected_function<stack_reference, false, reference>;
|
||||||
using stack_aligned_unsafe_function = basic_function<stack_reference, true>;
|
using stack_aligned_unsafe_function = basic_function<stack_reference, true>;
|
||||||
using stack_aligned_safe_function = basic_protected_function<stack_reference, true, reference>;
|
using stack_aligned_safe_function = basic_protected_function<stack_reference, true, reference>;
|
||||||
using protected_function = safe_function;
|
using protected_function = safe_function;
|
||||||
using main_protected_function = main_safe_function;
|
using main_protected_function = main_safe_function;
|
||||||
using stack_protected_function = stack_safe_function;
|
using stack_protected_function = stack_safe_function;
|
||||||
using stack_aligned_protected_function = stack_aligned_safe_function;
|
using stack_aligned_protected_function = stack_aligned_safe_function;
|
||||||
#ifdef SOL_SAFE_FUNCTION
|
#ifdef SOL_SAFE_FUNCTION
|
||||||
using function = protected_function;
|
using function = protected_function;
|
||||||
using main_function = main_protected_function;
|
using main_function = main_protected_function;
|
||||||
using stack_function = stack_protected_function;
|
using stack_function = stack_protected_function;
|
||||||
#else
|
#else
|
||||||
using function = unsafe_function;
|
using function = unsafe_function;
|
||||||
using main_function = main_unsafe_function;
|
using main_function = main_unsafe_function;
|
||||||
using stack_function = stack_unsafe_function;
|
using stack_function = stack_unsafe_function;
|
||||||
#endif
|
#endif
|
||||||
using stack_aligned_function = stack_aligned_unsafe_function;
|
using stack_aligned_function = stack_aligned_unsafe_function;
|
||||||
using stack_aligned_stack_handler_function = basic_protected_function<stack_reference, true, stack_reference>;
|
using stack_aligned_stack_handler_function = basic_protected_function<stack_reference, true, stack_reference>;
|
||||||
|
|
||||||
struct unsafe_function_result;
|
struct unsafe_function_result;
|
||||||
struct protected_function_result;
|
struct protected_function_result;
|
||||||
using safe_function_result = protected_function_result;
|
using safe_function_result = protected_function_result;
|
||||||
#ifdef SOL_SAFE_FUNCTION
|
#ifdef SOL_SAFE_FUNCTION
|
||||||
using function_result = safe_function_result;
|
using function_result = safe_function_result;
|
||||||
#else
|
#else
|
||||||
using function_result = unsafe_function_result;
|
using function_result = unsafe_function_result;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
template <typename base_t>
|
template <typename base_t>
|
||||||
class basic_object;
|
class basic_object;
|
||||||
template <typename base_t>
|
template <typename base_t>
|
||||||
class basic_userdata;
|
class basic_userdata;
|
||||||
template <typename base_t>
|
template <typename base_t>
|
||||||
class basic_lightuserdata;
|
class basic_lightuserdata;
|
||||||
template <typename base_t>
|
template <typename base_t>
|
||||||
class basic_coroutine;
|
class basic_coroutine;
|
||||||
template <typename base_t>
|
template <typename base_t>
|
||||||
class basic_thread;
|
class basic_thread;
|
||||||
|
|
||||||
using object = basic_object<reference>;
|
using object = basic_object<reference>;
|
||||||
using userdata = basic_userdata<reference>;
|
using userdata = basic_userdata<reference>;
|
||||||
using lightuserdata = basic_lightuserdata<reference>;
|
using lightuserdata = basic_lightuserdata<reference>;
|
||||||
using thread = basic_thread<reference>;
|
using thread = basic_thread<reference>;
|
||||||
using coroutine = basic_coroutine<reference>;
|
using coroutine = basic_coroutine<reference>;
|
||||||
using main_object = basic_object<main_reference>;
|
using main_object = basic_object<main_reference>;
|
||||||
using main_userdata = basic_userdata<main_reference>;
|
using main_userdata = basic_userdata<main_reference>;
|
||||||
using main_lightuserdata = basic_lightuserdata<main_reference>;
|
using main_lightuserdata = basic_lightuserdata<main_reference>;
|
||||||
using main_coroutine = basic_coroutine<main_reference>;
|
using main_coroutine = basic_coroutine<main_reference>;
|
||||||
using stack_object = basic_object<stack_reference>;
|
using stack_object = basic_object<stack_reference>;
|
||||||
using stack_userdata = basic_userdata<stack_reference>;
|
using stack_userdata = basic_userdata<stack_reference>;
|
||||||
using stack_lightuserdata = basic_lightuserdata<stack_reference>;
|
using stack_lightuserdata = basic_lightuserdata<stack_reference>;
|
||||||
using stack_thread = basic_thread<stack_reference>;
|
using stack_thread = basic_thread<stack_reference>;
|
||||||
using stack_coroutine = basic_coroutine<stack_reference>;
|
using stack_coroutine = basic_coroutine<stack_reference>;
|
||||||
|
|
||||||
struct stack_proxy_base;
|
struct stack_proxy_base;
|
||||||
struct stack_proxy;
|
struct stack_proxy;
|
||||||
struct variadic_args;
|
struct variadic_args;
|
||||||
struct variadic_results;
|
struct variadic_results;
|
||||||
struct stack_count;
|
struct stack_count;
|
||||||
struct this_state;
|
struct this_state;
|
||||||
struct this_main_state;
|
struct this_main_state;
|
||||||
struct this_environment;
|
struct this_environment;
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct as_table_t;
|
struct as_table_t;
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct as_container_t;
|
struct as_container_t;
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct nested;
|
struct nested;
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct light;
|
struct light;
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct user;
|
struct user;
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct as_args_t;
|
struct as_args_t;
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct protect_t;
|
struct protect_t;
|
||||||
template <typename F, typename... Filters>
|
template <typename F, typename... Filters>
|
||||||
struct filter_wrapper;
|
struct filter_wrapper;
|
||||||
} // namespace sol
|
} // namespace sol
|
||||||
|
|
||||||
// end of sol/forward.hpp
|
// end of sol/forward.hpp
|
||||||
|
|
||||||
#endif // SOL_SINGLE_INCLUDE_FORWARD_HPP
|
#endif // SOL_SINGLE_INCLUDE_FORWARD_HPP
|
||||||
|
@ -519,6 +519,7 @@ namespace sol {
|
|||||||
> KV;
|
> KV;
|
||||||
typedef typename KV::first_type K;
|
typedef typename KV::first_type K;
|
||||||
typedef typename KV::second_type V;
|
typedef typename KV::second_type V;
|
||||||
|
typedef std::conditional_t<is_matched_lookup::value, std::ptrdiff_t, K> next_K;
|
||||||
typedef decltype(*std::declval<iterator&>()) iterator_return;
|
typedef decltype(*std::declval<iterator&>()) iterator_return;
|
||||||
typedef std::conditional_t<is_associative::value || is_matched_lookup::value,
|
typedef std::conditional_t<is_associative::value || is_matched_lookup::value,
|
||||||
std::add_lvalue_reference_t<V>,
|
std::add_lvalue_reference_t<V>,
|
||||||
@ -914,7 +915,7 @@ namespace sol {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static error_result insert_has(std::true_type, lua_State* L, T& self, stack_object key, stack_object value) {
|
static error_result insert_has(std::true_type, lua_State* L, T& self, stack_object key, stack_object value) {
|
||||||
return insert_lookup(meta::all<is_associative, is_lookup>(), L, self, std::move(key), std::move(value));
|
return insert_lookup(meta::any<is_associative, is_lookup>(), L, self, std::move(key), std::move(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
static error_result insert_has(std::false_type, lua_State* L, T& self, stack_object where, stack_object value) {
|
static error_result insert_has(std::false_type, lua_State* L, T& self, stack_object where, stack_object value) {
|
||||||
@ -1057,21 +1058,12 @@ namespace sol {
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <bool ip>
|
|
||||||
static int pairs_associative(std::true_type, lua_State* L) {
|
|
||||||
auto& src = get_src(L);
|
|
||||||
stack::push(L, next<ip>);
|
|
||||||
stack::push<user<iter>>(L, src, deferred_traits::begin(L, src));
|
|
||||||
stack::push(L, lua_nil);
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <bool>
|
template <bool>
|
||||||
static int next_associative(std::false_type, lua_State* L) {
|
static int next_associative(std::false_type, lua_State* L) {
|
||||||
iter& i = stack::get<user<iter>>(L, 1);
|
iter& i = stack::get<user<iter>>(L, 1);
|
||||||
auto& source = i.source;
|
auto& source = i.source;
|
||||||
auto& it = i.it;
|
auto& it = i.it;
|
||||||
K k = stack::get<K>(L, 2);
|
next_K k = stack::get<next_K>(L, 2);
|
||||||
if (it == deferred_traits::end(L, source)) {
|
if (it == deferred_traits::end(L, source)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1082,6 +1074,21 @@ namespace sol {
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <bool ip>
|
||||||
|
static int next(lua_State* L) {
|
||||||
|
typedef meta::any<is_associative, meta::all<is_lookup, meta::neg<is_matched_lookup>>> is_assoc;
|
||||||
|
return next_associative<ip>(is_assoc(), L);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <bool ip>
|
||||||
|
static int pairs_associative(std::true_type, lua_State* L) {
|
||||||
|
auto& src = get_src(L);
|
||||||
|
stack::push(L, next<ip>);
|
||||||
|
stack::push<user<iter>>(L, src, deferred_traits::begin(L, src));
|
||||||
|
stack::push(L, lua_nil);
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
template <bool ip>
|
template <bool ip>
|
||||||
static int pairs_associative(std::false_type, lua_State* L) {
|
static int pairs_associative(std::false_type, lua_State* L) {
|
||||||
auto& src = get_src(L);
|
auto& src = get_src(L);
|
||||||
@ -1091,12 +1098,6 @@ namespace sol {
|
|||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <bool ip>
|
|
||||||
static int next(lua_State* L) {
|
|
||||||
typedef meta::any<is_associative, meta::all<is_lookup, meta::neg<is_matched_lookup>>> is_assoc;
|
|
||||||
return next_associative<ip>(is_assoc(), L);
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static int get(lua_State* L) {
|
static int get(lua_State* L) {
|
||||||
auto& self = get_src(L);
|
auto& self = get_src(L);
|
||||||
|
@ -1,105 +1,105 @@
|
|||||||
// sol2
|
// sol2
|
||||||
|
|
||||||
// The MIT License (MIT)
|
// The MIT License (MIT)
|
||||||
|
|
||||||
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
// Copyright (c) 2013-2017 Rapptz, ThePhD and contributors
|
||||||
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
// this software and associated documentation files (the "Software"), to deal in
|
// this software and associated documentation files (the "Software"), to deal in
|
||||||
// the Software without restriction, including without limitation the rights to
|
// the Software without restriction, including without limitation the rights to
|
||||||
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
// the Software, and to permit persons to whom the Software is furnished to do so,
|
// the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
// subject to the following conditions:
|
// subject to the following conditions:
|
||||||
|
|
||||||
// The above copyright notice and this permission notice shall be included in all
|
// The above copyright notice and this permission notice shall be included in all
|
||||||
// copies or substantial portions of the Software.
|
// copies or substantial portions of the Software.
|
||||||
|
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
#ifndef SOL_INHERITANCE_HPP
|
#ifndef SOL_INHERITANCE_HPP
|
||||||
#define SOL_INHERITANCE_HPP
|
#define SOL_INHERITANCE_HPP
|
||||||
|
|
||||||
#include "types.hpp"
|
#include "types.hpp"
|
||||||
|
|
||||||
namespace sol {
|
namespace sol {
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
struct base_list {};
|
struct base_list {};
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
using bases = base_list<Args...>;
|
using bases = base_list<Args...>;
|
||||||
|
|
||||||
typedef bases<> base_classes_tag;
|
typedef bases<> base_classes_tag;
|
||||||
const auto base_classes = base_classes_tag();
|
const auto base_classes = base_classes_tag();
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct has_derived {
|
struct has_derived {
|
||||||
static bool value;
|
static bool value;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
bool has_derived<T>::value = false;
|
bool has_derived<T>::value = false;
|
||||||
|
|
||||||
inline decltype(auto) base_class_check_key() {
|
inline decltype(auto) base_class_check_key() {
|
||||||
static const auto& key = "class_check";
|
static const auto& key = "class_check";
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline decltype(auto) base_class_cast_key() {
|
inline decltype(auto) base_class_cast_key() {
|
||||||
static const auto& key = "class_cast";
|
static const auto& key = "class_cast";
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline decltype(auto) base_class_index_propogation_key() {
|
inline decltype(auto) base_class_index_propogation_key() {
|
||||||
static const auto& key = u8"\xF0\x9F\x8C\xB2.index";
|
static const auto& key = u8"\xF0\x9F\x8C\xB2.index";
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline decltype(auto) base_class_new_index_propogation_key() {
|
inline decltype(auto) base_class_new_index_propogation_key() {
|
||||||
static const auto& key = u8"\xF0\x9F\x8C\xB2.new_index";
|
static const auto& key = u8"\xF0\x9F\x8C\xB2.new_index";
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, typename... Bases>
|
template <typename T, typename... Bases>
|
||||||
struct inheritance {
|
struct inheritance {
|
||||||
static bool type_check_bases(types<>, const std::string&) {
|
static bool type_check_bases(types<>, const std::string&) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Base, typename... Args>
|
template <typename Base, typename... Args>
|
||||||
static bool type_check_bases(types<Base, Args...>, const std::string& ti) {
|
static bool type_check_bases(types<Base, Args...>, const std::string& ti) {
|
||||||
return ti == usertype_traits<Base>::qualified_name() || type_check_bases(types<Args...>(), ti);
|
return ti == usertype_traits<Base>::qualified_name() || type_check_bases(types<Args...>(), ti);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool type_check(const std::string& ti) {
|
static bool type_check(const std::string& ti) {
|
||||||
return ti == usertype_traits<T>::qualified_name() || type_check_bases(types<Bases...>(), ti);
|
return ti == usertype_traits<T>::qualified_name() || type_check_bases(types<Bases...>(), ti);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void* type_cast_bases(types<>, T*, const std::string&) {
|
static void* type_cast_bases(types<>, T*, const std::string&) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Base, typename... Args>
|
template <typename Base, typename... Args>
|
||||||
static void* type_cast_bases(types<Base, Args...>, T* data, const std::string& ti) {
|
static void* type_cast_bases(types<Base, Args...>, T* data, const std::string& ti) {
|
||||||
// Make sure to convert to T first, and then dynamic cast to the proper type
|
// Make sure to convert to T first, and then dynamic cast to the proper type
|
||||||
return ti != usertype_traits<Base>::qualified_name() ? type_cast_bases(types<Args...>(), data, ti) : static_cast<void*>(static_cast<Base*>(data));
|
return ti != usertype_traits<Base>::qualified_name() ? type_cast_bases(types<Args...>(), data, ti) : static_cast<void*>(static_cast<Base*>(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void* type_cast(void* voiddata, const std::string& ti) {
|
static void* type_cast(void* voiddata, const std::string& ti) {
|
||||||
T* data = static_cast<T*>(voiddata);
|
T* data = static_cast<T*>(voiddata);
|
||||||
return static_cast<void*>(ti != usertype_traits<T>::qualified_name() ? type_cast_bases(types<Bases...>(), data, ti) : data);
|
return static_cast<void*>(ti != usertype_traits<T>::qualified_name() ? type_cast_bases(types<Bases...>(), data, ti) : data);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
using inheritance_check_function = decltype(&inheritance<void>::type_check);
|
using inheritance_check_function = decltype(&inheritance<void>::type_check);
|
||||||
using inheritance_cast_function = decltype(&inheritance<void>::type_cast);
|
using inheritance_cast_function = decltype(&inheritance<void>::type_cast);
|
||||||
|
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
} // namespace sol
|
} // namespace sol
|
||||||
|
|
||||||
#endif // SOL_INHERITANCE_HPP
|
#endif // SOL_INHERITANCE_HPP
|
||||||
|
@ -551,7 +551,7 @@ namespace sol {
|
|||||||
struct is_lookup : meta::all<has_key_type<T>, has_value_type<T>> {};
|
struct is_lookup : meta::all<has_key_type<T>, has_value_type<T>> {};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct is_matched_lookup : meta_detail::is_matched_lookup_impl<T, meta::all<has_key_type<T>, has_value_type<T>>::value> {};
|
struct is_matched_lookup : meta_detail::is_matched_lookup_impl<T, is_lookup<T>::value> {};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
using is_string_constructible = any<
|
using is_string_constructible = any<
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -790,6 +790,16 @@ end
|
|||||||
REQUIRE((v3 == 14));
|
REQUIRE((v3 == 14));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
void lookup_container_check(sol::state& lua, T&) {
|
||||||
|
auto result0 = lua.safe_script("assert(c['a'] == 'a')", sol::script_default_on_error);
|
||||||
|
REQUIRE(result0.valid());
|
||||||
|
auto result1 = lua.safe_script("assert(c['b'] == 'b')", sol::script_default_on_error);
|
||||||
|
REQUIRE(result1.valid());
|
||||||
|
auto result2 = lua.safe_script("assert(c['c'] == 'c')", sol::script_default_on_error);
|
||||||
|
REQUIRE(result2.valid());
|
||||||
|
}
|
||||||
|
|
||||||
TEST_CASE("containers/sequence containers", "check all of the functinos for every single container") {
|
TEST_CASE("containers/sequence containers", "check all of the functinos for every single container") {
|
||||||
SECTION("vector") {
|
SECTION("vector") {
|
||||||
sol::state lua;
|
sol::state lua;
|
||||||
@ -869,6 +879,14 @@ TEST_CASE("containers/ordered lookup containers", "check ordered container types
|
|||||||
lua["c"] = &items;
|
lua["c"] = &items;
|
||||||
ordered_container_check(lua, items);
|
ordered_container_check(lua, items);
|
||||||
}
|
}
|
||||||
|
SECTION("set string") {
|
||||||
|
sol::state lua;
|
||||||
|
lua.open_libraries(sol::lib::base);
|
||||||
|
|
||||||
|
std::set<std::string> items({ "a", "b", "c" });
|
||||||
|
lua["c"] = &items;
|
||||||
|
lookup_container_check(lua, items);
|
||||||
|
}
|
||||||
SECTION("multiset") {
|
SECTION("multiset") {
|
||||||
sol::state lua;
|
sol::state lua;
|
||||||
lua.open_libraries(sol::lib::base);
|
lua.open_libraries(sol::lib::base);
|
||||||
@ -877,6 +895,14 @@ TEST_CASE("containers/ordered lookup containers", "check ordered container types
|
|||||||
lua["c"] = &items;
|
lua["c"] = &items;
|
||||||
ordered_container_check(lua, items);
|
ordered_container_check(lua, items);
|
||||||
}
|
}
|
||||||
|
SECTION("multiset string") {
|
||||||
|
sol::state lua;
|
||||||
|
lua.open_libraries(sol::lib::base);
|
||||||
|
|
||||||
|
std::multiset<std::string> items({ "a", "b", "c" });
|
||||||
|
lua["c"] = &items;
|
||||||
|
lookup_container_check(lua, items);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("containers/unordered lookup containers", "check ordered container types") {
|
TEST_CASE("containers/unordered lookup containers", "check ordered container types") {
|
||||||
@ -888,6 +914,14 @@ TEST_CASE("containers/unordered lookup containers", "check ordered container typ
|
|||||||
lua["c"] = &items;
|
lua["c"] = &items;
|
||||||
unordered_container_check(lua, items);
|
unordered_container_check(lua, items);
|
||||||
}
|
}
|
||||||
|
SECTION("unordered_set string") {
|
||||||
|
sol::state lua;
|
||||||
|
lua.open_libraries(sol::lib::base);
|
||||||
|
|
||||||
|
std::unordered_set<std::string> items({ "a", "b", "c" });
|
||||||
|
lua["c"] = &items;
|
||||||
|
lookup_container_check(lua, items);
|
||||||
|
}
|
||||||
SECTION("unordered_multiset") {
|
SECTION("unordered_multiset") {
|
||||||
sol::state lua;
|
sol::state lua;
|
||||||
lua.open_libraries(sol::lib::base);
|
lua.open_libraries(sol::lib::base);
|
||||||
@ -896,6 +930,14 @@ TEST_CASE("containers/unordered lookup containers", "check ordered container typ
|
|||||||
lua["c"] = &items;
|
lua["c"] = &items;
|
||||||
unordered_container_check(lua, items);
|
unordered_container_check(lua, items);
|
||||||
}
|
}
|
||||||
|
SECTION("unordered_multiset string") {
|
||||||
|
sol::state lua;
|
||||||
|
lua.open_libraries(sol::lib::base);
|
||||||
|
|
||||||
|
std::unordered_multiset<std::string> items({ "a", "b", "c" });
|
||||||
|
lua["c"] = &items;
|
||||||
|
lookup_container_check(lua, items);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("containers/associative ordered containers", "check associative (map) containers that are ordered fulfill basic functionality requirements") {
|
TEST_CASE("containers/associative ordered containers", "check associative (map) containers that are ordered fulfill basic functionality requirements") {
|
||||||
@ -913,6 +955,18 @@ TEST_CASE("containers/associative ordered containers", "check associative (map)
|
|||||||
lua["c"] = &items;
|
lua["c"] = &items;
|
||||||
associative_ordered_container_check(lua, items);
|
associative_ordered_container_check(lua, items);
|
||||||
}
|
}
|
||||||
|
SECTION("map string") {
|
||||||
|
sol::state lua;
|
||||||
|
lua.open_libraries(sol::lib::base);
|
||||||
|
|
||||||
|
std::map<std::string, std::string> items{
|
||||||
|
{ "a", "a" },
|
||||||
|
{ "b", "b" },
|
||||||
|
{ "c", "c" }
|
||||||
|
};
|
||||||
|
lua["c"] = &items;
|
||||||
|
lookup_container_check(lua, items);
|
||||||
|
}
|
||||||
SECTION("multimap") {
|
SECTION("multimap") {
|
||||||
sol::state lua;
|
sol::state lua;
|
||||||
lua.open_libraries(sol::lib::base);
|
lua.open_libraries(sol::lib::base);
|
||||||
@ -927,6 +981,18 @@ TEST_CASE("containers/associative ordered containers", "check associative (map)
|
|||||||
lua["c"] = &items;
|
lua["c"] = &items;
|
||||||
associative_ordered_container_check(lua, items);
|
associative_ordered_container_check(lua, items);
|
||||||
}
|
}
|
||||||
|
SECTION("multimap string") {
|
||||||
|
sol::state lua;
|
||||||
|
lua.open_libraries(sol::lib::base);
|
||||||
|
|
||||||
|
std::multimap<std::string, std::string> items{
|
||||||
|
{ "a", "a" },
|
||||||
|
{ "b", "b" },
|
||||||
|
{ "c", "c" }
|
||||||
|
};
|
||||||
|
lua["c"] = &items;
|
||||||
|
lookup_container_check(lua, items);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("containers/associative unordered containers", "check associative (map) containers that are ordered that they fulfill basic functionality requirements") {
|
TEST_CASE("containers/associative unordered containers", "check associative (map) containers that are ordered that they fulfill basic functionality requirements") {
|
||||||
@ -944,6 +1010,18 @@ TEST_CASE("containers/associative unordered containers", "check associative (map
|
|||||||
lua["c"] = &items;
|
lua["c"] = &items;
|
||||||
associative_unordered_container_check(lua, items);
|
associative_unordered_container_check(lua, items);
|
||||||
}
|
}
|
||||||
|
SECTION("unordered_map string") {
|
||||||
|
sol::state lua;
|
||||||
|
lua.open_libraries(sol::lib::base);
|
||||||
|
|
||||||
|
std::unordered_map<std::string, std::string> items{
|
||||||
|
{ "a", "a" },
|
||||||
|
{ "b", "b" },
|
||||||
|
{ "c", "c" }
|
||||||
|
};
|
||||||
|
lua["c"] = &items;
|
||||||
|
lookup_container_check(lua, items);
|
||||||
|
}
|
||||||
SECTION("unordered_multimap") {
|
SECTION("unordered_multimap") {
|
||||||
sol::state lua;
|
sol::state lua;
|
||||||
lua.open_libraries(sol::lib::base);
|
lua.open_libraries(sol::lib::base);
|
||||||
@ -958,6 +1036,18 @@ TEST_CASE("containers/associative unordered containers", "check associative (map
|
|||||||
lua["c"] = &items;
|
lua["c"] = &items;
|
||||||
associative_unordered_container_check(lua, items);
|
associative_unordered_container_check(lua, items);
|
||||||
}
|
}
|
||||||
|
SECTION("unordered_multimap string") {
|
||||||
|
sol::state lua;
|
||||||
|
lua.open_libraries(sol::lib::base);
|
||||||
|
|
||||||
|
std::unordered_multimap<std::string, std::string> items{
|
||||||
|
{ "a", "a" },
|
||||||
|
{ "b", "b" },
|
||||||
|
{ "c", "c" }
|
||||||
|
};
|
||||||
|
lua["c"] = &items;
|
||||||
|
lookup_container_check(lua, items);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("containers/associative ordered pairs", "check to make sure pairs works properly for key-value types") {
|
TEST_CASE("containers/associative ordered pairs", "check to make sure pairs works properly for key-value types") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user