0

The C++ codebase I'm working on calls a C API that returns both a pointer to a list of structs and the length of the list. What would be the idiomatic means of processing this list with ranges? Is there an existing adapter or is creating a custom range_facade type the best way of handling this?

Tim Clemons
  • 6,231
  • 4
  • 25
  • 23

1 Answers1

1

You want to use view::counted(ptr, length) to make a range of length elements starting at ptr.

Eric Niebler
  • 5,927
  • 2
  • 29
  • 43