<?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: Solved undesired template specification</title>
	<atom:link href="http://limegarden.net/2010/04/07/solved-undesired-template-specification/feed/" rel="self" type="application/rss+xml" />
	<link>http://limegarden.net/2010/04/07/solved-undesired-template-specification/</link>
	<description>Personal site of Wouter Lindenhof</description>
	<lastBuildDate>Tue, 17 Jan 2012 21:32:07 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Wouter Lindenhof</title>
		<link>http://limegarden.net/2010/04/07/solved-undesired-template-specification/comment-page-1/#comment-111</link>
		<dc:creator>Wouter Lindenhof</dc:creator>
		<pubDate>Thu, 08 Apr 2010 07:24:27 +0000</pubDate>
		<guid isPermaLink="false">http://limegarden.net/?p=304#comment-111</guid>
		<description>&lt;blockquote cite=&quot;#commentbody-107&quot;&gt;
&lt;strong&gt;&lt;a href=&quot;#comment-107&quot; rel=&quot;nofollow&quot;&gt;Arseny Kapoulkine&lt;/a&gt; :&lt;/strong&gt;
          &lt;P&gt;Uh, blog software ate all my braces. Trying again:&lt;/P&gt;
&lt;P&gt;Q: Why don’t you define a Vector4 ctor? like that:&lt;/P&gt;
&lt;DIV class=&quot;codecolorer-container text geshi&quot; style=&quot;overflow:auto;white-space:nowrap;&quot;&gt;&lt;TABLE cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class=&quot;line-numbers&quot;&gt;&lt;DIV&gt;1&lt;BR&gt;2&lt;BR&gt;3&lt;BR&gt;4&lt;BR&gt;&lt;/DIV&gt;&lt;/TD&gt;&lt;TD&gt;&lt;DIV class=&quot;text codecolorer&quot; style=&quot;white-space:nowrap&quot;&gt;template &lt;typename T&gt; struct Vector4&lt;BR&gt;
{&lt;BR&gt;
    template &lt;typename U&gt; explicit Vector4(const Vector3&lt;U&gt;&amp; v, float w = 1) { ... } /* or without default value if you like */&lt;BR&gt;
};&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;
         &lt;/blockquote&gt;
I tried that but I prefer the above for multiple reasons:
1. It means that I need to create a constructor that does Vector3 and Vector2, which  means that Vector3 and Vector4 need to be defined (but not declared) at that point.
2. Not all data that is delivered is my custom Vector class, sometimes (when using an external library for physics for example) you have a different type.
3. In general it&#039;s less work ;)

Of course, the last reason was the most important reason. The results are virtually the same, although yours look nicer, but those can always be added at a later stage.</description>
		<content:encoded><![CDATA[<blockquote cite="#commentbody-107"><p>
<strong><a href="#comment-107" rel="nofollow">Arseny Kapoulkine</a> :</strong></p>
<p>Uh, blog software ate all my braces. Trying again:</p>
<p>Q: Why don’t you define a Vector4 ctor? like that:</p>
<div class="codecolorer-container text geshi" style="overflow:auto;white-space:nowrap;">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="line-numbers">
<div>1<br />2<br />3<br />4</div>
</td>
<td>
<div class="text codecolorer" style="white-space:nowrap">template &lt;typename T&gt; struct Vector4<br />
{<br />
    template &lt;typename U&gt; explicit Vector4(const Vector3&lt;U&gt;&amp; v, float w = 1) { &#8230; } /* or without default value if you like */<br />
};</div>
</td>
</tr>
</tbody>
</table>
</div>
</blockquote>
<p>I tried that but I prefer the above for multiple reasons:<br />
1. It means that I need to create a constructor that does Vector3 and Vector2, which  means that Vector3 and Vector4 need to be defined (but not declared) at that point.<br />
2. Not all data that is delivered is my custom Vector class, sometimes (when using an external library for physics for example) you have a different type.<br />
3. In general it&#8217;s less work <img src='http://limegarden.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Of course, the last reason was the most important reason. The results are virtually the same, although yours look nicer, but those can always be added at a later stage.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arseny Kapoulkine</title>
		<link>http://limegarden.net/2010/04/07/solved-undesired-template-specification/comment-page-1/#comment-107</link>
		<dc:creator>Arseny Kapoulkine</dc:creator>
		<pubDate>Wed, 07 Apr 2010 18:20:56 +0000</pubDate>
		<guid isPermaLink="false">http://limegarden.net/?p=304#comment-107</guid>
		<description>Uh, blog software ate all my braces. Trying again:

Q: Why don&#039;t you define a Vector4 ctor? like that:
&lt;code&gt;
template &lt;typename T&gt; struct Vector4
{
    template &lt;typename U&gt; explicit Vector4(const Vector3&lt;U&gt;&amp; v, float w = 1) { ... } /* or without default value if you like */
};
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Uh, blog software ate all my braces. Trying again:</p>
<p>Q: Why don&#8217;t you define a Vector4 ctor? like that:<br />
<code><br />
template <typename T> struct Vector4<br />
{<br />
    template </typename><typename U> explicit Vector4(const Vector3<u>&#038; v, float w = 1) { ... } /* or without default value if you like */<br />
};<br />
</u></typename></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arseny Kapoulkine</title>
		<link>http://limegarden.net/2010/04/07/solved-undesired-template-specification/comment-page-1/#comment-106</link>
		<dc:creator>Arseny Kapoulkine</dc:creator>
		<pubDate>Wed, 07 Apr 2010 18:19:29 +0000</pubDate>
		<guid isPermaLink="false">http://limegarden.net/?p=304#comment-106</guid>
		<description>Q: Why don&#039;t you define a Vector4 ctor? like that:

template  struct Vector4
{
    template  explicit Vector4(const Vector3&amp; v, float w = 1) { ... } /* or without default value if you like */
};</description>
		<content:encoded><![CDATA[<p>Q: Why don&#8217;t you define a Vector4 ctor? like that:</p>
<p>template  struct Vector4<br />
{<br />
    template  explicit Vector4(const Vector3&amp; v, float w = 1) { &#8230; } /* or without default value if you like */<br />
};</p>
]]></content:encoded>
	</item>
</channel>
</rss>

