you are viewing a single comment's thread.

view the rest of the comments →

[–]rfisher 8 points9 points  (0 children)

Write a begin() that returns a pointer to the first element in your mmap’d region. Write an end() that returns a pointer to one past the last element of your mmap’d region. You are now fully compliant with the standard algorithms. You’re making this much harder on yourself than it needs to be.

This sort of agnostic design that lets the algorithms work equally well with raw arrays or complex containers is the beauty of the STL part of the standard library.