Skip to content

FS#1512 Replace type traits by their standard versions

Felix Gruber requested to merge felix.gruber/dune-common:type_traits into master

In flyspray/FS#1512 (closed), @carsten.graeser proposed to replace our own implementations of type traits with the ones provided by the standard library.

In order to make auditing my changes easier, I split them up into several smaller commits that only replace one type trait with it's implementation from std::.

I marked the rather uncommonly named type traits IsBaseOf, IsConst and IsVolatile as deprecated with a warning message to use std::is_base_of, std::is_const and std::is_volatile, instead. The already deprecated class TypeTraits has been removed, as it wasn't used by any of the core modules anymore.

All the standard type traits remain in dune/common/typetraits.hh as using declarations to their std:: implementations. I don't know if it is possible to deprecate using declarations, but I guess we should deprecate them in favor of using the std:: type traits directly. I will soon open merge request for the other core modules and pdelab to replace the type traits used there.

Merge request reports