File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff 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 };
Original file line number Diff line number Diff 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 };
You can’t perform that action at this time.
0 commit comments