Skip to content
  • Henry Weller's avatar
    UList: Rationalize assignment (shallow-copy vs deep-copy) · 6e573ad7
    Henry Weller authored
        //- Disallow default shallow-copy assignment
        //
        //  Assignment of UList<T> may need to be either shallow (copy pointer)
        //  or deep (copy elements) depending on context or the particular type
        //  of list derived from UList and it is confusing and prone to error
        //  for the default assignment to be either.  The solution is to
        //  disallow default assignment and provide separate 'shallowCopy' and
        //  'deepCopy' member functions.
        void operator=(const UList<T>&) = delete;
    
        //- Copy the pointer held by the given UList.
        inline void shallowCopy(const UList<T>&);
    
        //- Copy elements of the given UList.
        void deepCopy(const UList<T>&);
    6e573ad7