Passing a vector to a function expecting an array

P

peter koch

The two-function solution is similar to Boost.Range. Taking it a step
further:

  pointer_range <int> r (v);
  foo (r.begin (), r.end ());

This fully encapsulates the empty case.

I understand that, but in my opinion data is a low-level means for
interfacing to C-functions. There is no need to provide "full"
functionality in this area.

/Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top