From: Wolfgang Bangerth Date: Wed, 5 Feb 2025 03:59:55 +0000 (-0700) Subject: Mark our various constants as 'constexpr'. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F18090%2Fhead;p=dealii.git Mark our various constants as 'constexpr'. --- diff --git a/include/deal.II/base/types.h b/include/deal.II/base/types.h index 2b3e726d3f..6199923248 100644 --- a/include/deal.II/base/types.h +++ b/include/deal.II/base/types.h @@ -229,8 +229,7 @@ namespace numbers * @ref GlossInvalidValue "invalid value". * See there for more information. */ - static const unsigned int invalid_unsigned_int = - static_cast(-1); + constexpr unsigned int invalid_unsigned_int = static_cast(-1); /** * Representation of the largest number that can be put into a size_type. @@ -242,7 +241,7 @@ namespace numbers * @ref GlossInvalidValue "invalid value". * See there for more information. */ - const types::global_dof_index invalid_size_type = + constexpr types::global_dof_index invalid_size_type = static_cast(-1); /** @@ -252,7 +251,7 @@ namespace numbers * @ref GlossInvalidValue "invalid value". * See there for more information. */ - const types::fe_index invalid_fe_index = static_cast(-1); + constexpr types::fe_index invalid_fe_index = static_cast(-1); /** * An invalid value for indices of degrees of freedom. @@ -261,7 +260,7 @@ namespace numbers * @ref GlossInvalidValue "invalid value". * See there for more information. */ - const types::global_dof_index invalid_dof_index = + constexpr types::global_dof_index invalid_dof_index = static_cast(-1); /** @@ -274,7 +273,7 @@ namespace numbers * @ref GlossInvalidValue "invalid value". * See there for more information. */ - const types::coarse_cell_id invalid_coarse_cell_id = + constexpr types::coarse_cell_id invalid_coarse_cell_id = static_cast(-1); /** @@ -286,7 +285,7 @@ namespace numbers * @ref GlossInvalidValue "invalid value". * See there for more information. */ - const types::material_id invalid_material_id = + constexpr types::material_id invalid_material_id = static_cast(-1); /** @@ -301,7 +300,7 @@ namespace numbers * @see * @ref GlossBoundaryIndicator "Glossary entry on boundary indicators" */ - const types::boundary_id invalid_boundary_id = + constexpr types::boundary_id invalid_boundary_id = static_cast(-1); /** @@ -321,7 +320,7 @@ namespace numbers * @see * @ref GlossBoundaryIndicator "Glossary entry on boundary indicators" */ - const types::boundary_id internal_face_boundary_id = + constexpr types::boundary_id internal_face_boundary_id = static_cast(-1); /** @@ -334,7 +333,7 @@ namespace numbers * @see * @ref GlossManifoldIndicator "Glossary entry on manifold indicators" */ - const types::manifold_id flat_manifold_id = + constexpr types::manifold_id flat_manifold_id = static_cast(-1); /** @@ -344,7 +343,7 @@ namespace numbers * @ref GlossFaceOrientation "glossary" * for more information. */ - const types::geometric_orientation default_geometric_orientation = + constexpr types::geometric_orientation default_geometric_orientation = static_cast(0b001); /** @@ -357,7 +356,7 @@ namespace numbers * @ref GlossFaceOrientation "glossary" * for more information. */ - const types::geometric_orientation reverse_line_orientation = + constexpr types::geometric_orientation reverse_line_orientation = static_cast(0b000); /** @@ -373,7 +372,7 @@ namespace numbers * @ref GlossSubdomainId "glossary" * for more information. */ - const types::subdomain_id invalid_subdomain_id = + constexpr types::subdomain_id invalid_subdomain_id = static_cast(-1); /** @@ -394,7 +393,7 @@ namespace numbers * @ref GlossInvalidValue "invalid value". * See there for more information. */ - const types::subdomain_id artificial_subdomain_id = + constexpr types::subdomain_id artificial_subdomain_id = static_cast(-2); } // namespace numbers