mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
more minor fixes
This commit is contained in:
parent
f42a678d20
commit
a70a166132
|
@ -74,13 +74,7 @@ if (MSVC)
|
||||||
add_definitions(/DUNICODE /D_UNICODE /D_CRT_SECURE_NO_WARNINGS /D_CRT_SECURE_NO_DEPRECATE)
|
add_definitions(/DUNICODE /D_UNICODE /D_CRT_SECURE_NO_WARNINGS /D_CRT_SECURE_NO_DEPRECATE)
|
||||||
# Warning level, exceptions
|
# Warning level, exceptions
|
||||||
add_compile_options(/W4 /EHsc)
|
add_compile_options(/W4 /EHsc)
|
||||||
if (MSVC_VERSION GREATER_EQUAL "1900")
|
add_compile_options("/std:c++latest")
|
||||||
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("$<$<CONFIG:Debug>:/MDd>"
|
add_compile_options("$<$<CONFIG:Debug>:/MDd>"
|
||||||
"$<$<CONFIG:Release>:/MD>"
|
"$<$<CONFIG:Release>:/MD>"
|
||||||
"$<$<CONFIG:RelWithDebInfo>:/MD>"
|
"$<$<CONFIG:RelWithDebInfo>:/MD>"
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
namespace sol {
|
namespace sol {
|
||||||
|
|
||||||
template <typename T, typename base_type>
|
template <typename T, typename base_type>
|
||||||
struct basic_usertype : private basic_metatable<base_type> {
|
class basic_usertype : private basic_metatable<base_type> {
|
||||||
private:
|
private:
|
||||||
using base_t = basic_metatable<base_type>;
|
using base_t = basic_metatable<base_type>;
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ namespace u_detail {
|
||||||
|
|
||||||
template <typename K, typename F, typename T = void>
|
template <typename K, typename F, typename T = void>
|
||||||
struct binding : binding_base {
|
struct binding : binding_base {
|
||||||
F data_;
|
std::decay_t<F> data_;
|
||||||
|
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
binding(Args&&... args)
|
binding(Args&&... args)
|
||||||
|
@ -225,7 +225,7 @@ namespace u_detail {
|
||||||
// retrieve bases and walk through them.
|
// retrieve bases and walk through them.
|
||||||
bool keep_going = true;
|
bool keep_going = true;
|
||||||
int base_result;
|
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) {
|
if (sizeof...(Bases) > 0 && !keep_going) {
|
||||||
return base_result;
|
return base_result;
|
||||||
}
|
}
|
||||||
|
@ -261,7 +261,7 @@ namespace u_detail {
|
||||||
return (target->new_index)(L, target->binding_data);
|
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;
|
reference* target = nullptr;
|
||||||
{
|
{
|
||||||
stack_reference k = stack::get<stack_reference>(L, 2);
|
stack_reference k = stack::get<stack_reference>(L, 2);
|
||||||
|
@ -280,7 +280,7 @@ namespace u_detail {
|
||||||
// retrieve bases and walk through them.
|
// retrieve bases and walk through them.
|
||||||
bool keep_going = true;
|
bool keep_going = true;
|
||||||
int base_result;
|
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) {
|
if (sizeof...(Bases) > 0 && !keep_going) {
|
||||||
return base_result;
|
return base_result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user