#1140 unify C++ type for dimension quantities

Metadata

Property Value
Reported by Martin Nolte (nolte@mathematik.uni-freiburg.de)
Reported at Jun 24, 2012 05:35
Type Bug Report
Version Git (pre2.4) [autotools]
Operating System Unspecified / All

Description

Within the core modules, dimensions are sometimes specified as int and sometimes as unsigned int (sometimes even as an enum). Examples include:

In class Dune::Grid:

enum { dimension = dim };
int size ( int codim ) const;

In class Dune::IndexSet:

IndexType subIndex ( const Entity &e, int i, unsigned int codim ) const

In the generic geometry code, unsigned int is used, while for historical reasons the int in GenericReferenceElement was kept.

I think this confuses users, leads to unnecessary signed / unsigned comparison warnings (in user code). Especially with template arguments, some compilers seem no to promote int to unsigned int correctly, when it comes to specialization.

In my opinion, we should decide on "the" correct type for dimensional quantities and stick to it throughout the interfaces.

PS: This might resolve #1135 (closed) for free.