#include <deal.II/base/exceptions.h>
#include <deal.II/base/subscriptor.h>
-#include <boost/any.hpp>
-
#include <algorithm>
+#include <any>
#include <typeinfo>
#include <vector>
private:
/// The stored data
- std::vector<boost::any> data;
+ std::vector<std::any> data;
/// The names of the stored data
std::vector<std::string> names;
};
AnyData::entry(const unsigned int i)
{
AssertIndexRange(i, size());
- type *p = boost::any_cast<type>(&data[i]);
+ type *p = std::any_cast<type>(&data[i]);
Assert(p != nullptr,
ExcTypeMismatch(typeid(type).name(), data[i].type().name()));
return *p;
AnyData::entry(const unsigned int i) const
{
AssertIndexRange(i, size());
- const type *p = boost::any_cast<type>(&data[i]);
+ const type *p = std::any_cast<type>(&data[i]);
if (p == nullptr)
- p = boost::any_cast<const type>(&data[i]);
+ p = std::any_cast<const type>(&data[i]);
Assert(p != nullptr,
ExcTypeMismatch(typeid(type).name(), data[i].type().name()));
return *p;
AnyData::read(const unsigned int i) const
{
AssertIndexRange(i, size());
- const type *p = boost::any_cast<type>(&data[i]);
+ const type *p = std::any_cast<type>(&data[i]);
if (p == nullptr)
- p = boost::any_cast<const type>(&data[i]);
+ p = std::any_cast<const type>(&data[i]);
Assert(p != nullptr,
ExcTypeMismatch(typeid(type).name(), data[i].type().name()));
return *p;
AnyData::read_ptr(const unsigned int i) const
{
AssertIndexRange(i, size());
- const type *const *p = boost::any_cast<type *>(&data[i]);
+ const type *const *p = std::any_cast<type *>(&data[i]);
if (p == nullptr)
- p = boost::any_cast<const type *>(&data[i]);
+ p = std::any_cast<const type *>(&data[i]);
Assert(p != nullptr,
ExcTypeMismatch(typeid(type *).name(), data[i].type().name()));
return *p;
AnyData::try_read_ptr(const unsigned int i) const
{
AssertIndexRange(i, size());
- const type *const *p = boost::any_cast<type *>(&data[i]);
+ const type *const *p = std::any_cast<type *>(&data[i]);
if (p == nullptr)
- p = boost::any_cast<const type *>(&data[i]);
+ p = std::any_cast<const type *>(&data[i]);
if (p == nullptr)
return nullptr;
return *p;
AnyData::try_read(const unsigned int i) const
{
AssertIndexRange(i, size());
- const type *p = boost::any_cast<type>(&data[i]);
+ const type *p = std::any_cast<type>(&data[i]);
if (p == 0)
- p = boost::any_cast<const type>(&data[i]);
+ p = std::any_cast<const type>(&data[i]);
return p;
}
AnyData::entry(const std::string &n)
{
const unsigned int i = find(n);
- type *p = boost::any_cast<type>(&data[i]);
+ type *p = std::any_cast<type>(&data[i]);
Assert(p != 0, ExcTypeMismatch(typeid(type).name(), data[i].type().name()));
return *p;
}
AnyData::entry(const std::string &n) const
{
const unsigned int i = find(n);
- const type *p = boost::any_cast<type>(&data[i]);
+ const type *p = std::any_cast<type>(&data[i]);
Assert(p != nullptr,
ExcTypeMismatch(typeid(type).name(), data[i].type().name()));
return *p;
AnyData::read(const std::string &n) const
{
const unsigned int i = find(n);
- const type *p = boost::any_cast<type>(&data[i]);
+ const type *p = std::any_cast<type>(&data[i]);
Assert(p != 0, ExcTypeMismatch(typeid(type).name(), data[i].type().name()));
return *p;
}
AnyData::read_ptr(const std::string &n) const
{
const unsigned int i = find(n);
- const type *const *p = boost::any_cast<type *>(&data[i]);
+ const type *const *p = std::any_cast<type *>(&data[i]);
if (p == nullptr)
- p = boost::any_cast<const type *>(&data[i]);
+ p = std::any_cast<const type *>(&data[i]);
Assert(p != nullptr,
ExcTypeMismatch(typeid(type).name(), data[i].type().name()));
return *p;
if (i == numbers::invalid_unsigned_int)
return 0;
- const type *const *p = boost::any_cast<type *>(&data[i]);
+ const type *const *p = std::any_cast<type *>(&data[i]);
if (p == 0)
- p = boost::any_cast<const type *>(&data[i]);
+ p = std::any_cast<const type *>(&data[i]);
return *p;
}
// Compute index and return casted pointer
unsigned int i = it - names.begin();
- const type *p = boost::any_cast<type>(&data[i]);
+ const type *p = std::any_cast<type>(&data[i]);
return p;
}
inline void
AnyData::add(type ent, const std::string &n)
{
- boost::any e = ent;
+ std::any e = ent;
data.push_back(e);
names.push_back(n);
}