Skip to content

Commit

Permalink
Added indexer operator
Browse files Browse the repository at this point in the history
  • Loading branch information
danielathome19 committed Mar 19, 2023
1 parent 5c70bb5 commit b087ba2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,6 @@ paket-files/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
/Chunk List/Presentation/Chunk List Backup.pdf
/.vscode
/Chunk List/Presentation/Chunk List-review01092019.pdf
11 changes: 11 additions & 0 deletions Chunk List/ChunkList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,17 @@ public T get(int index)
return get(index + 1);
}
}

/// <summary>
/// Override indexer operator (get or set element at specified index)
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
public T this[int index]
{
get { return get(index); }
set { set(index, value); }
}

/// <summary>
/// Prints out all items currently in list, in order by chunk
Expand Down

0 comments on commit b087ba2

Please sign in to comment.