Contrain GeometryType template constructor
The templated constructor is supposed to be used with
types modelling a TopologyType
, i.e., types providing
::dimension
and ::id
. This MR constrains the overload
to such types only.
This fixes the problem that dune-functions cannot be
build with clang and libstdc++-6. For the same reason
the PQkLocalFiniteElementCache
could not be used with
this combination which is unfortunately not triggered
by any test.
Since the reason is far from obvious I'll give a short summary:
- Dune-functions uses
PQkLocalFiniteElementCache
. - The copy constructor and
get()
function ofPQkLocalFiniteElementCache
useoperator[](const GeometryType&)
ofstd::map<GeometryType,Foo>
. - When called with an l-value, the
operator[]
of anstd::map<T, Foo>
checks ifT
can be constructed from atuple<...>
. (*) - This check fails to compile with the very greedy templated constructor
template<class TopologyType> GeometryType(TopologyType);
Notice that I don't understand the purpose of the check in (*)
which spans over about 20 levels of template instantiation context.
E.g. it does not happen if operator[]
is called with an r-value as
argument.
By constraining the constructor to only be available for appropriate types we can avoid this problem.