@@ -478,7 +478,7 @@ namespace sol {
478
478
using object_type = typename wrap::object_type;
479
479
if constexpr (sizeof ...(Args) < 1 ) {
480
480
using Ta = meta::conditional_t <std::is_void_v<T>, object_type, T>;
481
- static_assert (std::is_base_of_v<object_type, Ta>,
481
+ static_assert (std::is_same_v<object_type, Ta> || std:: is_base_of_v<object_type, Ta>,
482
482
" It seems like you might have accidentally bound a class type with a member function method that does not correspond to the "
483
483
" class. For example, there could be a small type in your new_usertype<T>(...) binding, where you specify one class \" T\" "
484
484
" but then bind member methods from a complete unrelated class. Check things over!" );
@@ -511,7 +511,7 @@ namespace sol {
511
511
if constexpr (is_index) {
512
512
if constexpr (sizeof ...(Args) < 1 ) {
513
513
using Ta = meta::conditional_t <std::is_void_v<T>, object_type, T>;
514
- static_assert (std::is_base_of_v<object_type, Ta>,
514
+ static_assert (std::is_same_v<object_type, Ta> || std:: is_base_of_v<object_type, Ta>,
515
515
" It seems like you might have accidentally bound a class type with a member function method that does not correspond "
516
516
" to the class. For example, there could be a small type in your new_usertype<T>(...) binding, where you specify one "
517
517
" class \" T\" but then bind member methods from a complete unrelated class. Check things over!" );
0 commit comments