diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPTemplateParameter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPTemplateParameter.java index 1f2e5703894..2f1ef12b6de 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPTemplateParameter.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPTemplateParameter.java @@ -21,11 +21,31 @@ public interface ICPPTemplateParameter extends ICPPBinding { /** * The position of the template parameter is determined by the nesting level of the template - * declaration and the position within the template parameter list. In every context where a - * template parameter can be referenced (i.e. within a template declaration) the parameter - * position is unique. - * - * The position is computed by (nesting-level << 16) + position-in-parameter-list + * declaration and the offset of this parameter within the template parameter list. + * In every context where a template parameter can be referenced (i.e. within a template declaration) + * the parameter position is unique. + *

+ * The nesting level is determined by counting the template declarations that enclose the one that + * declares this parameter. The position is then computed by + * (nesting-level << 16) + position-in-parameter-list. + *

+ * Example: + *

+	 * namespace ns {
+	 *    template class X {       // parameter position: 0x0000
+	 *       template class Y1 {   // parameter position: 0x0100
+	 *       };
+	 *       class Y2 {
+	 *          template typename class Z { // parameter position: 0x0100
+	 *             void m();
+	 *          };  
+	 *       };
+	 *    };
+	 * }
+	 * template                    // parameter position 0x0000
+	 *    template                 // parameter position 0x0100
+	 *       void ns::X::Y2::Z::m() {}
+	 * 
* @since 5.1 */ int getParameterPosition();