[Dune] Vorschlag IndexIdsets.

Robert Kloefkorn robertk at mathematik.uni-freiburg.de
Tue Sep 13 12:49:32 CEST 2005


Christian Engwer wrote:
> I don't really see the problem. Your code was:
> 
>   //! get id of an entity
>   template<class EntityType>
>   IdType id (const EntityType& e) const
>   {
>     enum { cc = EntityType::codimension };
>     return asImp().template id<cc>(e);
>   }
> 
> Now immagine I call this a wrong Entity. The call of id(wrongEntity)
> is perfectly OK, but then the id method will forward this call to
> return asImp().template id<cc>(wrongEntity) which will lead to a
> compiler error.

That's right. But if we also change the parameter list in the
implementation class (as Peter suggested), then we would have that
problem. In the code piece above, we don't have this problem, but we
don't have exactly the same parameter list. That's all.

Cheers

R

-- 

  Robert Klöfkorn           <robertk at mathematik.uni-freiburg.de>

  Mathematisches Institut              Tel: +49 (0) 761 203 5631
  Abt. für Angewandte Mathematik       Fax: +49 (0) 761 203 5632
  Universität Freiburg
  Hermann-Herder-Str. 10
  79104 Freiburg

  http://www.mathematik.uni-freiburg.de/IAM/homepages/robertk




More information about the Dune mailing list