Groups | Blog | Home
all groups > dotnet sdk > october 2007 >

dotnet sdk : List<T>.Sort


Willi Vogl
10/23/2007 2:25:11 PM
Hi,

does anybody have an idea why the List<T>.Sort method is not virtual?
Would be fine to allow subclassing with customer sort implementation to
get e.g. stability for the sort operations.

Br,
Mattias Sjögren
10/23/2007 9:21:19 PM
[quoted text, click to view]

The List class isn't designed to be derived from. Instead the
designers prioritized performance and made methods non-virtual.


Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Ben Voigt [C++ MVP]
11/1/2007 10:37:22 AM

[quoted text, click to view]

Also, the IList interface doesn't include the Sort method, neither does List
implement any ISortableContainer interface. That seems like a serious
omission.

[quoted text, click to view]

AddThis Social Bookmark Button