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

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top