[Dune] misc.hh

Thimo Neubauer thimo at debian.org
Wed Oct 27 17:56:17 CEST 2004


Hi,

I've had a look into misc.hh and found that it contains a bunch of
strange functions:

First of all MIN, MAX and ABS can be replaced by std::min, std::max
and std::abs from <algorithm>. I'll commit changes regarding this
soon. The #undef-statements for MIN and MAX should definitely not be
in this header! There seems to be no SQR-replacement in C++ but this
function seems to be unused.

The CompileTimeChecker seems like a nice trick but is only used once:
in fem/operator/discreteoperator.cc. Interestingly, the Checker is
defined in that source-file as well and the only use is
commented... Still needed?

Then there are realloc/malloc-replacements: they seem like a funny
trick to automatically cast the pointer but curiously enough in all
the places in Dune where malloc is used it's explicitly referenced as
::malloc, i.e. the version in misc.hh is not used. grep found no use
of realloc at all...

I guess that the reason for all this functionality was to supply
functions for UG/Albert/Grape/whatever-headers but IMO that problem
should be solved locally and not globally.

Should we keep the header? With what content?

Cheers
    Thimo

P.S.: I'm posting in english so that our PhD student from india
      knows what's going on currently. And he's had his first german
      lesson today :)




More information about the Dune mailing list