From 3a1a35348399f8cf2f618a3dbee114f6cd10c8c7 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 24 Apr 2019 18:26:57 +0200 Subject: [PATCH] STYLE: remove UList operator[] taking std::initializer_list - unnecessary. Can deduce labelRange from the pair of labels. These are all the same: list[labelRange(18,3)] = 100; list[labelRange{18,3}] = 100; list[{18,3}] = 100; Removing the run-time handling of std::initializer_list in favour of compile-time deduction allows the future use of sliceRange as well. Eg, list[sliceRange{18,3,2}] = 100; list[{18,3,2}] = 100; --- src/OpenFOAM/containers/Lists/UList/UList.C | 50 +-------------------- src/OpenFOAM/containers/Lists/UList/UList.H | 19 -------- 2 files changed, 1 insertion(+), 68 deletions(-) diff --git a/src/OpenFOAM/containers/Lists/UList/UList.C b/src/OpenFOAM/containers/Lists/UList/UList.C index 413cec76e0..ece482a039 100644 --- a/src/OpenFOAM/containers/Lists/UList/UList.C +++ b/src/OpenFOAM/containers/Lists/UList/UList.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -48,29 +48,6 @@ Foam::labelRange Foam::UList::validateRange(const labelRange& range) const } -template -Foam::labelRange Foam::UList::validateRange -( - std::initializer_list