<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Channel 9 Forums - Tech Off - Can&#39;t do Func&lt;out char, int&gt; ?</title>
	<atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Forums/rss"></atom:link>
	<image>
		<url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
		<title>Channel 9 Forums - Tech Off - Can&#39;t do Func&lt;out char, int&gt; ?</title>
		<link>http://channel9.msdn.com/Forums</link>
	</image>
	<description>Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with. From LINQ to SilverLight – Watch videos and hear about all the cool technologies coming and the people behind them.</description>
	<link>http://channel9.msdn.com/Forums</link>
	<language>en</language>
	<pubDate>Thu, 23 May 2013 07:40:46 GMT</pubDate>
	<lastBuildDate>Thu, 23 May 2013 07:40:46 GMT</lastBuildDate>
	<generator>Rev9</generator>
	<c9:totalResults>9</c9:totalResults>
	<c9:pageCount>-9</c9:pageCount>
	<c9:pageSize>-1</c9:pageSize>
	<item>
		<title>Tech Off - Can&#39;t do Func&lt;out char, int&gt; ?</title>
		<description><![CDATA[<p>You can't do <b>Func&lt;out char, int&gt;</b> ?<br /><br />Is there a correct syntax for representing a function that takes a reference as a parameter, or is this not allowed?<br /><br /><br /></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/449214-Cant-do-Funcout-char-int-/449214#449214</link>
		<pubDate>Fri, 19 Dec 2008 19:33:56 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/449214-Cant-do-Funcout-char-int-/449214#449214</guid>
		<dc:creator>brian.shapiro</dc:creator>
		<slash:comments>9</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/brian.shapiro/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Can&#39;t do Func&lt;out char, int&gt; ?</title>
		<description><![CDATA[<p>The first parameter of Func&lt;TResult, TArg1&gt; is the return type of the function, so no, you can't do that.
<div><br /></div>
<div>Func&lt;char, int&gt; corresponds to a function with signature</div>
<div><br /></div>
<div>char foo(int parameter) {}</div></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/449214-Cant-do-Funcout-char-int-/264acff21d974440a0b29deb0002abe8#264acff21d974440a0b29deb0002abe8</link>
		<pubDate>Fri, 19 Dec 2008 19:41:38 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/449214-Cant-do-Funcout-char-int-/264acff21d974440a0b29deb0002abe8#264acff21d974440a0b29deb0002abe8</guid>
		<dc:creator>evildictaitor</dc:creator>
		<slash:comments>9</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/evildictaitor/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Can&#39;t do Func&lt;out char, int&gt; ?</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">evildictaitor said:</div><div class="quoteText">The first parameter of Func&lt;TResult, TArg1&gt; is the return type of the function, so no, you can't do that.
<div><br /></div>
<div>Func&lt;char, int&gt; corresponds to a function with signature</div>
<div><br /></div>
<div>char foo(int parameter) {}</div>
</div></blockquote>evildictator,<br /><br />The syntax shown in Visual Studio is Func&lt;T, TResult&gt; where T is a parameter.<br /><br />Either way, it won't let me pass in a type parameter by reference.<br /><br /></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/449214-Cant-do-Funcout-char-int-/35d780843b4b40549d829deb0002ac10#35d780843b4b40549d829deb0002ac10</link>
		<pubDate>Fri, 19 Dec 2008 19:48:17 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/449214-Cant-do-Funcout-char-int-/35d780843b4b40549d829deb0002ac10#35d780843b4b40549d829deb0002ac10</guid>
		<dc:creator>brian.shapiro</dc:creator>
		<slash:comments>9</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/brian.shapiro/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Can&#39;t do Func&lt;out char, int&gt; ?</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">brian.shapiro said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">evildictaitor said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
evildictator,<br /><br />The syntax shown in Visual Studio is Func&lt;T, TResult&gt; where T is a parameter.<br /><br />Either way, it won't let me pass in a type parameter by reference.<br /><br /></div></blockquote>You have the parameter order correct, but you still can't do what you want. The only thing a generic parameter can express is a type. The The parameter direction is defined by the Func&lt;&gt; delegate itself, and you can't change it. Depending on what you're
 trying to do, you can define your own delegate apart from Func&lt;&gt;. Something like this, perhaps:
<div><br /></div>
<blockquote class="webkit-indent-blockquote">public delegate int MyDelegate(out char value);<br /></blockquote>
<div><br /></div>
<div>Actually, I'm not 100% sure the above is valid. An &quot;out&quot; parameter on a delegate may not be valid.</div></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/449214-Cant-do-Funcout-char-int-/16e2414be3f04c8f8f429deb0002ac3a#16e2414be3f04c8f8f429deb0002ac3a</link>
		<pubDate>Fri, 19 Dec 2008 20:39:50 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/449214-Cant-do-Funcout-char-int-/16e2414be3f04c8f8f429deb0002ac3a#16e2414be3f04c8f8f429deb0002ac3a</guid>
		<dc:creator>dpratt71</dc:creator>
		<slash:comments>9</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/dpratt71/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Can&#39;t do Func&lt;out char, int&gt; ?</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">dpratt71 said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">brian.shapiro said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
You have the parameter order correct, but you still can't do what you want. The only thing a generic parameter can express is a type. The The parameter direction is defined by the Func&lt;&gt; delegate itself, and you can't change it. Depending on what you're trying
 to do, you can define your own delegate apart from Func&lt;&gt;. Something like this, perhaps:
<div><br /></div>
<blockquote class="webkit-indent-blockquote">public delegate int MyDelegate(out char value);<br /></blockquote>
<div><br /></div>
<div>Actually, I'm not 100% sure the above is valid. An &quot;out&quot; parameter on a delegate may not be valid.</div>
</div></blockquote>That works.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/449214-Cant-do-Funcout-char-int-/f7e0e94e9b1b41e3b54d9deb0002ac62#f7e0e94e9b1b41e3b54d9deb0002ac62</link>
		<pubDate>Sat, 20 Dec 2008 05:05:38 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/449214-Cant-do-Funcout-char-int-/f7e0e94e9b1b41e3b54d9deb0002ac62#f7e0e94e9b1b41e3b54d9deb0002ac62</guid>
		<dc:creator>Joe Chung</dc:creator>
		<slash:comments>9</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/joechung/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Can&#39;t do Func&lt;out char, int&gt; ?</title>
		<description><![CDATA[<p>I think what you're looking for, to elaborate on what dpratt has written, is a new delegate along these lines:<br /><pre class="brush: text">
public delegate void OutFunc&lt;TIn, TOut&gt; (TIn inParam, out TOut outParam); 
</pre></p>
<p>&nbsp;</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/449214-Cant-do-Funcout-char-int-/46f63d8453944f0a8d159deb0002ac89#46f63d8453944f0a8d159deb0002ac89</link>
		<pubDate>Sat, 20 Dec 2008 09:01:08 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/449214-Cant-do-Funcout-char-int-/46f63d8453944f0a8d159deb0002ac89#46f63d8453944f0a8d159deb0002ac89</guid>
		<dc:creator>Yggdrasil</dc:creator>
		<slash:comments>9</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Yggdrasil/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Can&#39;t do Func&lt;out char, int&gt; ?</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Yggdrasil said:</div><div class="quoteText">
<p>I think what you're looking for, to elaborate on what dpratt has written, is a new delegate along these lines:<br /></p>
<pre class="brush: text">
public delegate void OutFunc&lt;TIn, TOut&gt; (TIn inParam, out TOut outParam); 
</pre>
<p></p>
<p>&nbsp;</p>
</div></blockquote>That's a bad idea. Your delegate has 1 output value. It should be a regular function that RETURNS the output value. The .NET design guidelines state that ref- and out-parameters should only be used if there's no other option.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/449214-Cant-do-Funcout-char-int-/c11de97d4df74c54b4fd9deb0002acb1#c11de97d4df74c54b4fd9deb0002acb1</link>
		<pubDate>Sat, 20 Dec 2008 11:41:39 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/449214-Cant-do-Funcout-char-int-/c11de97d4df74c54b4fd9deb0002acb1#c11de97d4df74c54b4fd9deb0002acb1</guid>
		<dc:creator>Tommy Carlier</dc:creator>
		<slash:comments>9</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/TommyCarlier/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Can&#39;t do Func&lt;out char, int&gt; ?</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">brian.shapiro said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">evildictaitor said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
evildictator,<br /><br />The syntax shown in Visual Studio is Func&lt;T, TResult&gt; where T is a parameter.<br /><br />Either way, it won't let me pass in a type parameter by reference.<br /><br /></div></blockquote>What does the type have to do with the way how it is passed?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/449214-Cant-do-Funcout-char-int-/f74fbbcdec8940cba0d29deb0002acd8#f74fbbcdec8940cba0d29deb0002acd8</link>
		<pubDate>Sat, 20 Dec 2008 12:04:59 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/449214-Cant-do-Funcout-char-int-/f74fbbcdec8940cba0d29deb0002acd8#f74fbbcdec8940cba0d29deb0002acd8</guid>
		<dc:creator>Christian Liensberger</dc:creator>
		<slash:comments>9</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/littleguru/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Can&#39;t do Func&lt;out char, int&gt; ?</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">TommyCarlier said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">Yggdrasil said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
That's a bad idea. Your delegate has 1 output value. It should be a regular function that RETURNS the output value. The .NET design guidelines state that ref- and out-parameters should only be used if there's no other option. </div></blockquote>
<p>Jeez, can't anybody focus on the issue at hand? Of course it's a pointless method signature, but it serves to illustrate the point of how to represent a generic delegate with an out param, which is what the original poster wanted. A technical question gets
 a technical answer.<br />Would you also like to correct my coding standards, because it's considered unnecessary to add the T prefix to the type definitions?</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/449214-Cant-do-Funcout-char-int-/84c2efc739f14a178c8c9deb0002ad03#84c2efc739f14a178c8c9deb0002ad03</link>
		<pubDate>Sat, 20 Dec 2008 15:56:08 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/449214-Cant-do-Funcout-char-int-/84c2efc739f14a178c8c9deb0002ad03#84c2efc739f14a178c8c9deb0002ad03</guid>
		<dc:creator>Yggdrasil</dc:creator>
		<slash:comments>9</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Yggdrasil/Discussions/RSS</wfw:commentRss>
	</item>
</channel>
</rss>