From 27e47a04a9dd3a8776a3b2d6e387cc3258ae25c4 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 20 Jan 2021 18:58:58 -0700 Subject: [PATCH] Mark a number of ReferenceCell functions as 'constexpr'. --- include/deal.II/grid/reference_cell.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/include/deal.II/grid/reference_cell.h b/include/deal.II/grid/reference_cell.h index 46f33a7ff4..79b614d8f0 100644 --- a/include/deal.II/grid/reference_cell.h +++ b/include/deal.II/grid/reference_cell.h @@ -64,12 +64,12 @@ namespace ReferenceCell /** * Default constructor. Initialize this object as an invalid object. */ - Type(); + constexpr Type(); /** * Constructor. */ - Type(const std::uint8_t kind); + constexpr Type(const std::uint8_t kind); /** * Return the dimension of the reference cell represented by the current @@ -134,18 +134,18 @@ namespace ReferenceCell /** * Conversion operator to an integer. */ - operator std::uint8_t() const; + constexpr operator std::uint8_t() const; /** * Operator for equality comparison. */ - bool + constexpr bool operator==(const Type &type) const; /** * Operator for inequality comparison. */ - bool + constexpr bool operator!=(const Type &type) const; /** @@ -172,26 +172,26 @@ namespace ReferenceCell - inline Type::Type() - : Type(Invalid) + inline constexpr Type::Type() + : Type(static_cast(-1)) {} - inline Type::Type(const std::uint8_t kind) + inline constexpr Type::Type(const std::uint8_t kind) : kind(kind) {} - inline Type::operator std::uint8_t() const + inline constexpr Type::operator std::uint8_t() const { return kind; } - inline bool + inline constexpr bool Type::operator==(const Type &type) const { return kind == type.kind; @@ -199,7 +199,7 @@ namespace ReferenceCell - inline bool + inline constexpr bool Type::operator!=(const Type &type) const { return kind != type.kind; -- 2.39.5