Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is not currently possible, because extension methods must be in static classes, and static classes can't have operator overloads.</p> <p>Mads Torgersen, C# Language PM says:</p> <blockquote> <p>...for the Orcas release we decided to take the cautious approach and add only regular extension methods, as opposed to extention properties, events, operators, static methods, etc etc. Regular extension methods were what we needed for LINQ, and they had a syntactically minimal design that could not be easily mimicked for some of the other member kinds.</p> <p>We are becoming increasingly aware that other kinds of extension members could be useful, and so we will return to this issue after Orcas. No guarantees, though!</p> </blockquote> <p>Edit:</p> <p>I just noticed, Mads wrote more in the <a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=168224" rel="noreferrer">same article</a>:</p> <blockquote> <p>I am sorry to report that we will not be doing this in the next release. We did take extension members very seriously in our plans, and spent a lot of effort trying to get them right, but in the end we couldn't get it smooth enough, and decided to give way to other interesting features.</p> <p>This is still on our radar for future releases. What will help is if we get a good amount of compelling scenarios that can help drive the right design.</p> </blockquote> <hr> <p><a href="https://github.com/dotnet/csharplang/issues/192" rel="noreferrer">This feature is currently on the table (potentially) for C# 8.0.</a> Mads talks a bit more about implementing it <a href="https://channel9.msdn.com/Blogs/Seth-Juarez/A-Preview-of-C-8-with-Mads-Torgersen#time=32m11s" rel="noreferrer">here</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload