From: Daniel Arndt Date: Thu, 6 Jul 2023 21:43:52 +0000 (-0400) Subject: Deprecate implicit conversions from std::vector to ComponentMask and BlockMask X-Git-Tag: relicensing~726^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55aa08fe498ad99a7551f14c8b2ed9f7651a8dc8;p=dealii.git Deprecate implicit conversions from std::vector to ComponentMask and BlockMask --- diff --git a/include/deal.II/fe/block_mask.h b/include/deal.II/fe/block_mask.h index ca6fa0e898..b1d9c3ac34 100644 --- a/include/deal.II/fe/block_mask.h +++ b/include/deal.II/fe/block_mask.h @@ -80,6 +80,14 @@ public: */ BlockMask() = default; + /** + * Deprecated constructor allowing implicit conversion. + */ + template + DEAL_II_DEPRECATED_EARLY_WITH_COMMENT( + "Implicit conversions from std::vector to BlockMask are deprecated!") + BlockMask(const std::vector &block_mask); + /** * Initialize an object of this type with a set of selected blocks specified * by the argument. @@ -238,6 +246,12 @@ operator<<(std::ostream &out, const BlockMask &mask); #ifndef DOXYGEN // -------------------- inline functions --------------------- +template +inline BlockMask::BlockMask(const std::vector &block_mask) + : block_mask(block_mask) +{} + + inline BlockMask::BlockMask(const std::vector &block_mask) : block_mask(block_mask) {} diff --git a/include/deal.II/fe/component_mask.h b/include/deal.II/fe/component_mask.h index 37209e7225..5ffb5d00be 100644 --- a/include/deal.II/fe/component_mask.h +++ b/include/deal.II/fe/component_mask.h @@ -89,6 +89,14 @@ public: */ ComponentMask() = default; + /** + * Deprecated constructor allowing implicit conversion. + */ + template + DEAL_II_DEPRECATED_EARLY_WITH_COMMENT( + "Implicit conversions from std::vector to ComponentMask are deprecated!") + ComponentMask(const std::vector &block_mask); + /** * Initialize an object of this type with a set of selected components * specified by the argument. @@ -259,6 +267,12 @@ operator<<(std::ostream &out, const ComponentMask &mask); #ifndef DOXYGEN // -------------------- inline functions --------------------- +template +inline ComponentMask::ComponentMask(const std::vector &component_mask) + : component_mask(component_mask) +{} + + inline ComponentMask::ComponentMask(const std::vector &component_mask) : component_mask(component_mask) {}