microsoft / wil

Windows Implementation Library
MIT License
2.58k stars 236 forks source link

IEnumXxx helpers v2 #398

Closed asklar closed 11 months ago

asklar commented 11 months ago

This is another [simplified] attempt at the range-based iterator helpers for IEnumXYZ-style interfaces (v1 can be found in #234). Merging @jonwis's, @oldnewthing's and my approach into this PR. Some notable deltas:

asklar commented 11 months ago

@jonwis I don't have merge permissions so if you're ok with it, can you press the <button/>?

dunhor commented 11 months ago

A couple additional notes that are not urgent as they can be added later if desired:

  1. The iterator type lacks an iterator_category typedef (and other typedefs), which may limit its usability in STL or other algorithms. This should probably be an input iterator I think?
  2. The iterator type lacks a postfix operator++(int) which may also limit its usability in algorithms, and is a requirement for input iterators
asklar commented 11 months ago

@dunhor ~going to write a couple more tests, will ping back in a sec :)~ done