Hello everyone,
I have made some study on this. Here is something I found confused.
http://womble.decadentplace.org.uk/c++/template-faq.html#dependent
--------------------
What are dependent names?
A: Dependent names are names whose definitions are considered to depend upon the template parameters and for which there is no declaration within the template definition. They are resolved only when the template is instantiated. Those that are intended to refer to types or templates may require disambiguation.
If the resolution of a dependent function name uses argument-dependent lookup, declarations in the arguments' namespaces that are visible at the point of instantiation will be considered as well as declarations visible at the point of definition. (The former is normally a superset of the latter, but may not be.)
--------------------
Two confusions,
1. What means " for which there is no declaration within the template definition"?
2. What means "declarations in the arguments' namespaces that are visible at the point of instantiation will be considered as well as declarations visible at the point of definition."?
Could you show some pseudo code please?
BTW: I feel I lack some knowledge of template programming in-depth even if I use STL template everyday. I tried ti read appendix C for Bjarne's book, and it contains more confusing terms about dependent names (e.g. section C.13.8.1).
regards,
George
I have made some study on this. Here is something I found confused.
http://womble.decadentplace.org.uk/c++/template-faq.html#dependent
--------------------
What are dependent names?
A: Dependent names are names whose definitions are considered to depend upon the template parameters and for which there is no declaration within the template definition. They are resolved only when the template is instantiated. Those that are intended to refer to types or templates may require disambiguation.
If the resolution of a dependent function name uses argument-dependent lookup, declarations in the arguments' namespaces that are visible at the point of instantiation will be considered as well as declarations visible at the point of definition. (The former is normally a superset of the latter, but may not be.)
--------------------
Two confusions,
1. What means " for which there is no declaration within the template definition"?
2. What means "declarations in the arguments' namespaces that are visible at the point of instantiation will be considered as well as declarations visible at the point of definition."?
Could you show some pseudo code please?
BTW: I feel I lack some knowledge of template programming in-depth even if I use STL template everyday. I tried ti read appendix C for Bjarne's book, and it contains more confusing terms about dependent names (e.g. section C.13.8.1).
regards,
George