Hi all,

I went through the following post on Stack overflow:
http://stackoverflow.com/questions/6108704/renaming-namespaces

but I have questions on the solution given,

The question mentions about change of namespace from old to _new::nested
for the class because of which any reference to SomeClass in already
existing code will need to adjusted without much work.

So as mentioned in the question one way is to use
namespace old
{
typedef _new::nested::SomeClass Someclass;
}

so that any reference to Someclass in the form of old::Someclass obj;
or as
namespace old
{
Someclass Obj
};

in the CPP file is properly understood.

However in the ideone solution given in the first response to this
question, the declaration of the variable inside int main() is changed to
adjust to this new namespace.I think two here refers to the new namespace
and one to the old.  Is not this slightly impractical since Someclass class
object could be created at multiple places in a huge code base and scoping
each object declaration to adjust to the new namesapce is time
consuming?That way is not the solution mentioned in the question itself
fine since the CPP code where the class is used can be untouched with
Someclass automatically now referring to the updated namespace due to the
typedef?

Am I missing something here?

Arun

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to algogeeks+unsubscr...@googlegroups.com.


Reply via email to