<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jun 6, 2016 at 9:12 AM, David Thompson <span dir="ltr"><<a href="mailto:david.thompson@kitware.com" target="_blank">david.thompson@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="auto"><div></div><div><br></div><div>1. I assume that attributes are allowed prior to function parameters... from the spec it was not immediately obvious. For example, what about this method:</div><div><br></div><div>VTK_SIZEHINT(sz) double* findOrAddEntries(</div><div>    int key, int sz, VTK_SIZEHINT(sz) double* vals);</div><div><br></div><div>that both accepts and returns a variable-length array (of length sz, one of the other parameters)?</div></div></blockquote><div><br></div><div>Yes, the hints can be used in either location.  The hint attaches to the type.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="auto"><div>2. Would you put them in the declaration or implementation? I have a mild preference for the implementation so that the declaration is short and easy to skim.</div></div></blockquote><div><br></div><div>The wrappers only see the declaration.  They never see the .cxx file.</div><div> </div><div><br></div><div>On Mon, Jun 6, 2016 at 9:13 AM, Brad King <span dir="ltr"><<a href="mailto:brad.king@kitware.com" target="_blank">brad.king@kitware.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span class=""><br></span>Neat.  I suggest using a prefix like `VTK_HINT_` for all such macros,<br>and corresponding attribute names with a prefix like `vtk::hint::`.<br>That will reserve space for other attributes to be added later for<br>reasons other than hints.</blockquote><div><br></div><div>My preference is for "VTK_SIZEHINT" because it's easier to say... I can</div><div>ask Joe in the cubicle next me me "Hey Joe, what's the size hint for</div><div>that method?"  In comparison, "VTK_HINT_SIZE" just doesn't roll off</div><div>the tongue.  In all seriousness, though, I'll go with the latter if people</div><div>feel it's the better choice.</div><div><br></div><div>Regarding "vtk::hint::", in C++ Section 7.6.1 "Attribute syntax and</div><div>semantics", the grammar does not allow more than one "::".  Apparently</div><div>attribute namespaces cannot be nested.</div><div><br></div><div><br></div><div><br class="">On Mon, Jun 6, 2016 at 10:03 AM, David Lonie <span dir="ltr"><<a href="mailto:david.lonie@kitware.com" target="_blank">david.lonie@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">+1 to the idea and Brad's suggestion!<br></div></blockquote><div><br></div><div>Grumble.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Does this sort of pattern occur in VTK a lot? AIUI, the current hints file only allows fixed-length arrays and is not dependent on other variables to get the size.</div></div></div></div></blockquote><div><br></div><div>We want to allow more flexibility than what the current hints file offers.</div><div>For example, sometimes a size hint should refer to one of the object's</div><div>methods or even to one of the other parameters:</div></div></div><div><br></div><div>    void InsertNextCell(int npts, VTK_SIZEHINT(npts) vtkIdType* conn)</div><div><br></div><div>    void SetTuple(VTK_SIZEHINT(GetNumberOfComponents()) double* tuple);</div><div><br></div><div>Ideally, the size hint could be an expression that would be evaluated to</div><div>compute the size.  There would be some limitations, of course, but</div><div>there are tons of possibilities.</div><div><br></div><div> - David</div><div><br></div><div><br></div><div><br></div><div><br></div></div></div></div>