STYLE: use std::is_arithmetic in contiguous and ListPolicy

This commit is contained in:
Mark Olesen
2019-05-01 11:25:34 +02:00
committed by Andrew Heather
parent 1d5e0a4e0e
commit c96a84e653
2 changed files with 4 additions and 17 deletions

View File

@ -71,15 +71,7 @@ struct short_length : std::integral_constant<label,10> {};
// Default definition: (integral | floating-point) are contiguous and thus // Default definition: (integral | floating-point) are contiguous and thus
// never need any line breaks // never need any line breaks
template<class T> template<class T>
struct no_linebreak struct no_linebreak : std::is_arithmetic<T> {};
:
std::integral_constant
<
bool,
std::is_integral<T>::value || std::is_floating_point<T>::value
>
{};
// Specialization for word, wordRe, keyType // Specialization for word, wordRe, keyType
// These elements are normally fairly short, so ok to output a few (eg, 10) // These elements are normally fairly short, so ok to output a few (eg, 10)

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | \\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation | Copyright (C) 2011-2016 OpenFOAM Foundation
@ -45,7 +45,7 @@ Description
namespace Foam namespace Foam
{ {
// Forward declarations // Forward Declarations
template<class T, unsigned N> class FixedList; template<class T, unsigned N> class FixedList;
template<class T> class Pair; template<class T> class Pair;
@ -55,12 +55,7 @@ template<class T> class Pair;
template<class T> template<class T>
inline bool contiguous() inline bool contiguous()
{ {
return return std::is_arithmetic<T>::value;
std::integral_constant
<
bool,
std::is_integral<T>::value || std::is_floating_point<T>::value
>::value;
} }
// //