]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use std::any instead of boost::any in GeneralDataStorage. 16172/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Mon, 23 Oct 2023 12:49:06 +0000 (06:49 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Mon, 23 Oct 2023 17:14:44 +0000 (11:14 -0600)
include/deal.II/algorithms/general_data_storage.h

index 23ee33bf2c2b88375538d38d90e3b00e6ae0c58b..30746c2daa02b84c92b5c6415482d690781e87e1 100644 (file)
 #include <deal.II/base/exceptions.h>
 #include <deal.II/base/subscriptor.h>
 
-#include <boost/any.hpp>
 #include <boost/core/demangle.hpp>
 
 #include <algorithm>
+#include <any>
 #include <map>
 #include <string>
 #include <typeinfo>
@@ -330,14 +330,14 @@ public:
   /** @} */
 
   /**
-   * An entry with this name does not exist in the internal boost::any map.
+   * An entry with this name does not exist in the internal std::any map.
    */
   DeclException1(ExcNameNotFound,
                  std::string,
                  << "No entry with the name " << arg1 << " exists.");
 
   /**
-   * An entry with this name does not exist in the internal boost::any map.
+   * An entry with this name does not exist in the internal std::any map.
    */
   DeclException1(ExcNameHasBeenFound,
                  std::string,
@@ -357,7 +357,7 @@ private:
   /**
    * Arbitrary user data, identified by a string.
    */
-  std::map<std::string, boost::any> any_data;
+  std::map<std::string, std::any> any_data;
 };
 
 
@@ -426,11 +426,11 @@ GeneralDataStorage::get_object_with_name(const std::string &name)
 
   if (any_data[name].type() == typeid(Type *))
     {
-      p = boost::any_cast<Type *>(any_data[name]);
+      p = std::any_cast<Type *>(any_data[name]);
     }
   else if (any_data[name].type() == typeid(Type))
     {
-      p = boost::any_cast<Type>(&any_data[name]);
+      p = std::any_cast<Type>(&any_data[name]);
     }
   else
     {
@@ -454,12 +454,12 @@ GeneralDataStorage::get_object_with_name(const std::string &name) const
 
   if (it->second.type() == typeid(Type *))
     {
-      const Type *p = boost::any_cast<Type *>(it->second);
+      const Type *p = std::any_cast<Type *>(it->second);
       return *p;
     }
   else if (it->second.type() == typeid(Type))
     {
-      const Type *p = boost::any_cast<Type>(&it->second);
+      const Type *p = std::any_cast<Type>(&it->second);
       return *p;
     }
   else

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.