[Qt-creator] Supporting code completation for templated class with default template parameter type

علی موسوی a.mosawi99 at mailfa.com
Thu Mar 14 11:26:32 CET 2019

<p dir="ltr">suppouse following code</p>
<p dir="ltr"> </p>
<p dir="ltr">class AClass {</p>
<p dir="ltr">   int a;</p>
<p dir="ltr">};</p>
<p dir="ltr"> </p>
<p dir="ltr">template<typename T = AClass></p>
<p dir="ltr">class BClass{</p>
<p dir="ltr">   BClass(){</p>
<p dir="ltr">      t.a = 0;  /* Code Completation should know the default T is AClass and show members of AClass */</p>
<p dir="ltr">   }</p>
<p dir="ltr">   T t;</p>
<p dir="ltr">};</p>
<p dir="ltr"> </p>
<p dir="ltr">When the the default type for T is specified, i think its possible and good to show members of default type (AClass) when writing t.</p>
<p dir="ltr">In QtCreators internal codemodel its possible and working as long as we name the template parameter T as AClass :</p>
<p dir="ltr">template<typename AClass></p>
<p dir="ltr">....</p>
<p dir="ltr"> </p>
<p dir="ltr">but in clang code model this doesn't happen at all ( and i think its correct )</p>
<p dir="ltr">does the clang is correct and internal one is broken or clang lack of supporting something like this and internal one does?</p>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20190314/1e1b234c/attachment.html>

More information about the Qt-creator mailing list