On 27 May 2013 23:05, Anders Logg <[email protected]> wrote:
> On Mon, May 27, 2013 at 11:00:16PM +0100, Garth N. Wells wrote:
>> On 27 May 2013 22:47, Anders Logg <[email protected]> wrote:
>> > I've just pushed a new typedef 'mesh_index' for unsigned int, similar
>> > to the existing 'la_index'. I suggest we use it in place of unsigned
>> > int wherever we now use unsigned int in place of std::size_t to save
>> > space for local entity indices.
>> >
>>
>> Could you motivate the addition? la_index has a clear motivation -
>> compatibility with linear algebra backends.
>
> So that whenever we use 'unsigned int', it is for a clear purpose -
> either to save space or for compatibility with the index type used by
> the mesh library. It is otherwise likely that it is just using
> unsigned int out of old habit (as I'm prone to). It also has the
> advantage that we can easily change the definition of the type in the
> future if we should need it.
>

For me a typedef has the opposite effect. It obscures the type. I find
it easy to choose between std::size_t and unsigned int because the
type is obvious. I would prefer to not introduce an unnecessary type.

Garth

> --
> Anders
_______________________________________________
fenics mailing list
[email protected]
http://fenicsproject.org/mailman/listinfo/fenics

Reply via email to