This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Random Access Iterator into FileStream Buffer
- From: Levente Farkas <lfarkas at mindmaker dot hu>
- To: Stephan Buys <s dot buys at icon dot co dot za>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Fri, 22 Feb 2002 10:48:03 +0100
- Subject: Re: Random Access Iterator into FileStream Buffer
- Organization: Mindmaker Ltd.
- References: <20020222073911.7518575AD6@portal2.mindmaker.hu>
- Reply-to: lfarkas at mindmaker dot hu
Stephan Buys wrote:
>
> Hello all,
>
> Is there a Random Access Iterator to a file stream buffer?
>
> I want to implement a Tuned Boyer-Moore search on a file and use the STL as
> extensively as possible.
>
> If there is none would it be best to first copy the buffer into some sort of
> container (say vector) that does have random access? I don't like this
> scenario as the ifstream already has buffering implemented and copying it
> needlessly would be an unnecessary performance hit.
after I implement it:-( I find in boost/regex/detail/fileiter.hpp
boost::mapfile::iterator where mapfile is a memory mapped file and the
iterator on it is a random access.
--
Levente "Si vis pacem para bellum!"