Skip to content

Commit 45b3c6d

Browse files
authored
Merge pull request #122 from BlackMATov/dev
Dev
2 parents c64676b + f4e07a4 commit 45b3c6d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

develop/singles/headers/meta.hpp/meta_all.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9765,7 +9765,7 @@ namespace meta_hpp::detail::class_type_data_impl
97659765
template < class_kind Class, class_kind Target >
97669766
void add_upcast_info(new_base_info_t& info) {
97679767
const class_type_data::upcast_func_t::upcast_t class_to_target = []() {
9768-
if constexpr ( requires { static_cast<Target*>(std::declval<Class*>()); } ) {
9768+
if constexpr ( std::is_base_of_v<Target, Class> && std::is_convertible_v<Class*, Target*> ) {
97699769
return +[](void* from) -> void* { //
97709770
return static_cast<Target*>(static_cast<Class*>(from));
97719771
};

headers/meta.hpp/meta_types/class_type.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace meta_hpp::detail::class_type_data_impl
3030
template < class_kind Class, class_kind Target >
3131
void add_upcast_info(new_base_info_t& info) {
3232
const class_type_data::upcast_func_t::upcast_t class_to_target = []() {
33-
if constexpr ( requires { static_cast<Target*>(std::declval<Class*>()); } ) {
33+
if constexpr ( std::is_base_of_v<Target, Class> && std::is_convertible_v<Class*, Target*> ) {
3434
return +[](void* from) -> void* { //
3535
return static_cast<Target*>(static_cast<Class*>(from));
3636
};

0 commit comments

Comments
 (0)