A point from ISO draft n3290 section 3.3.9 paragraph 4:
The declarative region of the name of a template parameter is nested within the
immediately-enclosing declarative
region.[Note: As a result, a
template-parameter hides any entity
with the same name in an enclosing
scope (3.3.10).
Example:
typedef int N;
template<N X, typename N, template<N Y> class T> struct A;
Can any one please ….tell some other example other than this ..where & where this situation erises
draft link n3290: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3290.pdf
I think it is quite obvious: any time that an entity in the scope of the template declaration has the same name as one of the template parameters, the name will be hidden within the template. If you are having problems coming up with examples chances are that you did not understand the meaning of the quote. What is it that you understood? What is it that you have troubles understanding?
Also for those that don’t want to go into the standard, it is important to complete the original quote:
Which helps understanding the example. Note what the quote means: the first
Nrefers to thetypedefat the namespace scope, then a template argumentNis introduced. From there on, the template argument hides the outerN, and the next appearance ofNrefers to the template argument and not to the outerN(only within the declarative scope of the template)