#include <string>
#include <tuple>
#include <type_traits>
+#include <typeinfo>
#include <utility>
#include <vector>
#include <boost/archive/binary_iarchive.hpp>
#include <boost/archive/binary_oarchive.hpp>
+#include <boost/core/demangle.hpp>
#include <boost/serialization/array.hpp>
#include <boost/serialization/complex.hpp>
#include <boost/serialization/vector.hpp>
double
generate_normal_random_number(const double a, const double sigma);
+ /**
+ * Return a string description of the type of the variable @p t.
+ *
+ * In general, C++ uses mangled names to identify types. This function
+ * uses boost::core::demangle to return a human readable string describing
+ * the type of the variable passed as argument.
+ *
+ * @author Luca Heltai, 2019.
+ */
+ template <class T>
+ std::string
+ type_to_string(const T &t);
/**
* Calculate a fixed power, provided as a template argument, of a number.
+ template <class T>
+ inline std::string
+ type_to_string(const T &t)
+ {
+ return boost::core::demangle(typeid(t).name());
+ }
+
+
+
template <typename Iterator, typename T>
inline Iterator
lower_bound(Iterator first, Iterator last, const T &val)
--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 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 Utilities::type_to_string()
+
+#include <deal.II/base/utilities.h>
+
+#include "../tests.h"
+
+int
+main()
+{
+ initlog();
+
+ double a = 1.0;
+ int b = 3;
+ Point<2> c;
+
+ deallog << Utilities::type_to_string(a) << std::endl
+ << Utilities::type_to_string(b) << std::endl
+ << Utilities::type_to_string(c) << std::endl;
+}