Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-4076

Support index from end (^) operator

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Won't Do
    • Icon: Unknown Unknown
    • None
    • None
    • LINQ3
    • None

    Description

      C# 8 introduced new syntax to index from the end of an array:

      var last = array[^1];
      

      The C# compiler translates ^ into an Index object. We would need to support new overloads for array access, IEnumerable.ElementAt(Index), and related methods.

      More details on the C#8 syntax can be found here:

      https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/member-access-operators#index-from-end-operator-

      Attachments

        Activity

          People

            james.kovacs@mongodb.com James Kovacs
            james.kovacs@mongodb.com James Kovacs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: