Changeset 20:c8365294522d in rrlib_rtti_conversion
- Timestamp:
- 03.02.2020 06:44:53 (3 years ago)
- Branch:
- 17.03
- Children:
- 21:9e5fed94ff31, 22:fed7ec8deba0
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tStaticCastOperation.cpp
r18 r20 158 158 } 159 159 tCommonUnderlyingTypeResult result = GetCommonUnderlyingType(source_type, destination_type); 160 if (result.common_underlying_type == destination_type || (result.c ommon_underlying_type == source_type && result.cast_from_common_to_destination_type_valid))160 if (result.common_underlying_type == destination_type || (result.cast_from_common_to_destination_type_valid && (result.common_underlying_type == source_type || result.cast_from_common_to_destination_type_implicit || result.cast_from_source_to_common_type_implicit))) 161 161 { 162 162 return tConversionOption(source_type, destination_type, 0); … … 168 168 { 169 169 return option->conversion_option; 170 } 171 172 if (option->implicit) 173 { 174 // Combining (non-implicit) underlying type casts with implicit casts can be done in a single operation 175 tType underlying_type_source = source_type; 176 while (underlying_type_source.GetUnderlyingType() != underlying_type_source) 177 { 178 underlying_type_source = underlying_type_source.GetUnderlyingType(); 179 if (underlying_type_source == option->conversion_option.source_type && destination_type == option->conversion_option.destination_type) 180 { 181 return option->conversion_option; 182 } 183 } 170 184 } 171 185 }
Note: See TracChangeset
for help on using the changeset viewer.