<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: C++ tricks, #6: Explicit template instantiation</title>
	<atom:link href="http://anteru.net/2008/11/19/318/feed/" rel="self" type="application/rss+xml" />
	<link>http://anteru.net/2008/11/19/318/</link>
	<description>Graphics, programming &#38; software engineering</description>
	<lastBuildDate>Fri, 20 Jan 2012 16:35:28 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Code Bloat Hunting &#124; EntBlog</title>
		<link>http://anteru.net/2008/11/19/318/comment-page-1/#comment-19688</link>
		<dc:creator>Code Bloat Hunting &#124; EntBlog</dc:creator>
		<pubDate>Fri, 21 May 2010 15:10:00 +0000</pubDate>
		<guid isPermaLink="false">http://anteru.net/?p=318#comment-19688</guid>
		<description>[...] a solution that although yet not standard seems to work in all compilers we tested: exporting explicit template instantiations. This technique applies when you have a template that is to be instantiated for only a few known [...]</description>
		<content:encoded><![CDATA[<p>[...] a solution that although yet not standard seems to work in all compilers we tested: exporting explicit template instantiations. This technique applies when you have a template that is to be instantiated for only a few known [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anteru</title>
		<link>http://anteru.net/2008/11/19/318/comment-page-1/#comment-12392</link>
		<dc:creator>Anteru</dc:creator>
		<pubDate>Fri, 30 Oct 2009 07:39:38 +0000</pubDate>
		<guid isPermaLink="false">http://anteru.net/?p=318#comment-12392</guid>
		<description>I&#039;d simply compile your test twice, once again DLL1, then again DLL2, and make sure the behaviour is the same. This should be very easy to maintain, and your approach with trying to link in twice the same will be likely a very fragile solution anyway.

However, I&#039;m not sure why you need &lt;em&gt;two&lt;/em&gt; tests anyway, as your explicit instantiation uses the same code as the template generated path, so you could just as well verify that one version works (instantiated or not), and the other should be fine as well.

Adding a namespace during linking is not possible (as far as I know.)</description>
		<content:encoded><![CDATA[<p>I&#8217;d simply compile your test twice, once again DLL1, then again DLL2, and make sure the behaviour is the same. This should be very easy to maintain, and your approach with trying to link in twice the same will be likely a very fragile solution anyway.</p>
<p>However, I&#8217;m not sure why you need <em>two</em> tests anyway, as your explicit instantiation uses the same code as the template generated path, so you could just as well verify that one version works (instantiated or not), and the other should be fine as well.</p>
<p>Adding a namespace during linking is not possible (as far as I know.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter L</title>
		<link>http://anteru.net/2008/11/19/318/comment-page-1/#comment-12362</link>
		<dc:creator>Peter L</dc:creator>
		<pubDate>Thu, 29 Oct 2009 19:49:55 +0000</pubDate>
		<guid isPermaLink="false">http://anteru.net/?p=318#comment-12362</guid>
		<description>Ive tried explicit templated function instantiation, doesn&#039;t seem to work.
Thats Ok....I&#039;ve moved on it was easy enough to make the function into a class, and in the longer my code need that to happen any way..

   While your example got me far enough along to mange to figure out what really needed to happen to make things work under both MinGW g++ as well a MS_VC++ 10 Beta 2....

   I ran into a fair amount still needing to be addressed if one is to support both &quot;C&quot; functions as well as &quot;C++&quot; classes inthe same DLL...
With some messing around, I&#039;ve got a clean fully functional version of your example code, that compiles without adjustment under both tool chains.... send me an EMail so I know how to send you a zip file containing the updated example.

   Currently I seem to be faced with a DLL nameSpace g++, VC++ linking chalange.   I have two DLLs Thing_ref.dll and Thing_underTest.dll,
they both have the same header file, as there inerfaces are the same......   I&#039;m wanting to include both in a cross validation suit.

namespace ref  { #include &quot;Thing.hpp&quot; }
namespace test { #include &quot;Thing.hpp&quot; }

   That part should work just fine, one should be able to then invoke each in via there corresponding name space prefixes ref:: and test::..

   the problem come at link time, I have looked for but have not yet found any linker options  that would allow the symbols of a given DLL
one is linking with to be enclosed within a link time specified nameSpace during the DLL&#039;s loading process..

   I realize I may be asking for o much here, but how else can one side by side test two DLLs with identical interfaces against each other??

   Any ideas ??

    all the best
       -Peter</description>
		<content:encoded><![CDATA[<p>Ive tried explicit templated function instantiation, doesn&#8217;t seem to work.<br />
Thats Ok&#8230;.I&#8217;ve moved on it was easy enough to make the function into a class, and in the longer my code need that to happen any way..</p>
<p>   While your example got me far enough along to mange to figure out what really needed to happen to make things work under both MinGW g++ as well a MS_VC++ 10 Beta 2&#8230;.</p>
<p>   I ran into a fair amount still needing to be addressed if one is to support both &#8220;C&#8221; functions as well as &#8220;C++&#8221; classes inthe same DLL&#8230;<br />
With some messing around, I&#8217;ve got a clean fully functional version of your example code, that compiles without adjustment under both tool chains&#8230;. send me an EMail so I know how to send you a zip file containing the updated example.</p>
<p>   Currently I seem to be faced with a DLL nameSpace g++, VC++ linking chalange.   I have two DLLs Thing_ref.dll and Thing_underTest.dll,<br />
they both have the same header file, as there inerfaces are the same&#8230;&#8230;   I&#8217;m wanting to include both in a cross validation suit.</p>
<p>namespace ref  { #include &#8220;Thing.hpp&#8221; }<br />
namespace test { #include &#8220;Thing.hpp&#8221; }</p>
<p>   That part should work just fine, one should be able to then invoke each in via there corresponding name space prefixes ref:: and test::..</p>
<p>   the problem come at link time, I have looked for but have not yet found any linker options  that would allow the symbols of a given DLL<br />
one is linking with to be enclosed within a link time specified nameSpace during the DLL&#8217;s loading process..</p>
<p>   I realize I may be asking for o much here, but how else can one side by side test two DLLs with identical interfaces against each other??</p>
<p>   Any ideas ??</p>
<p>    all the best<br />
       -Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anteru</title>
		<link>http://anteru.net/2008/11/19/318/comment-page-1/#comment-12280</link>
		<dc:creator>Anteru</dc:creator>
		<pubDate>Tue, 27 Oct 2009 17:42:34 +0000</pubDate>
		<guid isPermaLink="false">http://anteru.net/?p=318#comment-12280</guid>
		<description>I&#039;m not sure it&#039;s going to work for functions, but my gut feeling is that it should. Syntax should be the same, just leave out the class and add () ;) If you get it working, don&#039;t hesitate to comment; I&#039;d also like to see where this could be useful :)</description>
		<content:encoded><![CDATA[<p>I&#8217;m not sure it&#8217;s going to work for functions, but my gut feeling is that it should. Syntax should be the same, just leave out the class and add () <img src='http://anteru.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  If you get it working, don&#8217;t hesitate to comment; I&#8217;d also like to see where this could be useful <img src='http://anteru.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter L</title>
		<link>http://anteru.net/2008/11/19/318/comment-page-1/#comment-12275</link>
		<dc:creator>Peter L</dc:creator>
		<pubDate>Tue, 27 Oct 2009 16:31:19 +0000</pubDate>
		<guid isPermaLink="false">http://anteru.net/?p=318#comment-12275</guid>
		<description>Anteru -
    Thanks for the very concise C++ tricks # example! 
I just got your explicit templated class instantiation in a DLL code up and running via g++ (gcc) 3.4.5 (mingw-vista special r3) running XP SP2.

    It works great for explicitly instantiating templated classes,
Originally I was attempting to explicitly instantiate a templated FUNCTION, as opposed to a class...   I attempted to do likewise with a templatised Function def, but I guess the required syntax is a bit over my head..   is this capability supported also for function instantiation in a DLL, or perhaps one need to convert it to a static class method??</description>
		<content:encoded><![CDATA[<p>Anteru -<br />
    Thanks for the very concise C++ tricks # example!<br />
I just got your explicit templated class instantiation in a DLL code up and running via g++ (gcc) 3.4.5 (mingw-vista special r3) running XP SP2.</p>
<p>    It works great for explicitly instantiating templated classes,<br />
Originally I was attempting to explicitly instantiate a templated FUNCTION, as opposed to a class&#8230;   I attempted to do likewise with a templatised Function def, but I guess the required syntax is a bit over my head..   is this capability supported also for function instantiation in a DLL, or perhaps one need to convert it to a static class method??</p>
]]></content:encoded>
	</item>
</channel>
</rss>

