From c96a84e653d89580d2a884228830d730ba0451a5 Mon Sep 17 00:00:00 2001 From: Mark Olesen <Mark.Olesen@esi-group.com> Date: Wed, 1 May 2019 11:25:34 +0200 Subject: [PATCH] STYLE: use std::is_arithmetic in contiguous and ListPolicy --- src/OpenFOAM/containers/Lists/policy/ListPolicy.H | 10 +--------- src/OpenFOAM/primitives/contiguous/contiguous.H | 11 +++-------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/src/OpenFOAM/containers/Lists/policy/ListPolicy.H b/src/OpenFOAM/containers/Lists/policy/ListPolicy.H index 7697c61b22c..d0cd7f66668 100644 --- a/src/OpenFOAM/containers/Lists/policy/ListPolicy.H +++ b/src/OpenFOAM/containers/Lists/policy/ListPolicy.H @@ -71,15 +71,7 @@ struct short_length : std::integral_constant<label,10> {}; // Default definition: (integral | floating-point) are contiguous and thus // never need any line breaks template<class T> -struct no_linebreak -: - std::integral_constant - < - bool, - std::is_integral<T>::value || std::is_floating_point<T>::value - > -{}; - +struct no_linebreak : std::is_arithmetic<T> {}; // Specialization for word, wordRe, keyType // These elements are normally fairly short, so ok to output a few (eg, 10) diff --git a/src/OpenFOAM/primitives/contiguous/contiguous.H b/src/OpenFOAM/primitives/contiguous/contiguous.H index ce10678d7f6..b8c1c55da0b 100644 --- a/src/OpenFOAM/primitives/contiguous/contiguous.H +++ b/src/OpenFOAM/primitives/contiguous/contiguous.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -45,7 +45,7 @@ Description namespace Foam { -// Forward declarations +// Forward Declarations template<class T, unsigned N> class FixedList; template<class T> class Pair; @@ -55,12 +55,7 @@ template<class T> class Pair; template<class T> inline bool contiguous() { - return - std::integral_constant - < - bool, - std::is_integral<T>::value || std::is_floating_point<T>::value - >::value; + return std::is_arithmetic<T>::value; } // -- GitLab