<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 25, 2013 at 12:35 PM, Dmitri Gribenko <span dir="ltr"><<a href="mailto:gribozavr@gmail.com" target="_blank">gribozavr@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">You might want to examine the layout of an instantiation instead.</blockquote>
</div><br>Okay, that makes sense.  I can drive this from a CXXRecordDecl visitor, something like:<br><br><div class="gmail_extra">bool VisitCXXRecordDecl( CXXRecordDecl * r )</div><div class="gmail_extra">{</div><div class="gmail_extra">
   if ( r->isThisDeclarationADefinition() )</div><div class="gmail_extra">   {</div><div class="gmail_extra">      for ( CXXRecordDecl::field_iterator b = r->field_begin(), e = r->field_end() ;</div><div class="gmail_extra">
            b != e ; ++b )</div><div class="gmail_extra">      {</div><div class="gmail_extra">         const FieldDecl * a = *b ;</div><div class="gmail_extra"><br></div><div class="gmail_extra">         myVisitFieldDecl( a ) ;</div>
<div class="gmail_extra">      }</div><div class="gmail_extra">   }</div><div class="gmail_extra"><br></div><div class="gmail_extra">   return true ;</div><div class="gmail_extra">}</div><div><br></div><div>I found getInstantiatedFromMemberClass() in the docs, and it appears I can use this to see if the template is an instantiation.  However I'm having trouble figuring out how to tell if the CXXRecordDecl is a template or not (since I want to visit the fields of all instantanted template class decls and all the fields of the plain old non-template classes).<br>
<br>I don't see a isTemplateClass() or anything like that?  How would such a check be done?</div><span style="color:rgb(0,0,0);font-family:Verdana,Geneva,Arial,Helvetica,sans-serif;font-size:13px;background-color:rgb(250,250,250)"><br>
</span>-- <br>Peeter
</div></div>