diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e3541c3..766606f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,13 +74,7 @@ if (MSVC) add_definitions(/DUNICODE /D_UNICODE /D_CRT_SECURE_NO_WARNINGS /D_CRT_SECURE_NO_DEPRECATE) # Warning level, exceptions add_compile_options(/W4 /EHsc) - if (MSVC_VERSION GREATER_EQUAL "1900") - include(CheckCXXCompilerFlag) - CHECK_CXX_COMPILER_FLAG("/std:c++latest" _cpp_latest_flag_supported) - if (_cpp_latest_flag_supported) - add_compile_options("/std:c++latest") - endif() - endif() + add_compile_options("/std:c++latest") add_compile_options("$<$:/MDd>" "$<$:/MD>" "$<$:/MD>" diff --git a/include/sol/usertype.hpp b/include/sol/usertype.hpp index d45b8c83..95164fcd 100644 --- a/include/sol/usertype.hpp +++ b/include/sol/usertype.hpp @@ -32,7 +32,7 @@ namespace sol { template - struct basic_usertype : private basic_metatable { + class basic_usertype : private basic_metatable { private: using base_t = basic_metatable; diff --git a/include/sol/usertype_storage.hpp b/include/sol/usertype_storage.hpp index bbffc35c..9421d65a 100644 --- a/include/sol/usertype_storage.hpp +++ b/include/sol/usertype_storage.hpp @@ -49,7 +49,7 @@ namespace u_detail { template struct binding : binding_base { - F data_; + std::decay_t data_; template binding(Args&&... args) @@ -225,7 +225,7 @@ namespace u_detail { // retrieve bases and walk through them. bool keep_going = true; int base_result; - detail::swallow { 1, (1, base_walk_index(L, self, keep_going, base_result))... }; + detail::swallow{ 1, (base_walk_index(L, self, keep_going, base_result), 1)... }; if (sizeof...(Bases) > 0 && !keep_going) { return base_result; } @@ -261,7 +261,7 @@ namespace u_detail { return (target->new_index)(L, target->binding_data); } } - else if (k_type != type::nil) { + else if (k_type != type::nil && k_type != type::none) { reference* target = nullptr; { stack_reference k = stack::get(L, 2); @@ -280,7 +280,7 @@ namespace u_detail { // retrieve bases and walk through them. bool keep_going = true; int base_result; - detail::swallow { 1, (1, base_walk_new_index(L, self, keep_going, base_result))... }; + detail::swallow{ 1, (base_walk_new_index(L, self, keep_going, base_result), 1)... }; if (sizeof...(Bases) > 0 && !keep_going) { return base_result; }