From dffc65d41d7fbe4c02c7ac58382a236d3c475cc3 Mon Sep 17 00:00:00 2001 From: Mark Olesen <Mark.Olesen@esi-group.com> Date: Wed, 25 Apr 2018 10:42:25 +0200 Subject: [PATCH] STYLE: make token null constructor constexpr, noexcept --- src/OpenFOAM/db/IOstreams/token/token.H | 6 +++--- src/OpenFOAM/db/IOstreams/token/tokenI.H | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/OpenFOAM/db/IOstreams/token/token.H b/src/OpenFOAM/db/IOstreams/token/token.H index 7110d918b25..1cf8143719f 100644 --- a/src/OpenFOAM/db/IOstreams/token/token.H +++ b/src/OpenFOAM/db/IOstreams/token/token.H @@ -55,7 +55,7 @@ SourceFiles namespace Foam { -// Forward declaration of friend functions and operators +// Forward declarations class token; @@ -76,7 +76,7 @@ public: // the maximum number of types is limited to 30. enum tokenType { - UNDEFINED, //!< An undefined token-type + UNDEFINED = 0, //!< An undefined token-type // Fundamental types FLAG, //!< stream flag (1-byte bitmask) @@ -303,7 +303,7 @@ public: // Constructors //- Construct null - inline token(); + inline constexpr token() noexcept; //- Copy construct inline token(const token& t); diff --git a/src/OpenFOAM/db/IOstreams/token/tokenI.H b/src/OpenFOAM/db/IOstreams/token/tokenI.H index f6868ec1523..da3f0abcdf7 100644 --- a/src/OpenFOAM/db/IOstreams/token/tokenI.H +++ b/src/OpenFOAM/db/IOstreams/token/tokenI.H @@ -118,7 +118,7 @@ inline void Foam::token::clear() // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -inline Foam::token::token() +inline constexpr Foam::token::token() noexcept : data_(), // bit-wise zero for union content type_(tokenType::UNDEFINED), -- GitLab