Skip to content

confinedArbitraryLayers use CxxUtils::span for const-correct interfaces.

confinedArbitraryLayers use CxxUtils::span for const-correct interfaces.

Allows to have both const/non const methods for a std::vector<T*> field.

We hold

  const std::vector<Layer*>* m_confinedArbitraryLayers;

and we have 2 methods/overloads one for a const volume where one should not be able to modify the Layers (so Layer const), and for a non-const one where the layer can be modified (Layer. The ptr is in both cases const (* const .


  /** Return the confined subLayer array */
  ArraySpan<Layer const * const> confinedArbitraryLayers() const;

  /** Return the confined subLayer array. Layers are not const */
  ArraySpan<Layer* const> confinedArbitraryLayers();

Also remove more un-needed const , leading to const_cast.

We need to do the same for the other std::vector<T*> fields but one by one, step by step.

Edited by Christos Anastopoulos

Merge request reports

Loading