genericTransformTuple does not work on const tuples
genericTransformTuple
from tupleutility.hh fails to compile if it is given a constant tuple, even if we use a functor with const argument that would theoretically allow to be applied to a const tuple.
Here’s a small example to show what’s happening:
#include <tuple>
#include <dune/common/tupleutility.hh>
struct Reciprocal
{
template<class>
struct TypeEvaluator
{
typedef double Type;
};
template<class T>
typename TypeEvaluator<T>::Type operator()(const T& val) const {
return 1./val;
};
};
int main() {
const std::tuple<int, double> t1(1, 2.);
auto t2 = Dune::genericTransformTuple(t1, Reciprocal());
}
This code fails to compile with a missing overload in genericTransformTupleBackend
.
I’ll publish a merge request soon that adds a testcase and the missing overload for genericTransformTupleBackend
.