Skip to content
  • Mark OLESEN's avatar
    7f062a8f
    ENH: return plain List instead of shrinking the DynamicList · 7f062a8f
    Mark OLESEN authored
      Using 'return List<T>(std::move(dynList))' for transfer of content
      (with implicit shrinking) into a plain List, and leave copy elision
      to do the rest. The implicit transfer (move construct List from
      DynamicList) will normally invoke resize (new/delete and moving
      elements).
    
      With 'return dynList.shrink()', it will first invoke an internal
      resize (new/delete and moving elements), followed by a copy
      construct as a plain list.
    
    STYLE: avoid implicit cast to 'const List&' in constructors
    7f062a8f
    ENH: return plain List instead of shrinking the DynamicList
    Mark OLESEN authored
      Using 'return List<T>(std::move(dynList))' for transfer of content
      (with implicit shrinking) into a plain List, and leave copy elision
      to do the rest. The implicit transfer (move construct List from
      DynamicList) will normally invoke resize (new/delete and moving
      elements).
    
      With 'return dynList.shrink()', it will first invoke an internal
      resize (new/delete and moving elements), followed by a copy
      construct as a plain list.
    
    STYLE: avoid implicit cast to 'const List&' in constructors
Loading