Force constness on ostream operator.

Automatically disable magic for variant types.
This commit is contained in:
ThePhD 2019-12-01 17:40:16 -05:00
parent e26475e75b
commit b0c74207d8
No known key found for this signature in database
GPG Key ID: 1509DB1C0F702BFA
5 changed files with 1330 additions and 1324 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1308,7 +1308,13 @@ namespace sol {
template <typename T>
struct is_automagical
: std::integral_constant<bool,
std::is_array_v<meta::unqualified_t<T>> || !std::is_same_v<meta::unqualified_t<T>, state> || !std::is_same_v<meta::unqualified_t<T>, state_view>> {
#if defined(SOL_CXX17_FEATURES) && SOL_CXX17_FEATURES
#if defined(SOL_STD_VARIANT) && SOL_STD_VARIANT != 0
!meta::is_specialization_of_v<meta::unqualified_t<T>, std::variant> &&
#endif // std::variant borked in places
#endif // C++17 Features
std::is_array_v<
meta::unqualified_t<T>> || (!std::is_same_v<meta::unqualified_t<T>, state> && !std::is_same_v<meta::unqualified_t<T>, state_view>)> {
};
template <typename T>

View File

@ -172,11 +172,11 @@ namespace sol {
template <typename X>
void set_undefined_methods_on(stack_reference t) {
using T = std::remove_pointer_t<X>;
lua_State* L = t.lua_state();
t.push();
detail::lua_reg_table l{};
int index = 0;
detail::indexed_insert insert_fx(l, index);
@ -185,7 +185,7 @@ namespace sol {
l[index] = luaL_Reg{ to_string(meta_function::garbage_collect).c_str(), detail::make_destructor<T>() };
}
luaL_setfuncs(L, l, 0);
// __type table
lua_createtable(L, 0, 2);
const std::string& name = detail::demangle<T>();

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 2019-11-29 18:08:19.653548 UTC
// This header was generated with sol v3.0.3 (revision 21c0309)
// Generated 2019-12-01 22:39:33.269777 UTC
// This header was generated with sol v3.2.0 (revision e26475e)
// https://github.com/ThePhD/sol2
#ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP

File diff suppressed because it is too large Load Diff