GenerateTypeName is fragile
The GenerateTypeName
infrastructure in typeregistry.hh
requires detailed knowledge about the details of the C++ type. Providing these manually is error-prone, see e.g. the global basis in dune-functions (dune-functions#70).
The global basis defines a DiscreteGlobalBasisFunction
, but sets a type name to GlobalBasis::DiscreteFunction
. When trying to generate C++ code the can operate on such a discrete function, we get compiler errors, because there is no typename GlobalBasis::DiscreteFunction
in the concrete GlobalBasis
.
Couldn't we make GenerateTypeName
more robust by using className
to directly extract the correct type name?
The problem is that GenerateTypeName
is hardly documented, thus I'm unsure about implications of such a change.