Commit 3f5837f9 authored by Carsten Gräser's avatar Carsten Gräser

[backport to 2.6] Re-add applyPartial

This is not in dune-common-2.6 and has to be backported.
Since we want to avoid that people start using the version
in dune-functions its in the Imp:: namespace and hidden from
doxygen and thus no public interface.
parent 8bd22b36
Pipeline #10071 passed with stage
in 7 minutes and 11 seconds
......@@ -254,6 +254,28 @@ struct RotateTuple
namespace Imp {
/*
* \brief Apply function with arguments from a given tuple
*
* \param f A callable object
* \param args Tuple containing the arguments
* \param indices Indices to arguments in tuple as std::integer_sequence
*
* This will call the function with arguments generated by unpacking those
* entries of the tuple that show up given integer_sequence.
*
* \ingroup Utility
*/
template<class F, class ArgTuple, class I, I... i>
decltype(auto) applyPartial(F&& f, ArgTuple&& args, std::integer_sequence<I, i...> indices)
{
return f(std::get<i>(args)...);
}
}
/**
* \brief Create a predicate for checking validity of expressions
*
......
......@@ -12,7 +12,6 @@
#include <dune/common/reservedvector.hh>
#include <dune/common/typeutilities.hh>
#include <dune/common/hybridutilities.hh>
#include <dune/common/tupleutility.hh>
#include <dune/typetree/compositenode.hh>
#include <dune/typetree/utility.hh>
......@@ -520,7 +519,7 @@ auto composite(Args&&... args)
auto childIndices = std::make_index_sequence<children>{};
// Unpack tuple only for those entries related to children
return applyPartial([](auto&&... childPreBasisFactory){
return Dune::Functions::Imp::applyPartial([](auto&&... childPreBasisFactory){
return Imp::CompositePreBasisFactory<IndexMergingStrategy, std::decay_t<decltype(childPreBasisFactory)>...>(std::forward<decltype(childPreBasisFactory)>(childPreBasisFactory)...);
},
std::forward_as_tuple(std::forward<Args>(args)...),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment