Why is there no way to undo 'using' in C++?

Posted by mstearn on Stack Overflow See other posts from Stack Overflow or by mstearn
Published on 2010-07-02T04:57:04Z Indexed on 2012/09/29 3:38 UTC
Read the original article Hit count: 88

Filed under:
|

I've often found myself wanting a way to undo the effect of a using statement or to include all of a namespace (such as std) but exclude a bit to be replaced (such as cout). For some reason this isn't possible. I am wondering if anyone knows why it was decided not to add this ability to the language? Is there some technical reason? I assume it wasn't just forgotten since it doesn't seem slated for C++0x either.

Just to clarify, I'm not looking for workarounds since Google can show me those. I'm looking for an explanation of why this is impossible, and why it was not considered (as far as I can tell) for inclusion in 0x.

© Stack Overflow or respective owner

Related posts about c++

Related posts about c++11