autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AC_CHECK_FILES on /dev/stdin


From: David Fang
Subject: Re: AC_CHECK_FILES on /dev/stdin
Date: Thu, 30 Mar 2006 18:40:24 -0500 (EST)

> >     To give a little more context for what I'm trying to do in C++
> > (experimentally): I've discovered that std::ifstream foo("/dev/stdin")
> > results in a file stream that works just like cin, likewise for stdout,
> > etc...  Just like in standard C, one could use stdin, stdout, stderr as
> > FILE*, I'd like to do the equivalent with std::fstream's.  (std::cin is a
> > basic_istream, not type-equivalent to a basic_ifstream.)
>
> But basic_ifstream is a basic_istream.

Sorry for the confusion, I meant that the need to be *identical*, not just
derivable from the other, because I'm containing their objects (value),
not references.
        struct foo { ifstream _stream; };

> > I'm writing a little stream manager that maintains stream objects (not
> > references to) internally without any run-time polymorphism, so I need
> > one single type to handle both stdio and file streams,
>
> That would be basic_istream/ostream.

But there's no such interface as
        std::istream::open(const char*);
as there is with
        std::ifstream::open(const char*);
which is what I need.

Thanks again for the responses.
I know this is getting a little off-topic!

David





reply via email to

[Prev in Thread] Current Thread [Next in Thread]