From e108f8bbbff810cc1a68fbc42466ee9b2712afce Mon Sep 17 00:00:00 2001 From: ThePhD Date: Sat, 24 Oct 2020 04:53:21 -0400 Subject: [PATCH] Work around non-constexpr boost shenanigans....... --- include/sol/optional.hpp | 7 ++++++- include/sol/stack_push.hpp | 4 ++-- single/include/sol/config.hpp | 4 ++-- single/include/sol/forward.hpp | 4 ++-- single/include/sol/sol.hpp | 15 ++++++++++----- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/include/sol/optional.hpp b/include/sol/optional.hpp index 19584702..5af58b5c 100644 --- a/include/sol/optional.hpp +++ b/include/sol/optional.hpp @@ -61,12 +61,17 @@ namespace sol { #if SOL_IS_ON(SOL_USE_BOOST_I_) template struct associated_nullopt> { - inline static constexpr boost::none_t value = boost::none; + inline static const boost::none_t value = boost::none; }; #endif // Boost nullopt +#if SOL_IS_ON(SOL_USE_BOOST_I_) + template + inline const auto associated_nullopt_v = associated_nullopt::value; +#else template inline constexpr auto associated_nullopt_v = associated_nullopt::value; +#endif // Boost continues to lag behind, to not many people's surprise... } // namespace detail } // namespace sol diff --git a/include/sol/stack_push.hpp b/include/sol/stack_push.hpp index d5f49041..d2fbf3b9 100644 --- a/include/sol/stack_push.hpp +++ b/include/sol/stack_push.hpp @@ -295,7 +295,7 @@ namespace sol { namespace stack { } else if constexpr (std::is_same_v) { luaL_Stream* source { std::forward(args)... }; - luaL_Stream* stream = static_cast(alloc_newuserdata(L, sizeof(luaL_Stream))); + luaL_Stream* stream = static_cast(detail::alloc_newuserdata(L, sizeof(luaL_Stream))); stream->f = source->f; #if SOL_IS_ON(SOL_LUAL_STREAM_USE_CLOSE_FUNCTION_I_) stream->closef = source->closef; @@ -304,7 +304,7 @@ namespace sol { namespace stack { } else if constexpr (std::is_same_v) { luaL_Stream& source(std::forward(args)...); - luaL_Stream* stream = static_cast(alloc_newuserdata(L, sizeof(luaL_Stream))); + luaL_Stream* stream = static_cast(detail::alloc_newuserdata(L, sizeof(luaL_Stream))); stream->f = source.f; #if SOL_IS_ON(SOL_LUAL_STREAM_USE_CLOSE_FUNCTION_I_) stream->closef = source.closef; diff --git a/single/include/sol/config.hpp b/single/include/sol/config.hpp index 11ba0a6a..cc41ad57 100644 --- a/single/include/sol/config.hpp +++ b/single/include/sol/config.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-10-23 22:58:31.412033 UTC -// This header was generated with sol v3.2.3 (revision c068aefb) +// Generated 2020-10-24 08:52:46.516426 UTC +// This header was generated with sol v3.2.3 (revision 651b90ba) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_CONFIG_HPP diff --git a/single/include/sol/forward.hpp b/single/include/sol/forward.hpp index 9ab81003..91a395f7 100644 --- a/single/include/sol/forward.hpp +++ b/single/include/sol/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-10-23 22:58:31.388033 UTC -// This header was generated with sol v3.2.3 (revision c068aefb) +// Generated 2020-10-24 08:52:46.504426 UTC +// This header was generated with sol v3.2.3 (revision 651b90ba) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP diff --git a/single/include/sol/sol.hpp b/single/include/sol/sol.hpp index d7d0a5b8..f4f869fb 100644 --- a/single/include/sol/sol.hpp +++ b/single/include/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 2020-10-23 22:58:30.755052 UTC -// This header was generated with sol v3.2.3 (revision c068aefb) +// Generated 2020-10-24 08:52:45.802426 UTC +// This header was generated with sol v3.2.3 (revision 651b90ba) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_HPP @@ -6262,12 +6262,17 @@ namespace sol { #if SOL_IS_ON(SOL_USE_BOOST_I_) template struct associated_nullopt> { - inline static constexpr boost::none_t value = boost::none; + inline static const boost::none_t value = boost::none; }; #endif // Boost nullopt +#if SOL_IS_ON(SOL_USE_BOOST_I_) + template + inline const auto associated_nullopt_v = associated_nullopt::value; +#else template inline constexpr auto associated_nullopt_v = associated_nullopt::value; +#endif // Boost continues to lag behind, to not many people's surprise... } // namespace detail } // namespace sol @@ -13745,7 +13750,7 @@ namespace sol { namespace stack { } else if constexpr (std::is_same_v) { luaL_Stream* source { std::forward(args)... }; - luaL_Stream* stream = static_cast(alloc_newuserdata(L, sizeof(luaL_Stream))); + luaL_Stream* stream = static_cast(detail::alloc_newuserdata(L, sizeof(luaL_Stream))); stream->f = source->f; #if SOL_IS_ON(SOL_LUAL_STREAM_USE_CLOSE_FUNCTION_I_) stream->closef = source->closef; @@ -13754,7 +13759,7 @@ namespace sol { namespace stack { } else if constexpr (std::is_same_v) { luaL_Stream& source(std::forward(args)...); - luaL_Stream* stream = static_cast(alloc_newuserdata(L, sizeof(luaL_Stream))); + luaL_Stream* stream = static_cast(detail::alloc_newuserdata(L, sizeof(luaL_Stream))); stream->f = source.f; #if SOL_IS_ON(SOL_LUAL_STREAM_USE_CLOSE_FUNCTION_I_) stream->closef = source.closef;