From 8e387a269bda6218cb1a11ef29138b03f739facb Mon Sep 17 00:00:00 2001 From: ThePhD Date: Wed, 17 Aug 2016 15:55:36 -0400 Subject: [PATCH] [ci skip] update single --- single/sol/sol.hpp | 115 +++++++++++++++++++++++++++++++-------------- 1 file changed, 79 insertions(+), 36 deletions(-) diff --git a/single/sol/sol.hpp b/single/sol/sol.hpp index f97732ee..77472eed 100644 --- a/single/sol/sol.hpp +++ b/single/sol/sol.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 2016-08-17 18:29:29.153274 UTC -// This header was generated with sol v2.11.3 (revision 3669378) +// Generated 2016-08-17 19:55:17.106162 UTC +// This header was generated with sol v2.11.4 (revision d06f2e6) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_HPP @@ -738,6 +738,35 @@ namespace sol { #if defined(SOL_USE_BOOST) #include +// beginning of sol/in_place.hpp + +namespace sol { + + namespace detail { + struct in_place_of {}; + template + struct in_place_of_i {}; + template + struct in_place_of_t {}; + } // detail + + struct in_place_tag { struct init {}; constexpr in_place_tag(init) {} in_place_tag() = delete; }; + constexpr inline in_place_tag in_place(detail::in_place_of) { return in_place_tag(in_place_tag::init()); } + template + constexpr inline in_place_tag in_place(detail::in_place_of_t) { return in_place_tag(in_place_tag::init()); } + template + constexpr inline in_place_tag in_place(detail::in_place_of_i) { return in_place_tag(in_place_tag::init()); } + + using in_place_t = in_place_tag(&)(detail::in_place_of); + template + using in_place_type_t = in_place_tag(&)(detail::in_place_of_t); + template + using in_place_index_t = in_place_tag(&)(detail::in_place_of_i); + +} // sol + +// end of sol/in_place.hpp + #else // beginning of Optional/optional.hpp @@ -950,15 +979,7 @@ constexpr U convert(U v) { return v; } } // namespace detail_ -namespace detail { - struct in_place_of {}; -} // namespace detail - -constexpr struct trivial_init_t{} trivial_init{}; - -struct in_place_tag { struct init {}; constexpr in_place_tag(init) {} in_place_tag() = delete; }; -constexpr inline in_place_tag in_place(detail::in_place_of) { return in_place_tag(in_place_tag::init()); } -using in_place_t = in_place_tag(&)(detail::in_place_of); +constexpr struct trivial_init_t {} trivial_init{}; struct nullopt_t { @@ -1744,33 +1765,8 @@ namespace sol { using optional = boost::optional; using nullopt_t = boost::none_t; const nullopt_t nullopt = boost::none; - - namespace detail { - struct in_place_of {}; - } // detail - - struct in_place_tag { struct init {}; constexpr in_place_tag(init) {} in_place_tag() = delete; }; - constexpr inline in_place_tag in_place(detail::in_place_of) { return in_place_tag(in_place_tag::init()); } - using in_place_t = in_place_tag(&)(detail::in_place_of); #endif // Boost vs. Better optional - namespace detail { - template - struct in_place_of_i {}; - template - struct in_place_of_t {}; - } - - template - constexpr inline in_place_tag in_place(detail::in_place_of_t) { return in_place_tag(in_place_tag::init()); } - template - constexpr inline in_place_tag in_place(detail::in_place_of_i) { return in_place_tag(in_place_tag::init()); } - - template - using in_place_type_t = in_place_tag(&)(detail::in_place_of_t); - template - using in_place_index_t = in_place_tag(&)(detail::in_place_of_i); - } // sol // end of sol/optional.hpp @@ -4840,6 +4836,53 @@ namespace sol { } }; + template + struct getter, meta::neg>, meta::neg, std::is_base_of>>>::value>> { + static T get(lua_State* L, int index, record& tracking) { + typedef typename T::value_type V; + tracking.use(1); + + T arr; + index = lua_absindex(L, index); + lua_pushnil(L); + while (lua_next(L, index) != 0) { + int isint = 0; + lua_Integer li = lua_tointegerx(L, -2, &isint); + if (isint == 0) { + lua_pop(L, 1); + continue; + } + arr.push_back(stack::get(L, -1)); + lua_pop(L, 1); + } + return arr; + } + }; + + template + struct getter, meta::has_key_value_pair, meta::neg, std::is_base_of>>>::value>> { + static T get(lua_State* L, int index, record& tracking) { + typedef typename T::value_type P; + typedef typename P::first_type K; + typedef typename P::second_type V; + tracking.use(1); + + T associative; + index = lua_absindex(L, index); + lua_pushnil(L); + while (lua_next(L, index) != 0) { + decltype(auto) key = stack::check_get(L, -2); + if (!key) { + lua_pop(L, 1); + continue; + } + associative.emplace(std::forward(*key), stack::get(L, -1)); + lua_pop(L, 1); + } + return associative; + } + }; + template struct getter::value || std::is_base_of::value>> { static T get(lua_State* L, int index, record& tracking) {