<div dir="ltr">Thanks Berk, David.<div><br></div><div>I'll move forward with restricting VTK_USE_EXTERN_TEMPLATE to c++11 builds.  When I get around to modifying the existing AOS/SOA extern template declarations, I'll ping Brad from the MR so that he can double-check my work.</div><div><br></div><div> - David</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 1, 2016 at 11:41 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:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On Thu, Sep 1, 2016 at 1:18 PM, David Gobbi <<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>> wrote:<br>
</span><span class="gmail-">> Hi David,<br>
><br>
> You've been playing around with the "extern template" stuff for longer than<br>
> I have, so I'm wondering if you can share some experience.<br>
<br>
</span>The extent of my understanding of this syntax is that means a<br>
particular template instantiation will be available at link time, and<br>
thus doesn't need to be compiled into the current translation unit.<br>
<span class="gmail-"><br>
> It seems that restricting "extern template" to MSVC 2015 and up would reduce<br>
> or eliminate the need for "#pragma warning".  Would it be a bad thing if we<br>
> stopped using "extern template" with MSVC 2008, 2010, etc?  The reason that<br>
> I ask is that, as I expand the use of "extern template" to other parts of<br>
> VTK, I don't want to have to add "#pragma warning" every time.<br>
<br>
</span>I think you're talking about the oddities of the MSVC-specific blocks<br>
in AOS/SOADataArrayTemplate, correct? The only practical difference I<br>
notice is that these are also explicitly exported. I'm not entirely<br>
sure the warning pragmas are still necessary on the versions of MSVC<br>
we support.<br>
<br>
Brad (cc'd) might know more, IIRC he originally wrote that block and<br>
tracked down the issues surrounding this.<br>
<span class="gmail-"><br>
> For clang and gcc, I was only planning to use "extern template" when<br>
> -std=c++11 because otherwise clang generates a warning about this being a<br>
> "c++11 feature".<br>
<br>
</span>This sounds reasonable, and might allow us to eliminate the test for<br>
_MINGW_, since I suspect those problems are actually an issue with<br>
older GCC, not necessarily MinGW itself.<br>
<span class="gmail-"><br>
> On the other hand I could bite the bullet and also use "extern template" for<br>
> pre-c++11 builds, and insert pragmas into a whole bunch of source files<br>
> (probably 20 or so) to silence the warnings.<br>
<br>
</span>I'd vote for limiting these to C++11 builds rather than adding pragmas<br>
all over, as long as we can get away with it. I don't think non-C++11<br>
builds would complain about them missing (with the possible exception<br>
of MSVC), and the worst case scenario is a slightly longer compile<br>
time as the templates are emitted in each translation unit (and<br>
subsequently stripped by the linker).<br>
<br>
Dave<br>
</blockquote></div><br></div></div>