From d42908522f9cc916e6b92dbe9378bb86d939d3cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20Gr=C3=A4ser?= <graeser@dune-project.org> Date: Fri, 4 Dec 2009 20:59:45 +0000 Subject: [PATCH] Make IsBaseOf robust wrt qualifiers and references. [[Imported from SVN: r5742]] --- dune/common/typetraits.hh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dune/common/typetraits.hh b/dune/common/typetraits.hh index e66e84bff..f18e44ec6 100644 --- a/dune/common/typetraits.hh +++ b/dune/common/typetraits.hh @@ -250,11 +250,13 @@ namespace Dune template <class Base, class Derived> class IsBaseOf { + typedef typename ConstantVolatileTraits< typename TypeTraits< Base >::ReferredType >::UnqualifiedType RawBase; + typedef typename ConstantVolatileTraits< typename TypeTraits< Derived >::ReferredType >::UnqualifiedType RawDerived; typedef char Small; struct Big {char dummy[2];}; - static Small test(Base*); + static Small test(RawBase*); static Big test(...); - static typename TypeTraits< Derived* >::ReferredType &makePtr (); + static RawDerived* &makePtr (); public: enum { /** @brief True if Base is a base class of Derived. */ -- GitLab