Guest User

Untitled

a guest
Jan 23rd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. public class DynamicInputCollection : IEnumerable<int>, IEnumerable<double>
  2. {
  3. private readonly List<int> intList = new List<int>();
  4. private readonly List<double> doubleList = new List<double>();
  5.  
  6. IEnumerator<double> IEnumerable<double>.GetEnumerator()
  7. {
  8. return doubleList.GetEnumerator();
  9. }
  10. IEnumerator<int> IEnumerable<int>.GetEnumerator()
  11. {
  12. return intList.GetEnumerator();
  13. }
  14.  
  15. public IEnumerator GetEnumerator()
  16. {
  17. // How do we deal with this common case, where in context it means two different things?
  18. throw new System.NotImplementedException();
  19. }
  20. }
Add Comment
Please, Sign In to add comment