Skip to content
Snippets Groups Projects

Support libc++ and reduce minimum required standard to c++20

Merged Santiago Ospina De Los Ríos requested to merge feature/support_cpp20 into master
1 file
+ 2
3
Compare changes
  • Side-by-side
  • Inline
@@ -14,6 +14,7 @@
#include <dune/common/float_cmp.hh>
#include <function2/function2.hpp>
#include <spdlog/spdlog.h>
#include <fmt/color.h>
@@ -39,8 +40,7 @@ reduce(const Basis& basis,
const ParameterTree& config,
std::shared_ptr<const FunctorFactory<Basis::EntitySet::GridView::dimension>> functor_factory = nullptr)
{
using GridView = typename Basis::EntitySet::GridView;
constexpr std::size_t dim = GridView::dimension;
constexpr std::size_t dim = Basis::EntitySet::GridView::dimension;
TRACE_EVENT("dune", "Reduce");
if (basis.entitySet().size(0) == 0) {
@@ -48,7 +48,7 @@ reduce(const Basis& basis,
}
std::shared_ptr<const ParserContext> parser_context;
auto functor_factory_parser = std::dynamic_pointer_cast<const FunctorFactoryParser<GridView::dimension>>(functor_factory);
auto functor_factory_parser = std::dynamic_pointer_cast<const FunctorFactoryParser<dim>>(functor_factory);
if (functor_factory_parser) {
parser_context = functor_factory_parser->parser_context();
}
@@ -85,7 +85,7 @@ reduce(const Basis& basis,
std::map<std::string, double> values;
double factor = 0.;
std::vector<std::move_only_function<void() const>> evals;
std::vector<fu2::unique_function<void() const>> evals;
// configure parsers of the evaluation/reduction passes
for (auto key : config.getSubKeys()) {
if (config.hasKey(key + ".evaluation.expression")) {
@@ -93,7 +93,7 @@ reduce(const Basis& basis,
if (not evaluation)
continue;
values[key] = 0.;
std::move_only_function<double(double, double, double) const> reduction = [](auto init, auto val, auto weight) { return init + val*weight; };
fu2::unique_function<double(double, double, double) const> reduction = [](auto init, auto val, auto weight) { return init + val*weight; };
if (config.hasKey(key + ".reduction.expression")) {
auto [args, expr] = parser_context->parse_function_expression(config.sub(key).sub("reduction")["expression"]);
if (args.size() != 3)
Loading