3

I am reading msdn documentation for this keyword. They gave three usages for this keyword as follows

  1. To qualify members hidden by similar names
  2. To pass an object as a parameter to other methods
  3. To declare indexers

and there is no word about the usage of this during constructor chaining.

My question are :

  1. Why they missed out constructor chaining ?
  2. Is in some way that constructor chaining is an application of the above three usages that I am not aware of ?
Telastyn
  • 108,850
  • 29
  • 239
  • 365
Kavin Eswaramoorthy
  • 582
  • 1
  • 7
  • 13
  • 3
    They must have either overlooked it, or simply decided not to discuss it there. The use of `this` with constructors is described here: http://msdn.microsoft.com/en-us/library/ms173115.aspx – Robert Harvey Dec 03 '14 at 06:01

1 Answers1

1

The article you linked says (emphasis mine):

The following are common uses of this:

The article doesn't say that this doesn't have other uses. In fact, it also explicitly says that it doesn't discuss another use of this:

This article discusses the use of this with class instances. For more information about its use in extension methods, see Extension Methods (C# Programming Guide).

If you think that using this in constructor chaining should be discussed in that article, consider filing a bug.

svick
  • 9,999
  • 1
  • 37
  • 51