From 287025d2dfda37c999964c33daaa542222757ffb Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 2 May 2023 10:46:59 +0200 Subject: [PATCH] COMP: remove explicit specialisations for CSV reading (fixes #2764) - can use traits to distinguish label vs scalar types and setComponents to properly index into single or multi-component types without needing template specialisations for the task. This avoids the need for a concrete translation unit and the reported problem of multiply-defined specialisations when the header is included in different places. --- .../tableReaders/csv/csvTableReader.C | 49 +++++++------------ .../tableReaders/csv/csvTableReader.H | 16 ++---- .../primitives/functions/Function1/CSV/CSV.C | 45 +++++++---------- .../primitives/functions/Function1/CSV/CSV.H | 23 ++++----- 4 files changed, 47 insertions(+), 86 deletions(-) diff --git a/src/OpenFOAM/interpolations/interpolationTable/tableReaders/csv/csvTableReader.C b/src/OpenFOAM/interpolations/interpolationTable/tableReaders/csv/csvTableReader.C index 132b3677ca..8ad62055ab 100644 --- a/src/OpenFOAM/interpolations/interpolationTable/tableReaders/csv/csvTableReader.C +++ b/src/OpenFOAM/interpolations/interpolationTable/tableReaders/csv/csvTableReader.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2017 OpenFOAM Foundation - Copyright (C) 2020-2022 OpenCFD Ltd. + Copyright (C) 2020-2023 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -66,41 +66,26 @@ Foam::labelList Foam::csvTableReader::getComponentColumns // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -namespace Foam -{ - template<> - label csvTableReader