more minor fixes

This commit is contained in:
ThePhD 2018-09-28 03:53:17 -07:00
parent f42a678d20
commit a70a166132
No known key found for this signature in database
GPG Key ID: 1509DB1C0F702BFA
3 changed files with 6 additions and 12 deletions

View File

@ -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("$<$<CONFIG:Debug>:/MDd>"
"$<$<CONFIG:Release>:/MD>"
"$<$<CONFIG:RelWithDebInfo>:/MD>"

View File

@ -32,7 +32,7 @@
namespace sol {
template <typename T, typename base_type>
struct basic_usertype : private basic_metatable<base_type> {
class basic_usertype : private basic_metatable<base_type> {
private:
using base_t = basic_metatable<base_type>;

View File

@ -49,7 +49,7 @@ namespace u_detail {
template <typename K, typename F, typename T = void>
struct binding : binding_base {
F data_;
std::decay_t<F> data_;
template <typename... Args>
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<Bases>(L, self, keep_going, base_result))... };
detail::swallow{ 1, (base_walk_index<Bases>(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<stack_reference>(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<Bases>(L, self, keep_going, base_result))... };
detail::swallow{ 1, (base_walk_new_index<Bases>(L, self, keep_going, base_result), 1)... };
if (sizeof...(Bases) > 0 && !keep_going) {
return base_result;
}