trsl logo
F.A.Q.

What if my population data structure doesn't provide iterators?

Write one :-). Boost Iterator Facade makes it really easy.

However, keep in mind that pointers are indeed iterators. If your population data structure guarantees to store elements contiguously, and if you can get a pointer to the first element, you have iterators already. See trsl_example2.cpp for an example with a C array.

© Copyright 2007-2011 Renaud Detry.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at www.boost.org/LICENSE_1_0.txt.)
Revised Wed Jan 8 2020 14:43:32.