<?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: 14.4 &#8212; Expression parameters and template specialization</title>
	<atom:link href="http://www.learncpp.com/cpp-tutorial/144-expression-parameters-and-template-specialization/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.learncpp.com/cpp-tutorial/144-expression-parameters-and-template-specialization/</link>
	<description></description>
	<lastBuildDate>Thu, 09 Sep 2010 12:59:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: jp</title>
		<link>http://www.learncpp.com/cpp-tutorial/144-expression-parameters-and-template-specialization/comment-page-1/#comment-89339</link>
		<dc:creator>jp</dc:creator>
		<pubDate>Sat, 31 Jul 2010 06:42:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=207#comment-89339</guid>
		<description>for 5th code block
&lt;pre&gt;
    // Store the name
    Storage&lt;char*&gt; strValue(strString);
 
    // Delete the temporary string
    delete strString;
&lt;/pre&gt;

shouldn&#039;t it be delete[] since strString is dynamically allocated c style string..</description>
		<content:encoded><![CDATA[<p>for 5th code block</p>
<pre>
    // Store the name
    Storage&lt;char*&gt; strValue(strString);

    // Delete the temporary string
    delete strString;
</pre>
<p>shouldn&#8217;t it be delete[] since strString is dynamically allocated c style string..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: C++ Tutorial and Online Ebook</title>
		<link>http://www.learncpp.com/cpp-tutorial/144-expression-parameters-and-template-specialization/comment-page-1/#comment-87418</link>
		<dc:creator>C++ Tutorial and Online Ebook</dc:creator>
		<pubDate>Wed, 30 Jun 2010 01:01:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=207#comment-87418</guid>
		<description>[...] 14.4 Expression parameters and template specialization [...]</description>
		<content:encoded><![CDATA[<p>[...] 14.4 Expression parameters and template specialization [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SUN</title>
		<link>http://www.learncpp.com/cpp-tutorial/144-expression-parameters-and-template-specialization/comment-page-1/#comment-86794</link>
		<dc:creator>SUN</dc:creator>
		<pubDate>Sat, 19 Jun 2010 06:12:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=207#comment-86794</guid>
		<description>Hi Alex,

Thanks a lot for the tutorial.

The code  below 
26	    for (int nCount=11; nCount &gt;= 0; nCount--)

should be 

26	    for (nCount=11; nCount &gt;= 0; nCount--)

To avoid error ncount&#039; : redefinition; multiple initialization during compilation.

Thanks
SUN</description>
		<content:encoded><![CDATA[<p>Hi Alex,</p>
<p>Thanks a lot for the tutorial.</p>
<p>The code  below<br />
26	    for (int nCount=11; nCount &gt;= 0; nCount&#8211;)</p>
<p>should be </p>
<p>26	    for (nCount=11; nCount &gt;= 0; nCount&#8211;)</p>
<p>To avoid error ncount&#8217; : redefinition; multiple initialization during compilation.</p>
<p>Thanks<br />
SUN</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: webbnh</title>
		<link>http://www.learncpp.com/cpp-tutorial/144-expression-parameters-and-template-specialization/comment-page-1/#comment-77927</link>
		<dc:creator>webbnh</dc:creator>
		<pubDate>Fri, 05 Feb 2010 19:48:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=207#comment-77927</guid>
		<description>In your concluding sentence, I don&#039;t think you want a tilde before the type name.

(Nevertheless, I, too, think this tutorial is great, and I refer to it constantly.  Thanks!)</description>
		<content:encoded><![CDATA[<p>In your concluding sentence, I don&#8217;t think you want a tilde before the type name.</p>
<p>(Nevertheless, I, too, think this tutorial is great, and I refer to it constantly.  Thanks!)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cuacharpanas</title>
		<link>http://www.learncpp.com/cpp-tutorial/144-expression-parameters-and-template-specialization/comment-page-1/#comment-77432</link>
		<dc:creator>Cuacharpanas</dc:creator>
		<pubDate>Fri, 29 Jan 2010 22:19:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=207#comment-77432</guid>
		<description>May be it is a compiler issue because if i don&#039;t use template followed by the angled brackets before the line Storage::Print() then the compiler (Borland C++ 5.5.1 for Win32) tells: Explicit especialization of &#039;void Storage::Print()&#039; requires &#039;template&#039; declaration. Its stressing that some syntax have to depend on the compiler used.</description>
		<content:encoded><![CDATA[<p>May be it is a compiler issue because if i don&#8217;t use template followed by the angled brackets before the line Storage::Print() then the compiler (Borland C++ 5.5.1 for Win32) tells: Explicit especialization of &#8216;void Storage::Print()&#8217; requires &#8216;template&#8217; declaration. Its stressing that some syntax have to depend on the compiler used.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MD AZAD ALI SHAH</title>
		<link>http://www.learncpp.com/cpp-tutorial/144-expression-parameters-and-template-specialization/comment-page-1/#comment-74045</link>
		<dc:creator>MD AZAD ALI SHAH</dc:creator>
		<pubDate>Fri, 11 Dec 2009 08:25:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=207#comment-74045</guid>
		<description>Now, let’s say we want double values to output in scientific notation. To do so, we will need to use template specialization to create a specialized version of the Print() function for doubles. This is extremely simple: simply define the specialized function outside of the class definition, replacing the template type with the specific type you wish to redefine the function for. Here is our specialized Print() function for doubles:

&lt;pre&gt;
1.void Storage&lt;double&gt;::Print() 
2.{ 
3.    
std::cout &lt;&lt; std::scientific &lt;&lt; m_tValue &lt;&lt; std::endl; 
4.}
&lt;/pre&gt;

-----------------------------------
Hi Alex,

Can it be :
&lt;pre&gt;
  template&lt;&gt;
1.void Storage&lt;double&gt;::Print() 
2.{ 
3.    
std::cout &lt;&lt; std::scientific &lt;&lt; m_tValue &lt;&lt; std::endl; 
4.}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Now, let’s say we want double values to output in scientific notation. To do so, we will need to use template specialization to create a specialized version of the Print() function for doubles. This is extremely simple: simply define the specialized function outside of the class definition, replacing the template type with the specific type you wish to redefine the function for. Here is our specialized Print() function for doubles:</p>
<pre>
1.void Storage&lt;double&gt;::Print()
2.{
3.
std::cout &lt;&lt; std::scientific &lt;&lt; m_tValue &lt;&lt; std::endl;
4.}
</pre>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Hi Alex,</p>
<p>Can it be :</p>
<pre>
  template&lt;&gt;
1.void Storage&lt;double&gt;::Print()
2.{
3.
std::cout &lt;&lt; std::scientific &lt;&lt; m_tValue &lt;&lt; std::endl;
4.}
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: MD AZAD ALI SHAH</title>
		<link>http://www.learncpp.com/cpp-tutorial/144-expression-parameters-and-template-specialization/comment-page-1/#comment-74044</link>
		<dc:creator>MD AZAD ALI SHAH</dc:creator>
		<pubDate>Fri, 11 Dec 2009 08:19:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=207#comment-74044</guid>
		<description>Hi Alex,

Thanks a lot for the awsome tutorial. Its really wonderful.
Just a small doubt. You say above-

&quot;Template classes (not template functions) can make use of another kind of template parameter known as an expression parameter.&quot;

I think expression parameter can be used for Temple functions as well.
You also did same in 14.6 chapter in one of the example:-

&lt;pre&gt;
1.template&lt;int nSize&gt; 
2.void PrintBufferString(Buffer&lt;char, nSize&gt; &amp;rcBuf) 
3.{ 
4.    
std::cout &lt;&lt; rcBuf.GetBuffer() &lt;&lt; std::endl; 
5.}
&lt;/pre&gt;


Warm Rgds,
Muhammad Azad Ali Shah</description>
		<content:encoded><![CDATA[<p>Hi Alex,</p>
<p>Thanks a lot for the awsome tutorial. Its really wonderful.<br />
Just a small doubt. You say above-</p>
<p>&#8220;Template classes (not template functions) can make use of another kind of template parameter known as an expression parameter.&#8221;</p>
<p>I think expression parameter can be used for Temple functions as well.<br />
You also did same in 14.6 chapter in one of the example:-</p>
<pre>
1.template&lt;int nSize&gt;
2.void PrintBufferString(Buffer&lt;char, nSize&gt; &amp;rcBuf)
3.{
4.
std::cout &lt;&lt; rcBuf.GetBuffer() &lt;&lt; std::endl;
5.}
</pre>
<p>Warm Rgds,<br />
Muhammad Azad Ali Shah</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Specialising C++ Templates &#124; Brenton Thomas</title>
		<link>http://www.learncpp.com/cpp-tutorial/144-expression-parameters-and-template-specialization/comment-page-1/#comment-36560</link>
		<dc:creator>Specialising C++ Templates &#124; Brenton Thomas</dc:creator>
		<pubDate>Tue, 06 Jan 2009 01:01:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=207#comment-36560</guid>
		<description>[...] and elements.  A more readable description of how to do template specialisation can be found here.  The quick summary is [...]</description>
		<content:encoded><![CDATA[<p>[...] and elements.  A more readable description of how to do template specialisation can be found here.  The quick summary is [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: M.N. Jayaram</title>
		<link>http://www.learncpp.com/cpp-tutorial/144-expression-parameters-and-template-specialization/comment-page-1/#comment-34858</link>
		<dc:creator>M.N. Jayaram</dc:creator>
		<pubDate>Thu, 18 Dec 2008 05:13:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=207#comment-34858</guid>
		<description>Hi

A small typo. In the class Buffer the first comment has &#039;side&#039; of array instead of &#039;size&#039;.

Not nitpicking, just pointing!

[ Thanks for letting me know!  -Alex ]</description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>A small typo. In the class Buffer the first comment has &#8217;side&#8217; of array instead of &#8217;size&#8217;.</p>
<p>Not nitpicking, just pointing!</p>
<p>[ Thanks for letting me know!  -Alex ]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gswrg</title>
		<link>http://www.learncpp.com/cpp-tutorial/144-expression-parameters-and-template-specialization/comment-page-1/#comment-31895</link>
		<dc:creator>gswrg</dc:creator>
		<pubDate>Mon, 10 Nov 2008 11:03:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.learncpp.com/?p=207#comment-31895</guid>
		<description>Hi Alex,

great tutorial. Thanks a lot.

First example in line 11 should read

&lt;pre&gt; T&amp; operator[](int nIndex)   &lt;!--formatted--&gt;&lt;/pre&gt;

instead of

&lt;pre&gt; int&amp; operator[](int nIndex)   &lt;!--formatted--&gt;&lt;/pre&gt;

[ Yes, thank you.  -Alex ]</description>
		<content:encoded><![CDATA[<p>Hi Alex,</p>
<p>great tutorial. Thanks a lot.</p>
<p>First example in line 11 should read</p>
<pre> T&amp; operator[](int nIndex)   <!--formatted--></pre>
<p>instead of</p>
<pre> int&amp; operator[](int nIndex)   <!--formatted--></pre>
<p>[ Yes, thank you.  -Alex ]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
