]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Deprecate implicit conversions from std::vector to ComponentMask and BlockMask
authorDaniel Arndt <arndtd@ornl.gov>
Thu, 6 Jul 2023 21:43:52 +0000 (17:43 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Fri, 7 Jul 2023 00:03:07 +0000 (20:03 -0400)
include/deal.II/fe/block_mask.h
include/deal.II/fe/component_mask.h

index ca6fa0e898ca66f6651f2bc264b149e771d68e11..b1d9c3ac34e168a74a7d755d890be2dbe84ea25d 100644 (file)
@@ -80,6 +80,14 @@ public:
    */
   BlockMask() = default;
 
+  /**
+   * Deprecated constructor allowing implicit conversion.
+   */
+  template <typename = void>
+  DEAL_II_DEPRECATED_EARLY_WITH_COMMENT(
+    "Implicit conversions from std::vector<bool> to BlockMask are deprecated!")
+  BlockMask(const std::vector<bool> &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 <typename>
+inline BlockMask::BlockMask(const std::vector<bool> &block_mask)
+  : block_mask(block_mask)
+{}
+
+
 inline BlockMask::BlockMask(const std::vector<bool> &block_mask)
   : block_mask(block_mask)
 {}
index 37209e7225685011439f04e345331327b3388bc9..5ffb5d00be1e76f59aebc45a74294f7532a40f42 100644 (file)
@@ -89,6 +89,14 @@ public:
    */
   ComponentMask() = default;
 
+  /**
+   * Deprecated constructor allowing implicit conversion.
+   */
+  template <typename = void>
+  DEAL_II_DEPRECATED_EARLY_WITH_COMMENT(
+    "Implicit conversions from std::vector<bool> to ComponentMask are deprecated!")
+  ComponentMask(const std::vector<bool> &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 <typename>
+inline ComponentMask::ComponentMask(const std::vector<bool> &component_mask)
+  : component_mask(component_mask)
+{}
+
+
 inline ComponentMask::ComponentMask(const std::vector<bool> &component_mask)
   : component_mask(component_mask)
 {}

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.