Changeset 154:4095d3d44d3a in rrlib_rtti


Ignore:
Timestamp:
25.03.2021 09:41:30 (4 weeks ago)
Author:
Max Reichardt <max.reichardt@…>
Branch:
17.03
Phase:
public
Tags:
tip
Message:

Adapts assertions to last changeset (rrlib_rtti stores size zero for empty classes)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tTypedPointer.h

    r127 r154  
    167167  inline const T* GetUnchecked(bool check_exact_size = true) const 
    168168  { 
    169     assert(sizeof(T) == type.GetSize() || ((!check_exact_size) && sizeof(T) <= type.GetSize())); 
     169    assert(std::is_empty<T>::value || sizeof(T) == type.GetSize() || ((!check_exact_size) && sizeof(T) <= type.GetSize())); 
    170170    return static_cast<const T*>(data); 
    171171  } 
     
    422422  inline T* GetUnchecked(bool check_exact_size = true) const 
    423423  { 
    424     assert(sizeof(T) == type.GetSize() || ((!check_exact_size) && sizeof(T) <= type.GetSize())); 
     424    assert(std::is_empty<T>::value || sizeof(T) == type.GetSize() || ((!check_exact_size) && sizeof(T) <= type.GetSize())); 
    425425    return static_cast<T*>(data); 
    426426  } 
Note: See TracChangeset for help on using the changeset viewer.