Changeset 10:9f6b30f1d527 in rrlib_rtti_conversion


Ignore:
Timestamp:
28.01.2019 15:35:42 (4 months ago)
Author:
Max Reichardt <max.reichardt@…>
Branch:
17.03
Phase:
public
Message:

Adapts built-in element access operation '[]' to changes in rrlib_rtti

File:
1 edited

Legend:

Unmodified
Added
Removed
  • defined_conversions.cpp

    r9 r10  
    355355      index = parameter->GetData<unsigned int>(); 
    356356    } 
    357     if (source_type.IsArray() && source_type.GetElementType() == destination_type && index < source_type.GetArraySize()) 
    358     { 
    359       return tConversionOption(source_type, destination_type, index * source_type.GetElementType().GetSize()); 
     357    { 
     358      rtti::tType current_type = source_type; 
     359      while ((current_type.GetTypeTraits() & rtti::trait_flags::cINHERITS_UNDERLYING_TYPE_ELEMENT_ACCESS_OPERATIONS) && (!current_type.IsArray()) && current_type.GetUnderlyingType() != current_type) 
     360      { 
     361        current_type = current_type.GetUnderlyingType(); 
     362      } 
     363      if (current_type.IsArray() && current_type.GetElementType() == destination_type && index < current_type.GetArraySize()) 
     364      { 
     365        return tConversionOption(source_type, destination_type, index * current_type.GetElementType().GetSize()); 
     366      } 
    360367    } 
    361368    return tConversionOption(); 
Note: See TracChangeset for help on using the changeset viewer.