Home | Libraries | People | FAQ | More |
std::vector<async_io_op>
is the closest thing to a variable length array in C++[13], at least until C++ 14 where we will gain std::dynarray<>
and dynamic array sizing.
std::vector<async_io_op>
is well understood, particularly its performance during by-value copies
and during push_back()
which is by far the most common operation
you do when preparing a batch.
std::vector<async_io_op>
is very amenable to splitting the batch across threads (not that AFIO
currently does this).
std::vector<async_io_op>
is easily transportable through an ABI, whereas arbitrary container iterators
would need type erasing (i.e. slow). As AFIO was developed initially
as not header-only, this made a lot of sense initially.
We are not opposed to the use of generic iterator ranges in an AFIO v2 if there is user demand for such a thing.
[13]
Ok, there is also the oft-forgotten std::valarray<>
too, but its use as a generic
container isn't recommended.