Comparer <T> Constructor

Just out of curiosity, I was looking for the abstract source Source Comparer (T) in mscorlib / system / collections / generic / comparer.cs , and it seemed to me that the constructor was missing from the published source. Any idea why?

+4
source share
1 answer

This is an abstract class (without instance fields), it does not need a constructor, because there is nothing to initialize.

Of course, it will have a default constructor, which is generated by the compiler, which will call any subclass constructor, but it will evaluate the call to the constructor only Object(which in turn doesn't do much: http://referencesource.microsoft.com/#mscorlib/system /object.cs )

+6
source

Source: https://habr.com/ru/post/1540463/


All Articles