|
[Rivet] Bug: namespace and include pollution in Rivet namespace (minor)Andy Buckley andy.buckley at cern.chTue Sep 30 10:02:34 BST 2014
On 30/09/14 09:47, David Grellscheid wrote: > >>> 2. assert() can be used without "#include <cassert>" >> >> Is that a bad thing? We include it in Rivet/Tools/RivetSTL.hh, along >> with the various "using std::*". User convenience again. The header >> chain needs to be cleaned up (any good tools to help with disentangling >> #include messes?) but that's a separate issue. > > Here I agree with David. Since assert() is a macro controlled at compile > time by NDEBUG, it cannot be safely used in header files anyway. Every > .cc that needs must include it locally itself. Ah, I see. I've come to the conclusion that assert is a real mess precisely because of that (maybe inconsistent) compile time en/disabling. And hard fails are rarely nice: I've been replacing asserts with exceptions in many places in YODA. Anyway, it's something to fix but should not be a release blocker. I checked and we have quite a lot of uses of assert() in headers -- more than a quick fix, certainly. Perhaps we should provide our own definition of it (or a RIVET_ASSERT), to bypass the NDEBUG issue... just a thought. Andy -- Dr Andy Buckley, Royal Society University Research Fellow Particle Physics Expt Group, University of Glasgow / PH Dept, CERN
More information about the Rivet mailing list |