From 9de6683244c8b14f09ea248f02584a9ec14e7633 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 21 Jun 2023 12:44:55 +0100 Subject: [PATCH] pTraits::read: Moved the read(Istream&) from read.H to pTraits.H so that primitives can be read from Istream without the need to include IStringStream.H --- src/OpenFOAM/primitives/pTraits/pTraits.H | 9 ++++++++- src/OpenFOAM/primitives/pTraits/read.H | 7 +------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/OpenFOAM/primitives/pTraits/pTraits.H b/src/OpenFOAM/primitives/pTraits/pTraits.H index 2918aed519..b8064c041b 100644 --- a/src/OpenFOAM/primitives/pTraits/pTraits.H +++ b/src/OpenFOAM/primitives/pTraits/pTraits.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -71,6 +71,13 @@ public: }; +template +inline Type read(Istream& is) +{ + return pTraits(is); +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/OpenFOAM/primitives/pTraits/read.H b/src/OpenFOAM/primitives/pTraits/read.H index b30bc814e7..e944bd2bbd 100644 --- a/src/OpenFOAM/primitives/pTraits/read.H +++ b/src/OpenFOAM/primitives/pTraits/read.H @@ -32,6 +32,7 @@ Description #ifndef read_H #define read_H +#include "pTraits.H" #include "IStringStream.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -41,12 +42,6 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -template -inline Type read(Istream& is) -{ - return pTraits(is); -} - template inline Type read(const string& str) {