This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: basic_filebuf question


On Tue, Jan 29, 2002 at 12:37:20PM +0200, Stephan Buys wrote:
> I have thought about creating my own basic_filebuf class with Search 
> implemented and then setting it by using MyFile.rdbuf(&MyBuf). According to 
> documentation I read (C++ Programming Language) this should make my ifstream 
> use my new buffer.

There are two versions of rdbuf(), the base class version and the derived
class version.  The base class version is the one you want.  Unfortunately,
it's hidden by the derived class version.  (Somebody on the LWG needs
to be slapped for this.)  You'll need to access your streams as a base
class for the member resolution to work properly; there are examples in
the mailing lists, on Usenet, and in our own testsuite.

Phil

-- 
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace.  We seek
not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen.            - Samuel Adams


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]