Page MenuHomePhabricator

Namespace "map" in matchpoint causes conflicts
Open, WishlistPublic


This is an issues as soon someone includes the line "using namespace std;"

Event Timeline

Indeed. We should change it to a less error prone alternative.

Open for suggestions ;)

kislinsk lowered the priority of this task from Normal to Wishlist.Oct 26 2017, 9:39 PM
kislinsk added a subscriber: kislinsk.

I wouldn't call it a bug. Name conflicts of this type are not that unusual and usually one can easily get away with using the global namespace explicitly when using std::... all the time isn't an option: write ::map instead of map.

You are right. Let me rephrase it to make it clearer. I see a bug in the MatchPoint code which needs a little treat.

  1. Either one renames the namespace to something highly unlikely to name clashes
  1. or one goes through the MatchPoint code base and ensures that ::map is used everywhere. Currently there are some Headers that just use map including them below some using namespace std makes most of the error.

Second option keeps the namespace (good :), but enforces more namespace discipline on the devloper (I can live with that ;). But there stays a potential fundamental drawback (that we had once): If one uses another thirdparty lib that open using namespace std in its header and you don't want/can patch the whole lib, you are in a mess (or at least extra abstraction coding) if you also want to use MatchPoint. (Yes, from my point of view such an illdesigned namespace spilling lib shouldn't be used anyways ;).

kislinsk claimed this task.
kislinsk added a project: Auto-closed.

Hi there! 🙂

This task was auto-closed according to our Task Lifecycle Management.
Please follow this link for more information and don't forget that you are encouraged to reasonable re-open tasks to revive them. 🚑

Best wishes,
The MITK devs

kislinsk removed kislinsk as the assignee of this task.May 26 2020, 12:05 PM
kislinsk removed a subscriber: kislinsk.