Project

General

Profile

Design #1295

Never use "using namespace .." in header files

Added by Anna Maria Bigatti almost 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Urgent
Assignee:
Category:
Portability
Start date:
07 Jun 2019
Due date:
% Done:

100%

Estimated time:
1.11 h
Spent time:

Description

Make sure that "using namespace..", "nor "using .." is never used in .H files.

History

#1 Updated by Anna Maria Bigatti almost 5 years ago

From Gereon Kremer:
"We recently had some "interesting" experiences with using namespace
directives. I would guess that you are aware that "using namespace std;"
should not be put in the anonymous namespace in headers as it can have
interesting effects on libraries that include them.

This caused problems recently here and I thus eliminated a few remaining
places our code did this. However I also noticed that CoCoALib still
does this as well in a few places... could you fix this at some point?

A quick grep revealed those:
include/CoCoA/TmpUniversalInvolutiveBasisContainer.H:28: using
namespace std;
include/CoCoA/TmpStabilityAlgorithm.H:24:using namespace std;
include/CoCoA/BenchmarkToolkit.H:136: using namespace std;
include/CoCoA/TmpPBMill.H:28: using namespace std;

(Though some only do this inside of some CoCoA-namespace which should be
fine, but at least TmpStabilityAlgorithm.H does it outside of any
namespace...)
"

#2 Updated by John Abbott almost 5 years ago

  • Status changed from New to In Progress
  • Priority changed from Normal to Urgent

I'll try to sort this out ASAP. Hope it won't be too "exciting" (the original author probably cannot be contacted any more).

#3 Updated by John Abbott over 4 years ago

  • Status changed from In Progress to Closed
  • Assignee set to John Abbott
  • Target version changed from CoCoALib-0.99700 to CoCoALib-0.99650 November 2019
  • % Done changed from 10 to 100
  • Estimated time set to 1.11 h

I must have done this some time ago; no doubt shortly after it was reported.

I have just removed some using namespace std; from all *.C files in AlgebraicCore.
Will test and check in shortly.

Also available in: Atom PDF