[Dune-devel] [Dune-Bugs] [#1041] BCRSMatrix does not always initialize data memory

Oliver Sander sander at igpm.rwth-aachen.de
Tue Jan 22 13:44:39 CET 2013


>> But let me ask again: why the need for  MatrixHasTrivialConstructor?
>> Does it really make a measurable difference to omit the empty
>> default constructors in BCRSMatrix?
> I do not know, but I am pretty sure that it is not slower. Sure one could
> rely on the compiler optimization, but why depend on it if we can do
> it ourselves.
Because it clutters our code with even more template magic
for no measurable reason?

>> And if it does matter: shouldn't we use std::is_pod instead of the
>> hand-coded MatrixHasTrivialConstructor?
> I doubt that FieldMatrix can be regarded as a plain old datatype.
> Quoting cplusplus.com: "A POD type (which stands for Plain Old Data
> type) is a type whose characteristics are supported by a data type in
> the C language, either cv-qualified or not."
There are different variants of std::is_pod that may be better suited.
How about std::is_trivially_default_constructible() ?

best,
Oliver

>
> Cheers,
>
> Markus
>
> _______________________________________________
> Dune-devel mailing list
> Dune-devel at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-devel





More information about the Dune-devel mailing list