<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FGeneric%2Fwhere</id>
		<title>Csharp/CSharp Tutorial/Generic/where - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FGeneric%2Fwhere"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Generic/where&amp;action=history"/>
		<updated>2026-04-30T00:11:40Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Generic/where&amp;diff=5285&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Generic/where&amp;diff=5285&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:53Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:31, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Generic/where&amp;diff=5286&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Generic/where&amp;diff=5286&amp;oldid=prev"/>
				<updated>2010-05-26T12:14:47Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Generic Operator Overloading==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
    class OperatorOverloading&lt;br /&gt;
    {&lt;br /&gt;
        static bool AreReferencesEqual&amp;lt;T&amp;gt;(T first, T second)&lt;br /&gt;
            where T : class&lt;br /&gt;
        {&lt;br /&gt;
            return first == second;&lt;br /&gt;
        }&lt;br /&gt;
        static void Main()&lt;br /&gt;
        {&lt;br /&gt;
            string name = &amp;quot;J&amp;quot;;&lt;br /&gt;
            string intro1 = &amp;quot;My name is &amp;quot; + name;&lt;br /&gt;
            string intro2 = &amp;quot;My name is &amp;quot; + name;&lt;br /&gt;
            Console.WriteLine(intro1 == intro2);&lt;br /&gt;
            Console.WriteLine(AreReferencesEqual(intro1, intro2));&lt;br /&gt;
        }&lt;br /&gt;
    }&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use multiple where clauses==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;Gen has two type arguments and both have a where clause.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System; &lt;br /&gt;
 &lt;br /&gt;
class Gen&amp;lt;T, V&amp;gt; where T : class &lt;br /&gt;
                where V : struct {  &lt;br /&gt;
  T ob1;  &lt;br /&gt;
  V ob2;  &lt;br /&gt;
 &lt;br /&gt;
  public Gen(T t, V v) { &lt;br /&gt;
    ob1 = t; &lt;br /&gt;
    ob2 = v; &lt;br /&gt;
  } &lt;br /&gt;
} &lt;br /&gt;
 &lt;br /&gt;
class MainClass { &lt;br /&gt;
  public static void Main() { &lt;br /&gt;
    Gen&amp;lt;string, int&amp;gt; obj = new Gen&amp;lt;string, int&amp;gt;(&amp;quot;test&amp;quot;, 11); &lt;br /&gt;
 &lt;br /&gt;
    // wrong because bool is not a reference type. &lt;br /&gt;
    // Gen&amp;lt;bool, int&amp;gt; obj = new Gen&amp;lt;bool, int&amp;gt;(true, 11); &lt;br /&gt;
         &lt;br /&gt;
  } &lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==where T: struct==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System.Collections.Generic;&lt;br /&gt;
public class MyValueList&amp;lt;T&amp;gt; where T: struct&lt;br /&gt;
{&lt;br /&gt;
    private List&amp;lt;T&amp;gt; imp = new List&amp;lt;T&amp;gt;();&lt;br /&gt;
    &lt;br /&gt;
    public void Add( T v ) {&lt;br /&gt;
        imp.Add( v );&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
public class MainClass&lt;br /&gt;
{&lt;br /&gt;
    static void Main() {&lt;br /&gt;
        MyValueList&amp;lt;int&amp;gt; intList = new MyValueList&amp;lt;int&amp;gt;();&lt;br /&gt;
        intList.Add( 123 );&lt;br /&gt;
        // CAN&amp;quot;T DO THIS.&lt;br /&gt;
        // MyValueList&amp;lt;object&amp;gt; objList = new MyValueList&amp;lt;object&amp;gt;();&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>