From 93b106cdfd3df892351fc3d4a76cd0e7db08313f Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Wed, 30 Mar 2022 11:45:32 +0100 Subject: [PATCH] PackedList: Make iteratorBase copy constructor public This allows an iterator to be stored and used in the same way as a non-const reference to an element of a non-packed list --- src/OpenFOAM/containers/Lists/PackedList/PackedList.H | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/OpenFOAM/containers/Lists/PackedList/PackedList.H b/src/OpenFOAM/containers/Lists/PackedList/PackedList.H index cdb4bc911b..94a067bae4 100644 --- a/src/OpenFOAM/containers/Lists/PackedList/PackedList.H +++ b/src/OpenFOAM/containers/Lists/PackedList/PackedList.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -441,7 +441,7 @@ public: inline bool set(unsigned int); - // Constructors + // Protected Constructors //- Construct null inline iteratorBase(); @@ -449,12 +449,15 @@ public: //- Construct from base list and position index inline iteratorBase(const PackedList*, const label); + + public: + + // Constructors + //- Default copy constructor iteratorBase(const iteratorBase&) = default; - public: - // Member Functions //- Return the element index corresponding to the iterator