From 8dfe3f5875455e40a42e19e39fd0f9e42f95d41e Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sun, 15 Oct 2023 11:15:51 -0600 Subject: [PATCH] Use std::any instead of boost::any. --- include/deal.II/numerics/data_postprocessor.h | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/include/deal.II/numerics/data_postprocessor.h b/include/deal.II/numerics/data_postprocessor.h index 0ff2422a21..a74a2cc8e8 100644 --- a/include/deal.II/numerics/data_postprocessor.h +++ b/include/deal.II/numerics/data_postprocessor.h @@ -32,8 +32,7 @@ #include -#include - +#include #include #include @@ -94,7 +93,7 @@ namespace DataPostprocessorInputs * is obvious. * * To make the cell iterator accessible nevertheless, this class uses - * an object of type boost::any to store the cell iterator. You can + * an object of type std::any to store the cell iterator. You can * think of this as being a void pointer that can point to anything. * To use what is being used therefore requires the user to know the * data type of the thing being pointed to. @@ -290,11 +289,11 @@ namespace DataPostprocessorInputs /** * The place where set_cell() stores the cell. Since the actual data * type of the cell iterator can be many different things, the - * interface uses boost::any here. This makes assignment in set_cell() + * interface uses std::any here. This makes assignment in set_cell() * simple, but requires knowing the data type of the stored object in * get_cell(). */ - boost::any cell; + std::any cell; /** * The place where set_cell_and_face() stores the number of the face @@ -1371,14 +1370,14 @@ namespace DataPostprocessorInputs { // see if we had previously already stored a cell that has the same // data type; if so, reuse the memory location and avoid calling 'new' - // inside boost::any + // inside std::any if (typename DoFHandler::cell_iterator *storage_location = - boost::any_cast::cell_iterator>( + std::any_cast::cell_iterator>( &cell)) *storage_location = new_cell; else // if we had nothing stored before, or if we had stored a different - // data type, just let boost::any replace things + // data type, just let std::any replace things cell = new_cell; // Also reset the face number, just to make sure nobody @@ -1406,12 +1405,12 @@ namespace DataPostprocessorInputs typename DoFHandler::cell_iterator CommonInputs::get_cell() const { - Assert(cell.empty() == false, + Assert(cell.has_value(), ExcMessage( "You are trying to access the cell associated with a " "DataPostprocessorInputs::Scalar object for which no cell has " "been set.")); - Assert((boost::any_cast::cell_iterator>( + Assert((std::any_cast::cell_iterator>( &cell) != nullptr), ExcMessage( "You are trying to access the cell associated with a " @@ -1423,7 +1422,7 @@ namespace DataPostprocessorInputs "DoFHandler<2, 3>, but not with any other class type or dimension " "template argument.")); - return boost::any_cast::cell_iterator>( + return std::any_cast::cell_iterator>( cell); } } // namespace DataPostprocessorInputs -- 2.39.5