]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Replace std_cxx17
authorDaniel Arndt <arndtd@ornl.gov>
Sat, 1 Jul 2023 18:54:50 +0000 (14:54 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Sat, 1 Jul 2023 18:54:50 +0000 (14:54 -0400)
33 files changed:
examples/step-85/step-85.cc
include/deal.II/base/mutable_bind.h
include/deal.II/base/quadrature_point_data.h
include/deal.II/base/std_cxx17/algorithm.h
include/deal.II/base/std_cxx17/optional.h
include/deal.II/base/std_cxx17/tuple.h
include/deal.II/base/std_cxx17/variant.h
include/deal.II/base/table_handler.h
include/deal.II/base/thread_management.h
include/deal.II/grid/grid_tools.h
include/deal.II/non_matching/fe_values.h
include/deal.II/non_matching/quadrature_generator.h
include/deal.II/numerics/fe_field_function.h
include/deal.II/numerics/fe_field_function.templates.h
include/deal.II/optimization/line_minimization.h
source/base/table_handler.cc
source/cgal/intersections.cc
source/grid/reference_cell.cc
source/non_matching/fe_values.cc
source/non_matching/quadrature_generator.cc
source/non_matching/quadrature_generator.inst.in
tests/base/cell_data_storage_01.cc
tests/base/mutable_bind_01.cc
tests/base/mutable_bind_02.cc
tests/base/mutable_bind_03.cc
tests/base/mutable_bind_04.cc
tests/base/stdcxx17_apply.cc [deleted file]
tests/base/stdcxx17_apply.output [deleted file]
tests/distributed_grids/grid_tools_exchange_cell_data_04.cc
tests/non_matching/fe_interface_values.cc
tests/non_matching/fe_interface_values_non_standard_meshes.cc
tests/non_matching/fe_values.cc
tests/non_matching/find_best_height_direction.cc

index 981677edbb68b2ee462db9350657b8618862dba2..abcee95b07d7f54a3312541eebedf7208ff1ae04 100644 (file)
@@ -395,7 +395,7 @@ namespace Step85
         // produces anything useful. It can happen that the algorithm produces 0
         // quadrature points. When this happens, the returned optional will not
         // contain a value, even if the cell is formally intersected.
-        const std_cxx17::optional<FEValues<dim>> &inside_fe_values =
+        const std::optional<FEValues<dim>> &inside_fe_values =
           non_matching_fe_values.get_inside_fe_values();
 
         if (inside_fe_values)
@@ -433,7 +433,7 @@ namespace Step85
         // An additional benefit of std::optional is that we do not need any
         // other check for whether we are on intersected cells: In case we are
         // on an inside cell, we get an empty object here.
-        const std_cxx17::optional<NonMatching::FEImmersedSurfaceValues<dim>>
+        const std::optional<NonMatching::FEImmersedSurfaceValues<dim>>
           &surface_fe_values = non_matching_fe_values.get_surface_fe_values();
 
         if (surface_fe_values)
@@ -634,7 +634,7 @@ namespace Step85
       {
         non_matching_fe_values.reinit(cell);
 
-        const std_cxx17::optional<FEValues<dim>> &fe_values =
+        const std::optional<FEValues<dim>> &fe_values =
           non_matching_fe_values.get_inside_fe_values();
 
         if (fe_values)
index 7f153af4ca53a32ef5e6b97842514ea7fd3e49f9..79a5c0c64b75277ac4cce6956ce0f8f4abcbf9ff 100644 (file)
@@ -19,7 +19,6 @@
 #include <deal.II/base/config.h>
 
 #include <deal.II/base/patterns.h>
-#include <deal.II/base/std_cxx17/tuple.h>
 
 #include <tuple>
 #include <utility>
@@ -253,7 +252,7 @@ namespace Utilities
   ReturnType
   MutableBind<ReturnType, FunctionArgs...>::operator()() const
   {
-    return std_cxx17::apply(function, arguments);
+    return std::apply(function, arguments);
   }
 
 
index f40eb4e91567280aaaac6908f19cb038d0f48599..6e51a874a9c7891d77d8007c84f4783e0c325e00 100644 (file)
@@ -19,7 +19,6 @@
 #include <deal.II/base/config.h>
 
 #include <deal.II/base/quadrature.h>
-#include <deal.II/base/std_cxx17/optional.h>
 #include <deal.II/base/subscriptor.h>
 
 #include <deal.II/distributed/tria.h>
@@ -33,6 +32,7 @@
 #include <deal.II/lac/vector.h>
 
 #include <map>
+#include <optional>
 #include <type_traits>
 #include <vector>
 
@@ -170,9 +170,9 @@ public:
   get_data(const CellIteratorType &cell) const;
 
   /**
-   * Returns a std_cxx17::optional indicating whether @p cell contains an
+   * Returns a std::optional indicating whether @p cell contains an
    * associated data or not. If data is available, dereferencing the
-   * std_cxx17::optional reveals a vector of pointers to the underlying data
+   * std::optional reveals a vector of pointers to the underlying data
    * at the quadrature points.
    * A possible additional typename @p T is the class to which the base class
    * DataType could be cast. Since @p DataType is stored as shared pointers,
@@ -186,13 +186,13 @@ public:
    * initialize() the cell data.
    */
   template <typename T = DataType>
-  std_cxx17::optional<std::vector<std::shared_ptr<T>>>
+  std::optional<std::vector<std::shared_ptr<T>>>
   try_get_data(const CellIteratorType &cell);
 
   /**
-   * Returns a std_cxx17::optional indicating whether @p cell contains an
+   * Returns a std::optional indicating whether @p cell contains an
    * associated data or not. If data is available, dereferencing the
-   * std_cxx17::optional reveals a vector of constant pointers to the
+   * std::optional reveals a vector of constant pointers to the
    * underlying data at the quadrature points.
    * A possible additional typename @p T is the class to which the base class
    * DataType could be cast. Since @p DataType is stored as shared pointers,
@@ -206,7 +206,7 @@ public:
    * initialize() the cell data.
    */
   template <typename T = DataType>
-  std_cxx17::optional<std::vector<std::shared_ptr<const T>>>
+  std::optional<std::vector<std::shared_ptr<const T>>>
   try_get_data(const CellIteratorType &cell) const;
 
 private:
@@ -746,7 +746,7 @@ CellDataStorage<CellIteratorType, DataType>::get_data(
 
 template <typename CellIteratorType, typename DataType>
 template <typename T>
-inline std_cxx17::optional<std::vector<std::shared_ptr<T>>>
+inline std::optional<std::vector<std::shared_ptr<T>>>
 CellDataStorage<CellIteratorType, DataType>::try_get_data(
   const CellIteratorType &cell)
 {
@@ -777,7 +777,7 @@ CellDataStorage<CellIteratorType, DataType>::try_get_data(
 
 template <typename CellIteratorType, typename DataType>
 template <typename T>
-inline std_cxx17::optional<std::vector<std::shared_ptr<const T>>>
+inline std::optional<std::vector<std::shared_ptr<const T>>>
 CellDataStorage<CellIteratorType, DataType>::try_get_data(
   const CellIteratorType &cell) const
 {
index d8404b88a6b6a2e8799b74e5c68095270791fa44..3231bfe295a0792b6be98f2f3c8459e57add977b 100644 (file)
@@ -17,6 +17,9 @@
 
 #include <deal.II/base/config.h>
 
+DEAL_II_WARNING(
+  "This file is deprecated. Simply use the corresponding C++14 header <algorithm>.")
+
 #include <algorithm>
 
 DEAL_II_NAMESPACE_OPEN
index 4d6cc23f2d34d12d7eeaf796cef3e40b9e646020..510857a6d2f50dc8bfc8ade793416208b78dde4d 100644 (file)
@@ -17,6 +17,9 @@
 
 #include <deal.II/base/config.h>
 
+DEAL_II_WARNING(
+  "This file is deprecated. Simply use the corresponding C++14 header <optional>.")
+
 #include <optional>
 
 DEAL_II_NAMESPACE_OPEN
index 03757d9bf6b0bc3ff80610173051726da2d010ce..e81cce318b94e829dce80f9b24ad147c1d74ffbd 100644 (file)
@@ -17,6 +17,9 @@
 
 #include <deal.II/base/config.h>
 
+DEAL_II_WARNING(
+  "This file is deprecated. Simply use the corresponding C++14 header <tuple>.")
+
 #include <tuple>
 
 DEAL_II_NAMESPACE_OPEN
index 84cc794db4dbbed536763f0065bdaa7ec977a742..a7d42b74b9d650c801571746e1567a933f9200ba 100644 (file)
@@ -17,6 +17,9 @@
 
 #include <deal.II/base/config.h>
 
+DEAL_II_WARNING(
+  "This file is deprecated. Simply use the corresponding C++14 header <variant>.")
+
 #include <variant>
 
 DEAL_II_NAMESPACE_OPEN
index 951568c871b4a686026f0844f86b3e8d27b6cf58..a55bc25941ae16e029bb204d48f57fd39d37c55d 100644 (file)
@@ -20,7 +20,6 @@
 #include <deal.II/base/config.h>
 
 #include <deal.II/base/exceptions.h>
-#include <deal.II/base/std_cxx17/variant.h>
 
 #include <boost/serialization/map.hpp>
 #include <boost/serialization/split_member.hpp>
@@ -31,6 +30,7 @@
 #include <map>
 #include <ostream>
 #include <string>
+#include <variant>
 #include <vector>
 
 
@@ -149,7 +149,7 @@ namespace internal
      * Abbreviation for the data type stored by this object.
      */
     using value_type =
-      std_cxx17::variant<int, unsigned int, std::uint64_t, double, std::string>;
+      std::variant<int, unsigned int, std::uint64_t, double, std::string>;
 
     /**
      * Stored value.
@@ -818,13 +818,13 @@ namespace internal
   {
     // we don't quite know the data type in 'value', but
     // it must be one of the ones in the type list of the
-    // std_cxx17::variant. so if T is not in the list, or if
+    // std::variant. so if T is not in the list, or if
     // the data stored in the TableEntry is not of type
     // T, then we will get an exception that we can
     // catch and produce an error message
     try
       {
-        return std_cxx17::get<T>(value);
+        return std::get<T>(value);
       }
     catch (...)
       {
@@ -844,33 +844,33 @@ namespace internal
     // write first an identifier for the kind
     // of data stored and then the actual
     // data, in its correct data type
-    if (std_cxx17::holds_alternative<int>(value))
+    if (std::holds_alternative<int>(value))
       {
-        const int p = std_cxx17::get<int>(value);
+        const int p = std::get<int>(value);
         char      c = 'i';
         ar &c &p;
       }
-    else if (std_cxx17::holds_alternative<unsigned int>(value))
+    else if (std::holds_alternative<unsigned int>(value))
       {
-        const unsigned int p = std_cxx17::get<unsigned int>(value);
+        const unsigned int p = std::get<unsigned int>(value);
         char               c = 'u';
         ar &c &p;
       }
-    else if (std_cxx17::holds_alternative<double>(value))
+    else if (std::holds_alternative<double>(value))
       {
-        const double p = std_cxx17::get<double>(value);
+        const double p = std::get<double>(value);
         char         c = 'd';
         ar &c &p;
       }
-    else if (std_cxx17::holds_alternative<std::string>(value))
+    else if (std::holds_alternative<std::string>(value))
       {
-        const std::string p = std_cxx17::get<std::string>(value);
+        const std::string p = std::get<std::string>(value);
         char              c = 's';
         ar &c &p;
       }
-    else if (std_cxx17::holds_alternative<std::uint64_t>(value))
+    else if (std::holds_alternative<std::uint64_t>(value))
       {
-        const std::uint64_t p = std_cxx17::get<std::uint64_t>(value);
+        const std::uint64_t p = std::get<std::uint64_t>(value);
         char                c = 'l';
         ar &c &p;
       }
index b41dc020964f355c035711fe22c9e950b100e7a4..b071d1dedfd3b6598d10526135a2e6e0d17ee5fa 100644 (file)
@@ -22,7 +22,6 @@
 #include <deal.II/base/exceptions.h>
 #include <deal.II/base/multithread_info.h>
 #include <deal.II/base/mutex.h>
-#include <deal.II/base/std_cxx17/tuple.h>
 #include <deal.II/base/template_constraints.h>
 
 #include <atomic>
@@ -31,6 +30,7 @@
 #include <list>
 #include <memory>
 #include <thread>
+#include <tuple>
 #include <utility>
 #include <vector>
 
@@ -839,7 +839,7 @@ namespace Threads
     DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
     auto dummy = std::make_tuple(internal::maybe_make_ref<Args>::act(args)...);
     return new_thread(
-      [dummy, fun_ptr]() -> RT { return std_cxx17::apply(fun_ptr, dummy); });
+      [dummy, fun_ptr]() -> RT { return std::apply(fun_ptr, dummy); });
     DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
   }
 
@@ -1633,7 +1633,7 @@ namespace Threads
   {
     auto dummy = std::make_tuple(internal::maybe_make_ref<Args>::act(args)...);
     return new_task(
-      [dummy, fun_ptr]() -> RT { return std_cxx17::apply(fun_ptr, dummy); });
+      [dummy, fun_ptr]() -> RT { return std::apply(fun_ptr, dummy); });
   }
 
 
index dcf52d9ccfa9301fb58bcdd025775e1c08d236ee..7d1e427302dc7e6287e0a4697207cba90b2202f8 100644 (file)
@@ -22,7 +22,6 @@
 #include <deal.II/base/bounding_box.h>
 #include <deal.II/base/geometry_info.h>
 #include <deal.II/base/point.h>
-#include <deal.II/base/std_cxx17/optional.h>
 
 #include <deal.II/boost_adaptors/bounding_box.h>
 
@@ -52,6 +51,8 @@
 #include <boost/serialization/array.hpp>
 #include <boost/serialization/vector.hpp>
 
+#include <optional>
+
 #ifdef DEAL_II_WITH_ZLIB
 #  include <boost/iostreams/device/back_inserter.hpp>
 #  include <boost/iostreams/filter/gzip.hpp>
@@ -3398,12 +3399,12 @@ namespace GridTools
    * every ghost cell as it was given by @p pack on the owning processor.
    * Whether you do or do not receive information to @p unpack on a given
    * ghost cell depends on whether the @p pack function decided that
-   * something needs to be sent. It does so using the std_cxx17::optional
-   * mechanism: if the std_cxx17::optional return object of the @p pack
+   * something needs to be sent. It does so using the std::optional
+   * mechanism: if the std::optional return object of the @p pack
    * function is empty, then this implies that no data has to be sent for
    * the locally owned cell it was called on. In that case, @p unpack will
    * also not be called on the ghost cell that corresponds to it on the
-   * receiving side. On the other hand, if the std_cxx17::optional object is
+   * receiving side. On the other hand, if the std::optional object is
    * not empty, then the data stored within it will be sent to the received
    * and the @p unpack function called with it.
    *
@@ -3421,11 +3422,11 @@ namespace GridTools
    *   that is a ghost cell somewhere else. As mentioned above, the function
    *   may return a regular data object of type @p DataType to indicate
    *   that data should be sent, or an empty
-   *   <code>std_cxx17::optional@<DataType@></code> to indicate that nothing has
+   *   <code>std::optional@<DataType@></code> to indicate that nothing has
    *   to be sent for this cell.
    * @param unpack The function that will be called for each ghost cell
    *   for which data was sent, i.e., for which the @p pack function
-   *   on the sending side returned a non-empty std_cxx17::optional object.
+   *   on the sending side returned a non-empty std::optional object.
    *   The @p unpack function is then called with the data sent by the
    *   processor that owns that cell.
    * @param cell_filter Only cells are communicated where this filter function returns
@@ -3462,7 +3463,7 @@ namespace GridTools
    * @endcode
    *
    * You will notice that the @p pack lambda function returns an `unsigned int`,
-   * not a `std_cxx17::optional<unsigned int>`. The former converts
+   * not a `std::optional<unsigned int>`. The former converts
    * automatically to the latter, implying that data will always be transported
    * to the other processor.
    *
@@ -3480,7 +3481,7 @@ namespace GridTools
   DEAL_II_CXX20_REQUIRES(concepts::is_triangulation_or_dof_handler<MeshType>)
   void exchange_cell_data_to_ghosts(
     const MeshType &                                     mesh,
-    const std::function<std_cxx17::optional<DataType>(
+    const std::function<std::optional<DataType>(
       const typename MeshType::active_cell_iterator &)> &pack,
     const std::function<void(const typename MeshType::active_cell_iterator &,
                              const DataType &)> &        unpack,
@@ -3504,7 +3505,7 @@ namespace GridTools
   DEAL_II_CXX20_REQUIRES(concepts::is_triangulation_or_dof_handler<MeshType>)
   void exchange_cell_data_to_level_ghosts(
     const MeshType &                                    mesh,
-    const std::function<std_cxx17::optional<DataType>(
+    const std::function<std::optional<DataType>(
       const typename MeshType::level_cell_iterator &)> &pack,
     const std::function<void(const typename MeshType::level_cell_iterator &,
                              const DataType &)> &       unpack,
@@ -4613,8 +4614,8 @@ namespace GridTools
     DEAL_II_CXX20_REQUIRES(concepts::is_triangulation_or_dof_handler<MeshType>)
     inline void exchange_cell_data(
       const MeshType &mesh,
-      const std::function<
-        std_cxx17::optional<DataType>(const MeshCellIteratorType &)> &pack,
+      const std::function<std::optional<DataType>(const MeshCellIteratorType &)>
+        &pack,
       const std::function<void(const MeshCellIteratorType &, const DataType &)>
         &                                                         unpack,
       const std::function<bool(const MeshCellIteratorType &)> &   cell_filter,
@@ -4760,7 +4761,7 @@ namespace GridTools
                                            cell->index(),
                                            &mesh);
 
-              const std_cxx17::optional<DataType> data = pack(mesh_it);
+              const std::optional<DataType> data = pack(mesh_it);
               if (data)
                 {
                   data_to_send.emplace_back(*data);
@@ -4903,7 +4904,7 @@ namespace GridTools
   DEAL_II_CXX20_REQUIRES(concepts::is_triangulation_or_dof_handler<MeshType>)
   inline void exchange_cell_data_to_ghosts(
     const MeshType &                                     mesh,
-    const std::function<std_cxx17::optional<DataType>(
+    const std::function<std::optional<DataType>(
       const typename MeshType::active_cell_iterator &)> &pack,
     const std::function<void(const typename MeshType::active_cell_iterator &,
                              const DataType &)> &        unpack,
@@ -4939,7 +4940,7 @@ namespace GridTools
   DEAL_II_CXX20_REQUIRES(concepts::is_triangulation_or_dof_handler<MeshType>)
   inline void exchange_cell_data_to_level_ghosts(
     const MeshType &                                    mesh,
-    const std::function<std_cxx17::optional<DataType>(
+    const std::function<std::optional<DataType>(
       const typename MeshType::level_cell_iterator &)> &pack,
     const std::function<void(const typename MeshType::level_cell_iterator &,
                              const DataType &)> &       unpack,
index 6d42e31ade20804db6fc099db473e200451c15e3..e3d7fdf1db974de1552c12f92ee69513f12c6739 100644 (file)
@@ -18,7 +18,6 @@
 
 #include <deal.II/base/bounding_box.h>
 #include <deal.II/base/smartpointer.h>
-#include <deal.II/base/std_cxx17/optional.h>
 
 #include <deal.II/dofs/dof_handler.h>
 
@@ -37,6 +36,7 @@
 #include <deal.II/non_matching/quadrature_generator.h>
 
 #include <deque>
+#include <optional>
 
 DEAL_II_NAMESPACE_OPEN
 
@@ -107,7 +107,7 @@ namespace NonMatching
    * can, for example, happen if the relative size of the cut is similar to the
    * floating-point accuracy. Since the FEValues-like objects are not allowed to
    * contain 0 points, the object that get_inside/outside/surface_fe_values()
-   * returns is wrapped in a std_cxx17::optional. This requires us to check if
+   * returns is wrapped in a std::optional. This requires us to check if
    * the returned FEValues-like object contains a value before we use it:
    * @code
    * NonMatching::FEValues<dim> fe_values(...);
@@ -116,7 +116,7 @@ namespace NonMatching
    *  {
    *    fe_values.reinit(cell);
    *
-   *    const std_cxx17::optional<FEValues<dim>> &fe_values_inside =
+   *    const std::optional<FEValues<dim>> &fe_values_inside =
    *      fe_values.get_inside_fe_values();
    *
    *    if (fe_values_inside)
@@ -234,7 +234,7 @@ namespace NonMatching
      * cell is completely located in the outside domain, the returned
      * optional will not contain a value.
      */
-    const std_cxx17::optional<dealii::FEValues<dim>> &
+    const std::optional<dealii::FEValues<dim>> &
     get_inside_fe_values() const;
 
     /**
@@ -245,7 +245,7 @@ namespace NonMatching
      * cell is completely located in the inside domain, the returned
      * optional will not contain a value.
      */
-    const std_cxx17::optional<dealii::FEValues<dim>> &
+    const std::optional<dealii::FEValues<dim>> &
     get_outside_fe_values() const;
 
     /**
@@ -255,7 +255,7 @@ namespace NonMatching
      * @note If the quadrature rule over the region is empty, e.g. because the
      * cell is not intersected, the returned optional will not contain a value.
      */
-    const std_cxx17::optional<FEImmersedSurfaceValues<dim>> &
+    const std::optional<FEImmersedSurfaceValues<dim>> &
     get_surface_fe_values() const;
 
   private:
@@ -316,7 +316,7 @@ namespace NonMatching
      * This container is a std::deque, which is compatible with the `FEValues`
      * class that does not have a copy-constructor.
      */
-    std::deque<std_cxx17::optional<dealii::FEValues<dim>>>
+    std::deque<std::optional<dealii::FEValues<dim>>>
       fe_values_inside_full_quadrature;
 
     /**
@@ -332,7 +332,7 @@ namespace NonMatching
      * This container is a std::deque, which is compatible with the `FEValues`
      * class that does not have a copy-constructor.
      */
-    std::deque<std_cxx17::optional<dealii::FEValues<dim>>>
+    std::deque<std::optional<dealii::FEValues<dim>>>
       fe_values_outside_full_quadrature;
 
     /**
@@ -342,7 +342,7 @@ namespace NonMatching
      * or if 0 quadrature points were generated, this optional will not contain
      * a value.
      */
-    std_cxx17::optional<dealii::FEValues<dim>> fe_values_inside;
+    std::optional<dealii::FEValues<dim>> fe_values_inside;
 
     /**
      * FEValues object created with a quadrature rule integrating over the
@@ -351,7 +351,7 @@ namespace NonMatching
      * or if 0 quadrature points were generated, this optional will not contain
      * a value.
      */
-    std_cxx17::optional<dealii::FEValues<dim>> fe_values_outside;
+    std::optional<dealii::FEValues<dim>> fe_values_outside;
 
     /**
      * FEImmersedSurfaceValues object created with a quadrature rule integrating
@@ -360,8 +360,7 @@ namespace NonMatching
      * intersected or if 0 quadrature points were generated, this optional will
      * not contain a value.
      */
-    std_cxx17::optional<NonMatching::FEImmersedSurfaceValues<dim>>
-      fe_values_surface;
+    std::optional<NonMatching::FEImmersedSurfaceValues<dim>> fe_values_surface;
 
     /**
      * Object that generates the immersed quadrature rules.
@@ -394,7 +393,7 @@ namespace NonMatching
    * or get_outside_fe_values(). For the same reason as described in
    * NonMatching::FEValues, the returned the FEInterfaceValues objects that
    * get_inside/outside_fe_values() returns is wrapped in a
-   * std_cxx17::optional. Assembling using this class would then typically be
+   * std::optional. Assembling using this class would then typically be
    * done in the following way:
    *
    * @code
@@ -414,7 +413,7 @@ namespace NonMatching
    *                                       cell->neighbor_of_neighbor(face_index),
    *                                       neighbor_subface_index);
    *
-   *          const std_cxx17::optional<dealii::FEInterfaceValues<dim>>
+   *          const std::optional<dealii::FEInterfaceValues<dim>>
    *            &inside_fe_values = fe_interface_values.get_inside_fe_values();
    *
    *          // Check if the returned optional contains a value
@@ -550,7 +549,7 @@ namespace NonMatching
      * cell is completely located in the outside domain, the returned
      * optional will not contain a value.
      */
-    const std_cxx17::optional<dealii::FEInterfaceValues<dim>> &
+    const std::optional<dealii::FEInterfaceValues<dim>> &
     get_inside_fe_values() const;
 
     /**
@@ -562,7 +561,7 @@ namespace NonMatching
      * cell is completely located in the inside domain, the returned
      * optional will not contain a value.
      */
-    const std_cxx17::optional<dealii::FEInterfaceValues<dim>> &
+    const std::optional<dealii::FEInterfaceValues<dim>> &
     get_outside_fe_values() const;
 
   private:
@@ -638,7 +637,7 @@ namespace NonMatching
      * This container is a std::deque, which is compatible with the
      * `FEInterfaceValues` class that does not have a copy-constructor.
      */
-    std::deque<std_cxx17::optional<dealii::FEInterfaceValues<dim>>>
+    std::deque<std::optional<dealii::FEInterfaceValues<dim>>>
       fe_values_inside_full_quadrature;
 
     /**
@@ -655,7 +654,7 @@ namespace NonMatching
      * This container is a std::deque, which is compatible with the
      * `FEInterfaceValues` class that does not have a copy-constructor.
      */
-    std::deque<std_cxx17::optional<dealii::FEInterfaceValues<dim>>>
+    std::deque<std::optional<dealii::FEInterfaceValues<dim>>>
       fe_values_outside_full_quadrature;
 
     /**
@@ -665,7 +664,7 @@ namespace NonMatching
      * intersected or if 0 quadrature points were generated, this optional will
      * not contain a value.
      */
-    std_cxx17::optional<dealii::FEInterfaceValues<dim>> fe_values_inside;
+    std::optional<dealii::FEInterfaceValues<dim>> fe_values_inside;
 
     /**
      * FEInterfaceValues object created with a quadrature rule integrating over
@@ -674,7 +673,7 @@ namespace NonMatching
      * intersected or if 0 quadrature points were generated, this optional will
      * not contain a value.
      */
-    std_cxx17::optional<dealii::FEInterfaceValues<dim>> fe_values_outside;
+    std::optional<dealii::FEInterfaceValues<dim>> fe_values_outside;
 
     /**
      * Object that generates the immersed quadrature rules.
index 7b7b7947cf64124d3c8935e8f6b23527d98f4439..626b258a6e6e81eab657745328bd07be52565dfb 100644 (file)
@@ -22,7 +22,6 @@
 #include <deal.II/base/function.h>
 #include <deal.II/base/function_restriction.h>
 #include <deal.II/base/quadrature.h>
-#include <deal.II/base/std_cxx17/optional.h>
 
 #include <deal.II/dofs/dof_handler.h>
 
@@ -33,6 +32,7 @@
 #include <deal.II/non_matching/immersed_surface_quadrature.h>
 
 #include <functional>
+#include <optional>
 
 DEAL_II_NAMESPACE_OPEN
 namespace NonMatching
@@ -1149,10 +1149,10 @@ namespace NonMatching
         void
         split_box_and_recurse(
           const std::vector<std::reference_wrapper<const Function<dim>>>
-            &                                             level_sets,
-          const BoundingBox<dim> &                        box,
-          const std_cxx17::optional<HeightDirectionData> &direction_data,
-          const unsigned int                              n_box_splits);
+            &                                       level_sets,
+          const BoundingBox<dim> &                  box,
+          const std::optional<HeightDirectionData> &direction_data,
+          const unsigned int                        n_box_splits);
 
         /**
          * Uses the midpoint-method to create a quadrature over the box.
@@ -1367,7 +1367,7 @@ namespace NonMatching
        * std::optional is non-set.
        */
       template <int dim>
-      std_cxx17::optional<HeightDirectionData>
+      std::optional<HeightDirectionData>
       find_best_height_direction(
         const std::vector<FunctionBounds<dim>> &all_function_bounds);
 
index 94430d1fcc62511cf4915bb424fe3c744b515fc2..2b0922cdaaed6e1382af2ec7a6c6f7ddefab66cd 100644 (file)
@@ -20,7 +20,6 @@
 
 #include <deal.II/base/function.h>
 #include <deal.II/base/point.h>
-#include <deal.II/base/std_cxx17/optional.h>
 #include <deal.II/base/tensor.h>
 #include <deal.II/base/thread_local_storage.h>
 
@@ -33,6 +32,8 @@
 
 #include <deal.II/lac/vector.h>
 
+#include <optional>
+
 
 DEAL_II_NAMESPACE_OPEN
 
@@ -479,9 +480,9 @@ namespace Functions
     /**
      * Given a cell, return the reference coordinates of the given point
      * within this cell if it indeed lies within the cell. Otherwise return an
-     * uninitialized std_cxx17::optional object.
+     * uninitialized std::optional object.
      */
-    std_cxx17::optional<Point<dim>>
+    std::optional<Point<dim>>
     get_reference_coordinates(
       const typename DoFHandler<dim, spacedim>::active_cell_iterator &cell,
       const Point<dim> &point) const;
index 7393281f2158784faed34b128ee8074c9a83d447..edee5b5eda40d630cd70a2e7fbe7554fd6d4775f 100644 (file)
@@ -81,7 +81,7 @@ namespace Functions
     if (cell == dh->end())
       cell = dh->begin_active();
 
-    std_cxx17::optional<Point<dim>> qp = get_reference_coordinates(cell, p);
+    std::optional<Point<dim>> qp = get_reference_coordinates(cell, p);
     if (!qp)
       {
         const std::pair<
@@ -143,7 +143,7 @@ namespace Functions
     if (cell == dh->end())
       cell = dh->begin_active();
 
-    std_cxx17::optional<Point<dim>> qp = get_reference_coordinates(cell, p);
+    std::optional<Point<dim>> qp = get_reference_coordinates(cell, p);
     if (!qp)
       {
         const std::pair<
@@ -219,7 +219,7 @@ namespace Functions
     if (cell == dh->end())
       cell = dh->begin_active();
 
-    std_cxx17::optional<Point<dim>> qp = get_reference_coordinates(cell, p);
+    std::optional<Point<dim>> qp = get_reference_coordinates(cell, p);
     if (!qp)
       {
         const std::pair<
@@ -548,7 +548,7 @@ namespace Functions
 
 
   template <int dim, typename VectorType, int spacedim>
-  std_cxx17::optional<Point<dim>>
+  std::optional<Point<dim>>
   FEFieldFunction<dim, VectorType, spacedim>::get_reference_coordinates(
     const typename DoFHandler<dim, spacedim>::active_cell_iterator &cell,
     const Point<dim> &                                              point) const
@@ -559,14 +559,14 @@ namespace Functions
         if (GeometryInfo<dim>::is_inside_unit_cell(qp))
           return qp;
         else
-          return std_cxx17::optional<Point<dim>>();
+          return std::optional<Point<dim>>();
       }
     catch (const typename Mapping<dim>::ExcTransformationFailed &)
       {
         // transformation failed, so
         // assume the point is
         // outside
-        return std_cxx17::optional<Point<dim>>();
+        return std::optional<Point<dim>>();
       }
   }
 
index 4d792ab4b42cb283eea7b38733f05821b485bf3f..2f95f6362df818ffa77a4c19e1a36800eb109a6b 100644 (file)
@@ -21,7 +21,6 @@
 #include <deal.II/base/exceptions.h>
 #include <deal.II/base/logstream.h>
 #include <deal.II/base/numbers.h>
-#include <deal.II/base/std_cxx17/optional.h>
 #include <deal.II/base/utilities.h>
 
 #include <deal.II/numerics/history.h>
@@ -49,7 +48,7 @@ namespace LineMinimization
    * not have a solution for given parameters.
    */
   template <typename NumberType>
-  std_cxx17::optional<NumberType>
+  std::optional<NumberType>
   quadratic_fit(const NumberType x_low,
                 const NumberType f_low,
                 const NumberType g_low,
@@ -66,7 +65,7 @@ namespace LineMinimization
    * The return type is optional as the real-valued solution might not exist.
    */
   template <typename NumberType>
-  std_cxx17::optional<NumberType>
+  std::optional<NumberType>
   cubic_fit(const NumberType x_low,
             const NumberType f_low,
             const NumberType g_low,
@@ -82,7 +81,7 @@ namespace LineMinimization
    * The return type is optional as the real-valued solution might not exist.
    */
   template <typename NumberType>
-  std_cxx17::optional<NumberType>
+  std::optional<NumberType>
   cubic_fit_three_points(const NumberType x_low,
                          const NumberType f_low,
                          const NumberType g_low,
@@ -352,7 +351,7 @@ namespace LineMinimization
 
 
   template <typename NumberType>
-  std_cxx17::optional<NumberType>
+  std::optional<NumberType>
   quadratic_fit(const NumberType x1,
                 const NumberType f1,
                 const NumberType g1,
@@ -370,7 +369,7 @@ namespace LineMinimization
 
 
   template <typename NumberType>
-  std_cxx17::optional<NumberType>
+  std::optional<NumberType>
   cubic_fit(const NumberType x1,
             const NumberType f1,
             const NumberType g1,
@@ -397,7 +396,7 @@ namespace LineMinimization
 
 
   template <typename NumberType>
-  std_cxx17::optional<NumberType>
+  std::optional<NumberType>
   cubic_fit_three_points(const NumberType x1,
                          const NumberType f1,
                          const NumberType g1,
@@ -462,7 +461,7 @@ namespace LineMinimization
     // https://github.com/scipy/scipy/blob/v1.0.0/scipy/optimize/linesearch.py#L555-L563
 
     // First try cubic interpolation
-    std_cxx17::optional<NumberType> res = cubic_fit(x1, f1, g1, x2, f2, g2);
+    std::optional<NumberType> res = cubic_fit(x1, f1, g1, x2, f2, g2);
     if (res && *res >= bounds.first && *res <= bounds.second)
       return *res;
 
@@ -498,10 +497,10 @@ namespace LineMinimization
     // https://github.com/scipy/scipy/blob/v1.0.0/scipy/optimize/linesearch.py#L555-L563
 
     // First try cubic interpolation after first iteration
-    std_cxx17::optional<NumberType> res =
+    std::optional<NumberType> res =
       x_rec.size() > 0 ?
         cubic_fit_three_points(x1, f1, g1, x2, f2, x_rec[0], f_rec[0]) :
-        std_cxx17::optional<NumberType>{};
+        std::optional<NumberType>{};
     if (res && *res >= bounds.first && *res <= bounds.second)
       return *res;
 
index 61f2b529dd73971b8c067cbcc36095dd1dd82637..f14dc7749b2a404c169a47f3bbbedab06ee222fe 100644 (file)
@@ -36,13 +36,13 @@ namespace internal
   {
     // we don't quite know the data type in 'value', but
     // it must be one of the ones in the type list of the
-    // std_cxx17::variant. Go through this list and return
+    // std::variant. Go through this list and return
     // the value if this happens to be a number
     //
     // first try with int
     try
       {
-        return std_cxx17::get<int>(value);
+        return std::get<int>(value);
       }
     catch (...)
       {}
@@ -51,7 +51,7 @@ namespace internal
     // ... then with unsigned int...
     try
       {
-        return std_cxx17::get<unsigned int>(value);
+        return std::get<unsigned int>(value);
       }
     catch (...)
       {}
@@ -59,7 +59,7 @@ namespace internal
     // ... then with std::uint64_t...
     try
       {
-        return std_cxx17::get<std::uint64_t>(value);
+        return std::get<std::uint64_t>(value);
       }
     catch (...)
       {}
@@ -67,7 +67,7 @@ namespace internal
     // ...and finally with double precision:
     try
       {
-        return std_cxx17::get<double>(value);
+        return std::get<double>(value);
       }
     catch (...)
       {
index 3fe147fa0206efa44e0a85cee51dd43ad76835d5..f292db9c9cba866801a22e296a971f10b6902211 100644 (file)
@@ -22,8 +22,6 @@
 #ifdef DEAL_II_WITH_CGAL
 
 #  include <deal.II/base/quadrature_lib.h>
-#  include <deal.II/base/std_cxx17/optional.h>
-#  include <deal.II/base/std_cxx17/variant.h>
 #  include <deal.II/base/utilities.h>
 
 #  include <deal.II/fe/mapping.h>
@@ -55,7 +53,9 @@
 #  include <deal.II/cgal/utilities.h>
 
 #  include <fstream>
+#  include <optional>
 #  include <type_traits>
+#  include <variant>
 
 DEAL_II_NAMESPACE_OPEN
 
@@ -130,7 +130,7 @@ namespace CGALWrappers
        * what we want to use because we like to use std data types.
        */
       template <typename... Types>
-      std_cxx17::optional<std_cxx17::variant<Types...>>
+      std::optional<std::variant<Types...>>
       convert_boost_to_std(const boost::optional<boost::variant<Types...>> &x)
       {
         if (x)
@@ -214,17 +214,17 @@ namespace CGALWrappers
 
     // Collection of utilities that compute intersection between simplices
     // identified by array of points. The return type is the one of
-    // CGAL::intersection(), i.e. a std_cxx17::optional<std_cxx17::variant<>>.
+    // CGAL::intersection(), i.e. a std::optional<std::variant<>>.
     // Intersection between 2d and 3d objects and 1d/3d objects are available
     // only with CGAL versions greater or equal than 5.5, hence the
     // corresponding functions are guarded by #ifdef directives. All the
     // signatures follow the convection that the first entity has an intrinsic
     // dimension higher than the second one.
 
-    std_cxx17::optional<std_cxx17::variant<CGALPoint2,
-                                           CGALSegment2,
-                                           CGALTriangle2,
-                                           std::vector<CGALPoint2>>>
+    std::optional<std::variant<CGALPoint2,
+                               CGALSegment2,
+                               CGALTriangle2,
+                               std::vector<CGALPoint2>>>
     compute_intersection_triangle_triangle(
       const ArrayView<const Point<2>> &triangle0,
       const ArrayView<const Point<2>> &triangle1)
@@ -251,7 +251,7 @@ namespace CGALWrappers
     }
 
 
-    std_cxx17::optional<std_cxx17::variant<CGALPoint2, CGALSegment2>>
+    std::optional<std::variant<CGALPoint2, CGALSegment2>>
     compute_intersection_triangle_segment(
       const ArrayView<const Point<2>> &triangle,
       const ArrayView<const Point<2>> &segment)
@@ -312,7 +312,7 @@ namespace CGALWrappers
 
 
 
-    std_cxx17::optional<std_cxx17::variant<CGALPoint3, CGALSegment3>>
+    std::optional<std::variant<CGALPoint3, CGALSegment3>>
     compute_intersection_tetra_segment(
       const ArrayView<const Point<3>> &tetrahedron,
       const ArrayView<const Point<3>> &segment)
@@ -352,10 +352,10 @@ namespace CGALWrappers
 
 
     // tetra, triangle
-    std_cxx17::optional<std_cxx17::variant<CGALPoint3,
-                                           CGALSegment3,
-                                           CGALTriangle3,
-                                           std::vector<CGALPoint3>>>
+    std::optional<std::variant<CGALPoint3,
+                               CGALSegment3,
+                               CGALTriangle3,
+                               std::vector<CGALPoint3>>>
     compute_intersection_tetra_triangle(
       const ArrayView<const Point<3>> &tetrahedron,
       const ArrayView<const Point<3>> &triangle)
index fa2f699230cbc8653d7fb9fd6f666d26fab89d89..5130f123a5dbbf2d0d30bb905722f32578c93794 100644 (file)
@@ -16,7 +16,6 @@
 #include <deal.II/base/polynomial.h>
 #include <deal.II/base/polynomials_barycentric.h>
 #include <deal.II/base/quadrature_lib.h>
-#include <deal.II/base/std_cxx17/algorithm.h>
 #include <deal.II/base/tensor_product_polynomials.h>
 
 #include <deal.II/fe/fe_pyramid_p.h>
@@ -31,6 +30,7 @@
 #include <deal.II/grid/reference_cell.h>
 #include <deal.II/grid/tria.h>
 
+#include <algorithm>
 #include <iostream>
 #include <memory>
 
@@ -1075,45 +1075,43 @@ ReferenceCell::closest_point(const Point<dim> &p) const
           case ReferenceCells::Quadrilateral:
           case ReferenceCells::Hexahedron:
             for (unsigned int d = 0; d < dim; ++d)
-              result[d] = std_cxx17::clamp(result[d], 0.0, 1.0);
+              result[d] = std::clamp(result[d], 0.0, 1.0);
             // simplices can use the standard definition of a simplex:
             break;
           case ReferenceCells::Triangle:
-            result[x_index] = std_cxx17::clamp(result[x_index], 0.0, 1.0);
+            result[x_index] = std::clamp(result[x_index], 0.0, 1.0);
             result[y_index] =
-              std_cxx17::clamp(result[y_index], 0.0, 1.0 - result[x_index]);
+              std::clamp(result[y_index], 0.0, 1.0 - result[x_index]);
             break;
           case ReferenceCells::Tetrahedron:
-            result[x_index] = std_cxx17::clamp(result[x_index], 0.0, 1.0);
+            result[x_index] = std::clamp(result[x_index], 0.0, 1.0);
             result[y_index] =
-              std_cxx17::clamp(result[y_index], 0.0, 1.0 - result[x_index]);
+              std::clamp(result[y_index], 0.0, 1.0 - result[x_index]);
             result[z_index] =
-              std_cxx17::clamp(result[z_index],
-                               0.0,
-                               1.0 - result[x_index] - result[y_index]);
+              std::clamp(result[z_index],
+                         0.0,
+                         1.0 - result[x_index] - result[y_index]);
             break;
           // wedges and pyramids are more ad-hoc:
           case ReferenceCells::Wedge:
-            result[x_index] = std_cxx17::clamp(result[x_index], 0.0, 1.0);
+            result[x_index] = std::clamp(result[x_index], 0.0, 1.0);
             result[y_index] =
-              std_cxx17::clamp(result[y_index], 0.0, 1.0 - result[x_index]);
-            result[z_index] = std_cxx17::clamp(result[z_index], 0.0, 1.0);
+              std::clamp(result[y_index], 0.0, 1.0 - result[x_index]);
+            result[z_index] = std::clamp(result[z_index], 0.0, 1.0);
             break;
           case ReferenceCells::Pyramid:
             {
-              result[x_index] = std_cxx17::clamp(result[x_index], -1.0, 1.0);
-              result[y_index] = std_cxx17::clamp(result[y_index], -1.0, 1.0);
+              result[x_index] = std::clamp(result[x_index], -1.0, 1.0);
+              result[y_index] = std::clamp(result[y_index], -1.0, 1.0);
               // It suffices to transform everything to the first quadrant to
               // adjust z:
               const auto x_abs = std::abs(result[x_index]);
               const auto y_abs = std::abs(result[y_index]);
 
               if (y_abs <= x_abs)
-                result[z_index] =
-                  std_cxx17::clamp(result[z_index], 0.0, 1.0 - x_abs);
+                result[z_index] = std::clamp(result[z_index], 0.0, 1.0 - x_abs);
               else
-                result[z_index] =
-                  std_cxx17::clamp(result[z_index], 0.0, 1.0 - y_abs);
+                result[z_index] = std::clamp(result[z_index], 0.0, 1.0 - y_abs);
             }
             break;
           default:
index 4c1798520787eb6ae995dab3c60f7f95cbb86587..e964884bd5b995d8ebc1f23f05b2c7593fb3614a 100644 (file)
@@ -237,7 +237,7 @@ namespace NonMatching
 
 
   template <int dim>
-  const std_cxx17::optional<dealii::FEValues<dim>> &
+  const std::optional<dealii::FEValues<dim>> &
   FEValues<dim>::get_inside_fe_values() const
   {
     if (current_cell_location == LocationToLevelSet::inside)
@@ -249,7 +249,7 @@ namespace NonMatching
 
 
   template <int dim>
-  const std_cxx17::optional<dealii::FEValues<dim>> &
+  const std::optional<dealii::FEValues<dim>> &
   FEValues<dim>::get_outside_fe_values() const
   {
     if (current_cell_location == LocationToLevelSet::outside)
@@ -261,7 +261,7 @@ namespace NonMatching
 
 
   template <int dim>
-  const std_cxx17::optional<FEImmersedSurfaceValues<dim>> &
+  const std::optional<FEImmersedSurfaceValues<dim>> &
   FEValues<dim>::get_surface_fe_values() const
   {
     return fe_values_surface;
@@ -457,7 +457,7 @@ namespace NonMatching
 
 
   template <int dim>
-  const std_cxx17::optional<dealii::FEInterfaceValues<dim>> &
+  const std::optional<dealii::FEInterfaceValues<dim>> &
   FEInterfaceValues<dim>::get_inside_fe_values() const
   {
     if (current_face_location == LocationToLevelSet::inside)
@@ -469,7 +469,7 @@ namespace NonMatching
 
 
   template <int dim>
-  const std_cxx17::optional<dealii::FEInterfaceValues<dim>> &
+  const std::optional<dealii::FEInterfaceValues<dim>> &
   FEInterfaceValues<dim>::get_outside_fe_values() const
   {
     if (current_face_location == LocationToLevelSet::outside)
index 18ed8736a58944c4b63342b27af43e8c3987b747..2a2afcac7ed5770239db820ea65bb30ca03f7c27 100644 (file)
@@ -271,13 +271,13 @@ namespace NonMatching
 
 
       template <int dim>
-      std_cxx17::optional<HeightDirectionData>
+      std::optional<HeightDirectionData>
       find_best_height_direction(
         const std::vector<FunctionBounds<dim>> &all_function_bounds)
       {
         // Minimum (taken over the indefinite functions) on the lower bound on
         // each component of the gradient.
-        std_cxx17::optional<std::array<double, dim>> min_lower_abs_grad;
+        std::optional<std::array<double, dim>> min_lower_abs_grad;
 
         for (const FunctionBounds<dim> &bounds : all_function_bounds)
           {
@@ -320,7 +320,7 @@ namespace NonMatching
             return data;
           }
 
-        return std_cxx17::optional<HeightDirectionData>();
+        return std::optional<HeightDirectionData>();
       }
 
 
@@ -920,7 +920,7 @@ namespace NonMatching
           }
         else
           {
-            const std_cxx17::optional<HeightDirectionData> data =
+            const std::optional<HeightDirectionData> data =
               find_best_height_direction(all_function_bounds);
 
             // Check larger than a constant to avoid that min_abs_dfdx is only
@@ -955,7 +955,7 @@ namespace NonMatching
        * will be non-set.
        */
       template <int dim>
-      std_cxx17::optional<unsigned int>
+      std::optional<unsigned int>
       direction_of_largest_extent(const BoundingBox<dim> &box)
       {
         // Get the side lengths for each direction and sort them.
@@ -972,7 +972,7 @@ namespace NonMatching
         // function isn't called in 1d, so the (dim - 2)-element exists.
         if (boost::math::epsilon_difference(side_lengths[dim - 1].first,
                                             side_lengths[dim - 2].first) < 100)
-          return std_cxx17::optional<unsigned int>();
+          return std::optional<unsigned int>();
 
         return side_lengths.back().second;
       }
@@ -993,10 +993,10 @@ namespace NonMatching
       template <int dim>
       unsigned int
       compute_split_direction(
-        const BoundingBox<dim> &                        box,
-        const std_cxx17::optional<HeightDirectionData> &height_direction_data)
+        const BoundingBox<dim> &                  box,
+        const std::optional<HeightDirectionData> &height_direction_data)
       {
-        const std_cxx17::optional<unsigned int> direction =
+        const std::optional<unsigned int> direction =
           direction_of_largest_extent(box);
 
         if (direction)
@@ -1055,10 +1055,10 @@ namespace NonMatching
       void
       QGenerator<dim, spacedim>::split_box_and_recurse(
         const std::vector<std::reference_wrapper<const Function<dim>>>
-          &                                             level_sets,
-        const BoundingBox<dim> &                        box,
-        const std_cxx17::optional<HeightDirectionData> &direction_data,
-        const unsigned int                              n_box_splits)
+          &                                       level_sets,
+        const BoundingBox<dim> &                  box,
+        const std::optional<HeightDirectionData> &direction_data,
+        const unsigned int                        n_box_splits)
       {
         if (this->additional_data.split_in_half)
           {
index ab20f0a73e05552e327d4dd5ca0b0d3b57e645e3..e2f2e551ab38f34db40d859aec57b6703a1c272e 100644 (file)
@@ -53,7 +53,7 @@ for (deal_II_dimension : DIMENSIONS)
 // gcc is wrong. We don't need the function when dim = 1, so we avoid
 // instantiating it.
 #if 1 < deal_II_dimension
-          template std_cxx17::optional<HeightDirectionData>
+          template std::optional<HeightDirectionData>
           find_best_height_direction(
             const std::vector<FunctionBounds<deal_II_dimension>> &);
 #endif
index b5f171480f4151cddf5cb624fa05541c0375f88b..015cef56d15cc2367718985669cda8582f1c36ca 100644 (file)
@@ -102,9 +102,9 @@ check_qph(Triangulation<dim> &tr,
         const std::vector<std::shared_ptr<DATA>> qpd = manager.get_data(cell);
         const std::vector<std::shared_ptr<const DATA>> qpd_const =
           manager_const.get_data(cell);
-        const std_cxx17::optional<std::vector<std::shared_ptr<DATA>>>
-          qpd_optional = manager.try_get_data(cell);
-        const std_cxx17::optional<std::vector<std::shared_ptr<const DATA>>>
+        const std::optional<std::vector<std::shared_ptr<DATA>>> qpd_optional =
+          manager.try_get_data(cell);
+        const std::optional<std::vector<std::shared_ptr<const DATA>>>
           qpd_const_optional = manager_const.try_get_data(cell);
         AssertThrow(qpd_optional, ExcInternalError());
         AssertThrow(qpd_const_optional, ExcInternalError());
@@ -177,7 +177,7 @@ test()
             next_cell++;
             if (next_cell != tr.end())
               {
-                const std_cxx17::optional<std::vector<std::shared_ptr<MyQData>>>
+                const std::optional<std::vector<std::shared_ptr<MyQData>>>
                   nonexisting_data = data_storage.try_get_data(next_cell);
                 AssertThrow(!nonexisting_data, ExcInternalError());
               }
index 1c532a28033d9cb32799a81ca30b9c5a14ba0ed3..fa1cc92ad1784d1d9cbc006b73cde41c1db21550 100644 (file)
@@ -18,7 +18,8 @@
 
 #include <deal.II/base/mutable_bind.h>
 #include <deal.II/base/point.h>
-#include <deal.II/base/std_cxx17/tuple.h>
+
+#include <tuple>
 
 #include "../tests.h"
 
index d80e08cfc8a5b8c7b1f7f9244d8cf2cb3896c4e7..763fd8788694dbf0a8552734f58d769141ef98ac 100644 (file)
@@ -18,7 +18,8 @@
 
 #include <deal.II/base/mutable_bind.h>
 #include <deal.II/base/point.h>
-#include <deal.II/base/std_cxx17/tuple.h>
+
+#include <tuple>
 
 #include "../tests.h"
 
index c5edf315dbbc5e0357d5bf439b0434c8ca93901c..8f583fd5438d04071b69667a6ab21f5afaa14762 100644 (file)
@@ -19,7 +19,8 @@
 
 #include <deal.II/base/mutable_bind.h>
 #include <deal.II/base/point.h>
-#include <deal.II/base/std_cxx17/tuple.h>
+
+#include <tuple>
 
 #include "../tests.h"
 
index a659b023a4107e22e89c03f6d66d43aaf539c7c1..2dd02facff28ffa351965895abaa8d59c58cc36b 100644 (file)
@@ -19,7 +19,8 @@
 
 #include <deal.II/base/mutable_bind.h>
 #include <deal.II/base/point.h>
-#include <deal.II/base/std_cxx17/tuple.h>
+
+#include <tuple>
 
 #include "../tests.h"
 
diff --git a/tests/base/stdcxx17_apply.cc b/tests/base/stdcxx17_apply.cc
deleted file mode 100644 (file)
index 151c4df..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-// ---------------------------------------------------------------------
-//
-// Copyright (C) 2017 - 2019 by the deal.II authors
-//
-// This file is part of the deal.II library.
-//
-// The deal.II library is free software; you can use it, redistribute
-// it, and/or modify it under the terms of the GNU Lesser General
-// Public License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-// The full text of the license can be found in the file LICENSE.md at
-// the top level directory of deal.II.
-//
-// ---------------------------------------------------------------------
-
-
-// test the implementation of the std_cxx17::apply function
-
-
-#include <deal.II/base/point.h>
-#include <deal.II/base/std_cxx17/tuple.h>
-
-#include "../tests.h"
-
-
-void
-example_function(const Point<2> &p, const double &d, const unsigned int i = 3)
-{
-  deallog << "P: " << p << ", d: " << d << ", i: " << i << std::endl;
-}
-
-
-int
-main()
-{
-  initlog();
-  auto tup = std::make_tuple(Point<2>(.5, .5), 2.0, 3u);
-  std_cxx17::apply(example_function, tup);
-}
diff --git a/tests/base/stdcxx17_apply.output b/tests/base/stdcxx17_apply.output
deleted file mode 100644 (file)
index 8f2ac51..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-
-DEAL::P: 0.500000 0.500000, d: 2.00000, i: 3
index 646911bb6920560dacf9c9e172bb9bda77e12adc..49459cd1ba5913f34397b4ff463129ceec4de058 100644 (file)
@@ -17,7 +17,7 @@
 // test GridTools::exchange_cell_data_to_ghosts
 //
 // this test works just like the _01 test, but it skips those cells
-// where we have an odd 'counter' value via the std_cxx17::optional
+// where we have an odd 'counter' value via the std::optional
 // framework
 
 #include <deal.II/base/logstream.h>
@@ -80,7 +80,7 @@ test()
   GridTools::
     exchange_cell_data_to_ghosts<DT, parallel::distributed::Triangulation<dim>>(
       tria,
-      [&](const cell_iterator &cell) -> std_cxx17::optional<DT> {
+      [&](const cell_iterator &cell) -> std::optional<DT> {
         const auto         counter = map[cell->id()];
         std::ostringstream oss;
         if (counter % 2 == 0)
@@ -95,7 +95,7 @@ test()
           {
             oss << "skipping " << cell->id() << ' ' << counter;
             input[cell->id()] = oss.str();
-            return std_cxx17::optional<DT>();
+            return std::optional<DT>();
           }
       },
       [&](const cell_iterator &cell, const DT &data) {
index 91425c1b851f93f756f7a6d13cd5fcc17161f771..c8947adb9750f916fe2da3a002174c4376f01bf5 100644 (file)
@@ -16,7 +16,6 @@
 #include <deal.II/base/exceptions.h>
 #include <deal.II/base/function_signed_distance.h>
 #include <deal.II/base/quadrature_lib.h>
-#include <deal.II/base/std_cxx17/optional.h>
 
 #include <deal.II/fe/fe_q.h>
 #include <deal.II/fe/mapping_cartesian.h>
@@ -27,6 +26,8 @@
 
 #include <deal.II/numerics/vector_tools.h>
 
+#include <optional>
+
 #include "../tests.h"
 
 using namespace dealii;
index 113520c761d3aa44e829e25a8892b08b95321286..6c10913f507c45cc9951eb9ae8c9c719549a4987 100644 (file)
@@ -27,7 +27,6 @@
 #include <deal.II/base/exceptions.h>
 #include <deal.II/base/function_signed_distance.h>
 #include <deal.II/base/quadrature_lib.h>
-#include <deal.II/base/std_cxx17/optional.h>
 
 #include <deal.II/fe/fe_q.h>
 
@@ -38,6 +37,7 @@
 #include <deal.II/numerics/vector_tools.h>
 
 #include <bitset>
+#include <optional>
 
 #include "../tests.h"
 
index 06a1c15b443c936ad5bfc4a7603e88daafbdda43..b63ffeacab3576a5ef967ebaaa218172f56c0ccb 100644 (file)
@@ -16,7 +16,6 @@
 #include <deal.II/base/exceptions.h>
 #include <deal.II/base/function_signed_distance.h>
 #include <deal.II/base/quadrature_lib.h>
-#include <deal.II/base/std_cxx17/optional.h>
 
 #include <deal.II/fe/fe_q.h>
 #include <deal.II/fe/fe_values.h>
@@ -28,6 +27,8 @@
 
 #include <deal.II/numerics/vector_tools.h>
 
+#include <optional>
+
 #include "../tests.h"
 
 using namespace dealii;
@@ -48,7 +49,7 @@ assert_cells_are_the_same(
 // Assert that the incoming optional does not have a value.
 template <class FEVALUES>
 void
-assert_doesnt_have_value(const std_cxx17::optional<FEVALUES> &fe_values)
+assert_doesnt_have_value(const std::optional<FEVALUES> &fe_values)
 {
   AssertThrow(!fe_values, ExcInternalError());
   deallog << "OK" << std::endl;
@@ -67,7 +68,7 @@ assert_doesnt_have_value(const std_cxx17::optional<FEVALUES> &fe_values)
 // Test the following:
 // 1. That we can construct a NonMatching::FEValues object.
 // 2. That when we call reinit on each cell in the triangulation,
-// the std_cxx17::optionals that we get from
+// the std::optionals that we get from
 // get_inside/outside/surface_fe_values are set up correctly. That is, the
 // optionals that should contain a value do and the ones that should not contain
 // a value do not.
index 1edccd1fecf4f95fcf3fe54fdbe1a92b4d2e3fc4..7a9e7f3319bcb17c7126bc618b78456ecfa18199 100644 (file)
@@ -51,7 +51,7 @@ test_ignores_definite_functions()
   bounds[0].value = pair_with_equal_entries(-1);
   bounds[1].value = pair_with_equal_entries(1);
 
-  const std_cxx17::optional<HeightDirectionData> data =
+  const std::optional<HeightDirectionData> data =
     find_best_height_direction(bounds);
 
   if (!data)
@@ -87,7 +87,7 @@ test_find_best_height_direction()
   bounds[0].gradient[1] = pair_with_equal_entries(6);
   bounds[1].gradient[1] = pair_with_equal_entries(5);
 
-  const std_cxx17::optional<HeightDirectionData> data =
+  const std::optional<HeightDirectionData> data =
     find_best_height_direction(bounds);
 
   deallog << "height direction = " << data->direction << std::endl;

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.