[Dune] Vorschlag IndexIdsets.

Christian Engwer christi at uni-hd.de
Tue Sep 13 10:45:41 CEST 2005


Hi,
 
> One little thing about that point. Of course should the index methods
> have the same parameter list. But then we should implement some kind of
> compile time check, that the method id, or index is only instanciated
> with a Dune::Entity<...,GridImp>. That is the disadvantage of my
> suggestion from yesterday. But I think it's a little one.

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.

Christian




More information about the Dune mailing list