trsl logo


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
Revised Wed Apr 6 16:30:07 2011. Logo